_ZN5Botan15AlignmentBufferIhLm128ELNS_25AlignmentBufferFinalBlockE0EEC2Ev:
   62|  4.44k|      AlignmentBuffer() = default;
_ZN5Botan15AlignmentBufferIhLm128ELNS_25AlignmentBufferFinalBlockE0EE5clearEv:
   71|  84.4k|      void clear() {
   72|  84.4k|         zeroize_buffer(m_buffer.data(), m_buffer.size());
   73|  84.4k|         m_position = 0;
   74|  84.4k|      }
_ZN5Botan15AlignmentBufferIhLm128ELNS_25AlignmentBufferFinalBlockE0EED2Ev:
   64|  4.44k|      ~AlignmentBuffer() { secure_zeroize_buffer(m_buffer.data(), sizeof(T) * m_buffer.size()); }
_ZN5Botan15AlignmentBufferIhLm128ELNS_25AlignmentBufferFinalBlockE0EE21handle_unaligned_dataERNS_12BufferSlicerE:
  166|   164k|      [[nodiscard]] std::optional<std::span<const T>> handle_unaligned_data(BufferSlicer& slicer) {
  167|       |         // When the final block is to be deferred, we would need to store and
  168|       |         // hold a buffer that contains exactly one block until more data is
  169|       |         // passed or it is explicitly consumed.
  170|   164k|         const size_t defer = (defers_final_block()) ? 1 : 0;
  ------------------
  |  Branch (170:31): [True: 0, False: 164k]
  ------------------
  171|       |
  172|   164k|         if(in_alignment() && slicer.remaining() >= m_buffer.size() + defer) {
  ------------------
  |  Branch (172:13): [True: 142k, False: 22.2k]
  |  Branch (172:31): [True: 79.9k, False: 62.2k]
  ------------------
  173|       |            // We are currently in alignment and the passed-in data source
  174|       |            // contains enough data to benefit from aligned processing.
  175|       |            // Therefore, we don't copy anything into the intermittent buffer.
  176|  79.9k|            return std::nullopt;
  177|  79.9k|         }
  178|       |
  179|       |         // Fill the buffer with as much input data as needed to reach alignment
  180|       |         // or until the input source is depleted.
  181|  84.4k|         const auto elements_to_consume = std::min(m_buffer.size() - m_position, slicer.remaining());
  182|  84.4k|         append(slicer.take(elements_to_consume));
  183|       |
  184|       |         // If we collected enough data, we push out one full block. When
  185|       |         // deferring the final block is enabled, we additionally check that
  186|       |         // more input data is available to continue processing a consecutive
  187|       |         // block.
  188|  84.4k|         if(ready_to_consume() && (!defers_final_block() || !slicer.empty())) {
  ------------------
  |  Branch (188:13): [True: 0, False: 84.4k]
  |  Branch (188:36): [True: 0, False: 0]
  |  Branch (188:61): [True: 0, False: 0]
  ------------------
  189|      0|            return consume();
  190|  84.4k|         } else {
  191|  84.4k|            return std::nullopt;
  192|  84.4k|         }
  193|  84.4k|      }
_ZNK5Botan15AlignmentBufferIhLm128ELNS_25AlignmentBufferFinalBlockE0EE18defers_final_blockEv:
  233|   244k|      constexpr bool defers_final_block() const {
  234|   244k|         return FINAL_BLOCK_STRATEGY == AlignmentBufferFinalBlock::must_be_deferred;
  235|   244k|      }
_ZN5Botan15AlignmentBufferIhLm128ELNS_25AlignmentBufferFinalBlockE0EE6appendENSt3__14spanIKhLm18446744073709551615EEE:
   90|   146k|      void append(std::span<const T> elements) {
   91|   146k|         BOTAN_ASSERT_NOMSG(elements.size() <= elements_until_alignment());
  ------------------
  |  |   77|   146k|   do {                                                                     \
  |  |   78|   146k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   79|   146k|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (79:10): [True: 0, False: 146k]
  |  |  ------------------
  |  |   80|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   81|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   82|      0|      }                                                                     \
  |  |   83|   146k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (83:12): [Folded, False: 146k]
  |  |  ------------------
  ------------------
   92|   146k|         std::copy(elements.begin(), elements.end(), m_buffer.begin() + m_position);
   93|   146k|         m_position += elements.size();
   94|   146k|      }
_ZNK5Botan15AlignmentBufferIhLm128ELNS_25AlignmentBufferFinalBlockE0EE24elements_until_alignmentEv:
  221|   333k|      size_t elements_until_alignment() const { return m_buffer.size() - m_position; }
_ZNK5Botan15AlignmentBufferIhLm128ELNS_25AlignmentBufferFinalBlockE0EE16ready_to_consumeEv:
  231|   271k|      bool ready_to_consume() const { return m_position == m_buffer.size(); }
_ZN5Botan15AlignmentBufferIhLm128ELNS_25AlignmentBufferFinalBlockE0EE7consumeEv:
  200|  62.2k|      [[nodiscard]] std::span<const T> consume() {
  201|  62.2k|         BOTAN_ASSERT_NOMSG(ready_to_consume());
  ------------------
  |  |   77|  62.2k|   do {                                                                     \
  |  |   78|  62.2k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   79|  62.2k|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (79:10): [True: 0, False: 62.2k]
  |  |  ------------------
  |  |   80|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   81|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   82|      0|      }                                                                     \
  |  |   83|  62.2k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (83:12): [Folded, False: 62.2k]
  |  |  ------------------
  ------------------
  202|  62.2k|         m_position = 0;
  203|  62.2k|         return m_buffer;
  204|  62.2k|      }
_ZNK5Botan15AlignmentBufferIhLm128ELNS_25AlignmentBufferFinalBlockE0EE12in_alignmentEv:
  226|   408k|      bool in_alignment() const { return m_position == 0; }
_ZNK5Botan15AlignmentBufferIhLm128ELNS_25AlignmentBufferFinalBlockE0EE23aligned_data_to_processERNS_12BufferSlicerE:
  126|  79.9k|      [[nodiscard]] std::tuple<std::span<const uint8_t>, size_t> aligned_data_to_process(BufferSlicer& slicer) const {
  127|  79.9k|         BOTAN_ASSERT_NOMSG(in_alignment());
  ------------------
  |  |   77|  79.9k|   do {                                                                     \
  |  |   78|  79.9k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   79|  79.9k|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (79:10): [True: 0, False: 79.9k]
  |  |  ------------------
  |  |   80|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   81|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   82|      0|      }                                                                     \
  |  |   83|  79.9k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (83:12): [Folded, False: 79.9k]
  |  |  ------------------
  ------------------
  128|       |
  129|       |         // When the final block is to be deferred, the last block must not be
  130|       |         // selected for processing if there is no (unaligned) extra input data.
  131|  79.9k|         const size_t defer = (defers_final_block()) ? 1 : 0;
  ------------------
  |  Branch (131:31): [True: 0, False: 79.9k]
  ------------------
  132|  79.9k|         const size_t full_blocks_to_process = (slicer.remaining() - defer) / m_buffer.size();
  133|  79.9k|         return {slicer.take(full_blocks_to_process * m_buffer.size()), full_blocks_to_process};
  134|  79.9k|      }
_ZN5Botan15AlignmentBufferIhLm128ELNS_25AlignmentBufferFinalBlockE0EE18fill_up_with_zerosEv:
   79|  62.2k|      void fill_up_with_zeros() {
   80|  62.2k|         if(!ready_to_consume()) {
  ------------------
  |  Branch (80:13): [True: 62.2k, False: 0]
  ------------------
   81|  62.2k|            zeroize_buffer(&m_buffer[m_position], elements_until_alignment());
   82|  62.2k|            m_position = m_buffer.size();
   83|  62.2k|         }
   84|  62.2k|      }
_ZN5Botan15AlignmentBufferIhLm128ELNS_25AlignmentBufferFinalBlockE0EE20directly_modify_lastEm:
  113|  62.2k|      std::span<T> directly_modify_last(size_t elements) {
  114|  62.2k|         BOTAN_ASSERT_NOMSG(size() >= elements);
  ------------------
  |  |   77|  62.2k|   do {                                                                     \
  |  |   78|  62.2k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   79|  62.2k|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (79:10): [True: 0, False: 62.2k]
  |  |  ------------------
  |  |   80|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   81|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   82|      0|      }                                                                     \
  |  |   83|  62.2k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (83:12): [Folded, False: 62.2k]
  |  |  ------------------
  ------------------
  115|  62.2k|         return std::span(m_buffer).last(elements);
  116|  62.2k|      }
_ZNK5Botan15AlignmentBufferIhLm128ELNS_25AlignmentBufferFinalBlockE0EE4sizeEv:
  217|  62.2k|      constexpr size_t size() const { return m_buffer.size(); }

_ZN5Botan6chooseITkNSt3__117unsigned_integralEmEET_S2_S2_S2_:
  216|  22.7M|BOTAN_FORCE_INLINE constexpr T choose(T mask, T a, T b) {
  217|       |   //return (mask & a) | (~mask & b);
  218|  22.7M|   return (b ^ (mask & (a ^ b)));
  219|  22.7M|}
_ZN5Botan8majorityITkNSt3__117unsigned_integralEmEET_S2_S2_S2_:
  222|  11.3M|BOTAN_FORCE_INLINE constexpr T majority(T a, T b, T c) {
  223|       |   /*
  224|       |   Considering each bit of a, b, c individually
  225|       |
  226|       |   If a xor b is set, then c is the deciding vote.
  227|       |
  228|       |   If a xor b is not set then either a and b are both set or both unset.
  229|       |   In either case the value of c doesn't matter, and examining b (or a)
  230|       |   allows us to determine which case we are in.
  231|       |   */
  232|  11.3M|   return choose(a ^ b, c, b);
  233|  11.3M|}

_ZN5Botan13reverse_bytesITkNSt3__117unsigned_integralEmQooooooeqstT_Li1EeqstS2_Li2EeqstS2_Li4EeqstS2_Li8EEES2_S2_:
   27|  2.83M|inline constexpr T reverse_bytes(T x) {
   28|       |   if constexpr(sizeof(T) == 1) {
   29|       |      return x;
   30|       |   } else if constexpr(sizeof(T) == 2) {
   31|       |#if BOTAN_COMPILER_HAS_BUILTIN(__builtin_bswap16)
   32|       |      return static_cast<T>(__builtin_bswap16(x));
   33|       |#else
   34|       |      return static_cast<T>((x << 8) | (x >> 8));
   35|       |#endif
   36|       |   } else if constexpr(sizeof(T) == 4) {
   37|       |#if BOTAN_COMPILER_HAS_BUILTIN(__builtin_bswap32)
   38|       |      return static_cast<T>(__builtin_bswap32(x));
   39|       |#else
   40|       |      // MSVC at least recognizes this as a bswap
   41|       |      return static_cast<T>(((x & 0x000000FF) << 24) | ((x & 0x0000FF00) << 8) | ((x & 0x00FF0000) >> 8) |
   42|       |                            ((x & 0xFF000000) >> 24));
   43|       |#endif
   44|  2.83M|   } else if constexpr(sizeof(T) == 8) {
   45|  2.83M|#if BOTAN_COMPILER_HAS_BUILTIN(__builtin_bswap64)
   46|  2.83M|      return static_cast<T>(__builtin_bswap64(x));
   47|       |#else
   48|       |      uint32_t hi = static_cast<uint32_t>(x >> 32);
   49|       |      uint32_t lo = static_cast<uint32_t>(x);
   50|       |
   51|       |      hi = reverse_bytes(hi);
   52|       |      lo = reverse_bytes(lo);
   53|       |
   54|       |      return (static_cast<T>(lo) << 32) | hi;
   55|       |#endif
   56|  2.83M|   }
   57|  2.83M|}

_ZN5Botan12BufferSlicerC2ENSt3__14spanIKhLm18446744073709551615EEE:
   25|   306k|      explicit BufferSlicer(std::span<const uint8_t> buffer) : m_remaining(buffer) {}
_ZNK5Botan12BufferSlicer5emptyEv:
   68|   328k|      bool empty() const { return m_remaining.empty(); }
_ZN5Botan12BufferSlicer4takeEm:
   37|   164k|      std::span<const uint8_t> take(const size_t count) {
   38|   164k|         BOTAN_STATE_CHECK(remaining() >= count);
  ------------------
  |  |   51|   164k|   do {                                                         \
  |  |   52|   164k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */             \
  |  |   53|   164k|      if(!(expr)) {                                             \
  |  |  ------------------
  |  |  |  Branch (53:10): [True: 0, False: 164k]
  |  |  ------------------
  |  |   54|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */    \
  |  |   55|      0|         Botan::throw_invalid_state(#expr, __func__, __FILE__); \
  |  |   56|      0|      }                                                         \
  |  |   57|   164k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (57:12): [Folded, False: 164k]
  |  |  ------------------
  ------------------
   39|   164k|         auto result = m_remaining.first(count);
   40|   164k|         m_remaining = m_remaining.subspan(count);
   41|   164k|         return result;
   42|   164k|      }
_ZNK5Botan12BufferSlicer9remainingEv:
   66|   613k|      size_t remaining() const { return m_remaining.size(); }
_ZN5Botan12BufferSlicer4takeILm128EEENSt3__14spanIKhXT_EEEv:
   45|   142k|      std::span<const uint8_t, count> take() {
   46|   142k|         BOTAN_STATE_CHECK(remaining() >= count);
  ------------------
  |  |   51|   142k|   do {                                                         \
  |  |   52|   142k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */             \
  |  |   53|   142k|      if(!(expr)) {                                             \
  |  |  ------------------
  |  |  |  Branch (53:10): [True: 0, False: 142k]
  |  |  ------------------
  |  |   54|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */    \
  |  |   55|      0|         Botan::throw_invalid_state(#expr, __func__, __FILE__); \
  |  |   56|      0|      }                                                         \
  |  |   57|   142k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (57:12): [Folded, False: 142k]
  |  |  ------------------
  ------------------
   47|   142k|         auto result = m_remaining.first<count>();
   48|   142k|         m_remaining = m_remaining.subspan(count);
   49|   142k|         return result;
   50|   142k|      }

_ZN5Botan5CRC245clearEv:
   33|  42.5k|      void clear() override { m_crc = 0xCE04B7; }
_ZNK5Botan5CRC2413output_lengthEv:
   25|  86.4k|      size_t output_length() const override { return 3; }

_ZN16botan_rng_structC2ENSt3__110unique_ptrIN5Botan21RandomNumberGeneratorENS0_14default_deleteIS3_EEEE:
   63|  4.44k|         explicit NAME(std::unique_ptr<TYPE> x) : botan_struct(std::move(x)) {} \
_ZNK9Botan_FFI12botan_structIN5Botan21RandomNumberGeneratorELj1224866241EE8magic_okEv:
   50|  4.44k|      bool magic_ok() const { return (m_magic == MAGIC); }
ffi_hash.cpp:_ZN9Botan_FFI15ffi_guard_thunkITkNSt3__19invocableEZ15botan_hash_initE3$_0EEiPKcT_:
   95|  43.9k|int ffi_guard_thunk(const char* func_name, T thunk) {
   96|  43.9k|   ffi_clear_last_exception();
   97|       |
   98|  43.9k|   try {
   99|  43.9k|      return thunk();
  100|  43.9k|   } catch(std::bad_alloc&) {
  101|      0|      return ffi_error_exception_thrown(func_name, "bad_alloc", BOTAN_FFI_ERROR_OUT_OF_MEMORY);
  102|      0|   } catch(Botan_FFI::FFI_Error& e) {
  103|      0|      return ffi_error_exception_thrown(func_name, e.what(), e.error_code());
  104|      0|   } catch(Botan::Exception& e) {
  105|      0|      return ffi_error_exception_thrown(func_name, e.what(), e.error_type());
  106|      0|   } catch(std::exception& e) {
  107|      0|      return ffi_error_exception_thrown(func_name, e.what(), BOTAN_FFI_ERROR_EXCEPTION_THROWN);
  108|      0|   } catch(...) {
  109|      0|      return ffi_error_exception_thrown(func_name, "unknown exception", BOTAN_FFI_ERROR_EXCEPTION_THROWN);
  110|      0|   }
  111|  43.9k|}
_ZN9Botan_FFI14ffi_new_objectIP17botan_hash_structJNSt3__110unique_ptrIN5Botan12HashFunctionENS3_14default_deleteIS6_EEEEEEE15BOTAN_FFI_ERRORPT_DpOT0_:
  178|  43.9k|BOTAN_FFI_ERROR ffi_new_object(T* obj, Args&&... args) {
  179|  43.9k|   if(obj == nullptr) {
  ------------------
  |  Branch (179:7): [True: 0, False: 43.9k]
  ------------------
  180|      0|      return BOTAN_FFI_ERROR_NULL_POINTER;
  181|      0|   }
  182|       |   // NOLINTNEXTLINE(*-owning-memory)
  183|  43.9k|   *obj = new std::remove_pointer_t<T>(std::forward<Args>(args)...);
  184|  43.9k|   return BOTAN_FFI_SUCCESS;
  185|  43.9k|}
_ZN17botan_hash_structC2ENSt3__110unique_ptrIN5Botan12HashFunctionENS0_14default_deleteIS3_EEEE:
   63|  43.9k|         explicit NAME(std::unique_ptr<TYPE> x) : botan_struct(std::move(x)) {} \
_ZN9Botan_FFI12botan_structIN5Botan12HashFunctionELj520769412EEC2ENSt3__110unique_ptrIS2_NS4_14default_deleteIS2_EEEE:
   38|  43.9k|      explicit botan_struct(std::unique_ptr<T> obj) : m_magic(MAGIC), m_obj(std::move(obj)) {}
_ZN9Botan_FFI12botan_structIN5Botan12HashFunctionELj520769412EED2Ev:
   40|  43.9k|      virtual ~botan_struct() {
   41|  43.9k|         m_magic = 0;
   42|  43.9k|         m_obj.reset();  // NOLINT(*-ambiguous-smartptr-reset-call)
   43|  43.9k|      }
_ZN9Botan_FFI17ffi_delete_objectIN5Botan12HashFunctionELj520769412EEEiPNS_12botan_structIT_XT0_EEEPKc:
  161|  43.9k|int ffi_delete_object(botan_struct<T, M>* obj, const char* func_name) {
  162|  43.9k|   return ffi_guard_thunk(func_name, [=]() -> int {
  163|       |      // ignore delete of null objects
  164|  43.9k|      if(obj == nullptr) {
  165|  43.9k|         return BOTAN_FFI_SUCCESS;
  166|  43.9k|      }
  167|       |
  168|  43.9k|      if(!obj->magic_ok()) {
  169|  43.9k|         return BOTAN_FFI_ERROR_INVALID_OBJECT;
  170|  43.9k|      }
  171|       |
  172|  43.9k|      delete obj;  // NOLINT(*-owning-memory)
  173|  43.9k|      return BOTAN_FFI_SUCCESS;
  174|  43.9k|   });
  175|  43.9k|}
_ZN9Botan_FFI15ffi_guard_thunkITkNSt3__19invocableEZNS_17ffi_delete_objectIN5Botan12HashFunctionELj520769412EEEiPNS_12botan_structIT_XT0_EEEPKcEUlvE_EEiSA_S6_:
   95|  43.9k|int ffi_guard_thunk(const char* func_name, T thunk) {
   96|  43.9k|   ffi_clear_last_exception();
   97|       |
   98|  43.9k|   try {
   99|  43.9k|      return thunk();
  100|  43.9k|   } catch(std::bad_alloc&) {
  101|      0|      return ffi_error_exception_thrown(func_name, "bad_alloc", BOTAN_FFI_ERROR_OUT_OF_MEMORY);
  102|      0|   } catch(Botan_FFI::FFI_Error& e) {
  103|      0|      return ffi_error_exception_thrown(func_name, e.what(), e.error_code());
  104|      0|   } catch(Botan::Exception& e) {
  105|      0|      return ffi_error_exception_thrown(func_name, e.what(), e.error_type());
  106|      0|   } catch(std::exception& e) {
  107|      0|      return ffi_error_exception_thrown(func_name, e.what(), BOTAN_FFI_ERROR_EXCEPTION_THROWN);
  108|      0|   } catch(...) {
  109|      0|      return ffi_error_exception_thrown(func_name, "unknown exception", BOTAN_FFI_ERROR_EXCEPTION_THROWN);
  110|      0|   }
  111|  43.9k|}
_ZZN9Botan_FFI17ffi_delete_objectIN5Botan12HashFunctionELj520769412EEEiPNS_12botan_structIT_XT0_EEEPKcENKUlvE_clEv:
  162|  43.9k|   return ffi_guard_thunk(func_name, [=]() -> int {
  163|       |      // ignore delete of null objects
  164|  43.9k|      if(obj == nullptr) {
  ------------------
  |  Branch (164:10): [True: 0, False: 43.9k]
  ------------------
  165|      0|         return BOTAN_FFI_SUCCESS;
  166|      0|      }
  167|       |
  168|  43.9k|      if(!obj->magic_ok()) {
  ------------------
  |  Branch (168:10): [True: 0, False: 43.9k]
  ------------------
  169|      0|         return BOTAN_FFI_ERROR_INVALID_OBJECT;
  170|      0|      }
  171|       |
  172|  43.9k|      delete obj;  // NOLINT(*-owning-memory)
  173|  43.9k|      return BOTAN_FFI_SUCCESS;
  174|  43.9k|   });
_ZNK9Botan_FFI12botan_structIN5Botan12HashFunctionELj520769412EE8magic_okEv:
   50|   213k|      bool magic_ok() const { return (m_magic == MAGIC); }
ffi_hash.cpp:_ZN9Botan_FFI15botan_ffi_visitIN5Botan12HashFunctionELj520769412EZ24botan_hash_output_lengthE3$_0EEiPNS_12botan_structIT_XT0_EEET1_PKc:
  114|  43.9k|int botan_ffi_visit(botan_struct<T, M>* o, F func, const char* func_name) {
  115|  43.9k|   using RetT = std::invoke_result_t<F, T&>;
  116|  43.9k|   static_assert(std::is_void_v<RetT> || std::is_same_v<RetT, BOTAN_FFI_ERROR> || std::is_same_v<RetT, int>,
  117|  43.9k|                 "BOTAN_FFI_DO must be used with a block that returns either nothing, int or BOTAN_FFI_ERROR");
  118|       |
  119|  43.9k|   if(!o) {
  ------------------
  |  Branch (119:7): [True: 0, False: 43.9k]
  ------------------
  120|      0|      return BOTAN_FFI_ERROR_NULL_POINTER;
  121|      0|   }
  122|       |
  123|  43.9k|   if(!o->magic_ok()) {
  ------------------
  |  Branch (123:7): [True: 0, False: 43.9k]
  ------------------
  124|      0|      return BOTAN_FFI_ERROR_INVALID_OBJECT;
  125|      0|   }
  126|       |
  127|  43.9k|   T* p = o->unsafe_get();
  128|  43.9k|   if(p == nullptr) {
  ------------------
  |  Branch (128:7): [True: 0, False: 43.9k]
  ------------------
  129|      0|      return BOTAN_FFI_ERROR_INVALID_OBJECT;
  130|      0|   }
  131|       |
  132|  43.9k|   if constexpr(std::is_void_v<RetT>) {
  133|  43.9k|      return ffi_guard_thunk(func_name, [&] {
  134|  43.9k|         func(*p);
  135|  43.9k|         return BOTAN_FFI_SUCCESS;
  136|  43.9k|      });
  137|       |   } else {
  138|       |      return ffi_guard_thunk(func_name, [&] { return func(*p); });
  139|       |   }
  140|  43.9k|}
_ZNK9Botan_FFI12botan_structIN5Botan12HashFunctionELj520769412EE10unsafe_getEv:
   52|   169k|      T* unsafe_get() const { return m_obj.get(); }
ffi_hash.cpp:_ZN9Botan_FFI15ffi_guard_thunkITkNSt3__19invocableEZNS_15botan_ffi_visitIN5Botan12HashFunctionELj520769412EZ24botan_hash_output_lengthE3$_0EEiPNS_12botan_structIT_XT0_EEET1_PKcEUlvE_EEiSC_S7_:
   95|  43.9k|int ffi_guard_thunk(const char* func_name, T thunk) {
   96|  43.9k|   ffi_clear_last_exception();
   97|       |
   98|  43.9k|   try {
   99|  43.9k|      return thunk();
  100|  43.9k|   } catch(std::bad_alloc&) {
  101|      0|      return ffi_error_exception_thrown(func_name, "bad_alloc", BOTAN_FFI_ERROR_OUT_OF_MEMORY);
  102|      0|   } catch(Botan_FFI::FFI_Error& e) {
  103|      0|      return ffi_error_exception_thrown(func_name, e.what(), e.error_code());
  104|      0|   } catch(Botan::Exception& e) {
  105|      0|      return ffi_error_exception_thrown(func_name, e.what(), e.error_type());
  106|      0|   } catch(std::exception& e) {
  107|      0|      return ffi_error_exception_thrown(func_name, e.what(), BOTAN_FFI_ERROR_EXCEPTION_THROWN);
  108|      0|   } catch(...) {
  109|      0|      return ffi_error_exception_thrown(func_name, "unknown exception", BOTAN_FFI_ERROR_EXCEPTION_THROWN);
  110|      0|   }
  111|  43.9k|}
ffi_hash.cpp:_ZZN9Botan_FFI15botan_ffi_visitIN5Botan12HashFunctionELj520769412EZ24botan_hash_output_lengthE3$_0EEiPNS_12botan_structIT_XT0_EEET1_PKcENKUlvE_clEv:
  133|  43.9k|      return ffi_guard_thunk(func_name, [&] {
  134|  43.9k|         func(*p);
  135|  43.9k|         return BOTAN_FFI_SUCCESS;
  136|  43.9k|      });
ffi_hash.cpp:_ZZ24botan_hash_output_lengthENK3$_0clIN5Botan12HashFunctionEEEDaRKT_:
  158|  43.9k|#define BOTAN_FFI_VISIT(obj, lambda) botan_ffi_visit(obj, lambda, __func__)
ffi_hash.cpp:_ZN9Botan_FFI15botan_ffi_visitIN5Botan12HashFunctionELj520769412EZ17botan_hash_updateE3$_0EEiPNS_12botan_structIT_XT0_EEET1_PKc:
  114|  83.3k|int botan_ffi_visit(botan_struct<T, M>* o, F func, const char* func_name) {
  115|  83.3k|   using RetT = std::invoke_result_t<F, T&>;
  116|  83.3k|   static_assert(std::is_void_v<RetT> || std::is_same_v<RetT, BOTAN_FFI_ERROR> || std::is_same_v<RetT, int>,
  117|  83.3k|                 "BOTAN_FFI_DO must be used with a block that returns either nothing, int or BOTAN_FFI_ERROR");
  118|       |
  119|  83.3k|   if(!o) {
  ------------------
  |  Branch (119:7): [True: 0, False: 83.3k]
  ------------------
  120|      0|      return BOTAN_FFI_ERROR_NULL_POINTER;
  121|      0|   }
  122|       |
  123|  83.3k|   if(!o->magic_ok()) {
  ------------------
  |  Branch (123:7): [True: 0, False: 83.3k]
  ------------------
  124|      0|      return BOTAN_FFI_ERROR_INVALID_OBJECT;
  125|      0|   }
  126|       |
  127|  83.3k|   T* p = o->unsafe_get();
  128|  83.3k|   if(p == nullptr) {
  ------------------
  |  Branch (128:7): [True: 0, False: 83.3k]
  ------------------
  129|      0|      return BOTAN_FFI_ERROR_INVALID_OBJECT;
  130|      0|   }
  131|       |
  132|  83.3k|   if constexpr(std::is_void_v<RetT>) {
  133|  83.3k|      return ffi_guard_thunk(func_name, [&] {
  134|  83.3k|         func(*p);
  135|  83.3k|         return BOTAN_FFI_SUCCESS;
  136|  83.3k|      });
  137|       |   } else {
  138|       |      return ffi_guard_thunk(func_name, [&] { return func(*p); });
  139|       |   }
  140|  83.3k|}
ffi_hash.cpp:_ZN9Botan_FFI15ffi_guard_thunkITkNSt3__19invocableEZNS_15botan_ffi_visitIN5Botan12HashFunctionELj520769412EZ17botan_hash_updateE3$_0EEiPNS_12botan_structIT_XT0_EEET1_PKcEUlvE_EEiSC_S7_:
   95|  83.3k|int ffi_guard_thunk(const char* func_name, T thunk) {
   96|  83.3k|   ffi_clear_last_exception();
   97|       |
   98|  83.3k|   try {
   99|  83.3k|      return thunk();
  100|  83.3k|   } catch(std::bad_alloc&) {
  101|      0|      return ffi_error_exception_thrown(func_name, "bad_alloc", BOTAN_FFI_ERROR_OUT_OF_MEMORY);
  102|      0|   } catch(Botan_FFI::FFI_Error& e) {
  103|      0|      return ffi_error_exception_thrown(func_name, e.what(), e.error_code());
  104|      0|   } catch(Botan::Exception& e) {
  105|      0|      return ffi_error_exception_thrown(func_name, e.what(), e.error_type());
  106|      0|   } catch(std::exception& e) {
  107|      0|      return ffi_error_exception_thrown(func_name, e.what(), BOTAN_FFI_ERROR_EXCEPTION_THROWN);
  108|      0|   } catch(...) {
  109|      0|      return ffi_error_exception_thrown(func_name, "unknown exception", BOTAN_FFI_ERROR_EXCEPTION_THROWN);
  110|      0|   }
  111|  83.3k|}
ffi_hash.cpp:_ZZN9Botan_FFI15botan_ffi_visitIN5Botan12HashFunctionELj520769412EZ17botan_hash_updateE3$_0EEiPNS_12botan_structIT_XT0_EEET1_PKcENKUlvE_clEv:
  133|  83.3k|      return ffi_guard_thunk(func_name, [&] {
  134|  83.3k|         func(*p);
  135|  83.3k|         return BOTAN_FFI_SUCCESS;
  136|  83.3k|      });
ffi_hash.cpp:_ZZ17botan_hash_updateENK3$_0clIN5Botan12HashFunctionEEEDaRT_:
  158|  83.3k|#define BOTAN_FFI_VISIT(obj, lambda) botan_ffi_visit(obj, lambda, __func__)
ffi_hash.cpp:_ZN9Botan_FFI15botan_ffi_visitIN5Botan12HashFunctionELj520769412EZ16botan_hash_finalE3$_0EEiPNS_12botan_structIT_XT0_EEET1_PKc:
  114|  42.5k|int botan_ffi_visit(botan_struct<T, M>* o, F func, const char* func_name) {
  115|  42.5k|   using RetT = std::invoke_result_t<F, T&>;
  116|  42.5k|   static_assert(std::is_void_v<RetT> || std::is_same_v<RetT, BOTAN_FFI_ERROR> || std::is_same_v<RetT, int>,
  117|  42.5k|                 "BOTAN_FFI_DO must be used with a block that returns either nothing, int or BOTAN_FFI_ERROR");
  118|       |
  119|  42.5k|   if(!o) {
  ------------------
  |  Branch (119:7): [True: 0, False: 42.5k]
  ------------------
  120|      0|      return BOTAN_FFI_ERROR_NULL_POINTER;
  121|      0|   }
  122|       |
  123|  42.5k|   if(!o->magic_ok()) {
  ------------------
  |  Branch (123:7): [True: 0, False: 42.5k]
  ------------------
  124|      0|      return BOTAN_FFI_ERROR_INVALID_OBJECT;
  125|      0|   }
  126|       |
  127|  42.5k|   T* p = o->unsafe_get();
  128|  42.5k|   if(p == nullptr) {
  ------------------
  |  Branch (128:7): [True: 0, False: 42.5k]
  ------------------
  129|      0|      return BOTAN_FFI_ERROR_INVALID_OBJECT;
  130|      0|   }
  131|       |
  132|  42.5k|   if constexpr(std::is_void_v<RetT>) {
  133|  42.5k|      return ffi_guard_thunk(func_name, [&] {
  134|  42.5k|         func(*p);
  135|  42.5k|         return BOTAN_FFI_SUCCESS;
  136|  42.5k|      });
  137|       |   } else {
  138|       |      return ffi_guard_thunk(func_name, [&] { return func(*p); });
  139|       |   }
  140|  42.5k|}
ffi_hash.cpp:_ZN9Botan_FFI15ffi_guard_thunkITkNSt3__19invocableEZNS_15botan_ffi_visitIN5Botan12HashFunctionELj520769412EZ16botan_hash_finalE3$_0EEiPNS_12botan_structIT_XT0_EEET1_PKcEUlvE_EEiSC_S7_:
   95|  42.5k|int ffi_guard_thunk(const char* func_name, T thunk) {
   96|  42.5k|   ffi_clear_last_exception();
   97|       |
   98|  42.5k|   try {
   99|  42.5k|      return thunk();
  100|  42.5k|   } catch(std::bad_alloc&) {
  101|      0|      return ffi_error_exception_thrown(func_name, "bad_alloc", BOTAN_FFI_ERROR_OUT_OF_MEMORY);
  102|      0|   } catch(Botan_FFI::FFI_Error& e) {
  103|      0|      return ffi_error_exception_thrown(func_name, e.what(), e.error_code());
  104|      0|   } catch(Botan::Exception& e) {
  105|      0|      return ffi_error_exception_thrown(func_name, e.what(), e.error_type());
  106|      0|   } catch(std::exception& e) {
  107|      0|      return ffi_error_exception_thrown(func_name, e.what(), BOTAN_FFI_ERROR_EXCEPTION_THROWN);
  108|      0|   } catch(...) {
  109|      0|      return ffi_error_exception_thrown(func_name, "unknown exception", BOTAN_FFI_ERROR_EXCEPTION_THROWN);
  110|      0|   }
  111|  42.5k|}
ffi_hash.cpp:_ZZN9Botan_FFI15botan_ffi_visitIN5Botan12HashFunctionELj520769412EZ16botan_hash_finalE3$_0EEiPNS_12botan_structIT_XT0_EEET1_PKcENKUlvE_clEv:
  133|  42.5k|      return ffi_guard_thunk(func_name, [&] {
  134|  42.5k|         func(*p);
  135|  42.5k|         return BOTAN_FFI_SUCCESS;
  136|  42.5k|      });
ffi_hash.cpp:_ZZ16botan_hash_finalENK3$_0clIN5Botan12HashFunctionEEEDaRT_:
  158|  42.5k|#define BOTAN_FFI_VISIT(obj, lambda) botan_ffi_visit(obj, lambda, __func__)
ffi_rng.cpp:_ZN9Botan_FFI15ffi_guard_thunkITkNSt3__19invocableEZ14botan_rng_initE3$_0EEiPKcT_:
   95|  4.44k|int ffi_guard_thunk(const char* func_name, T thunk) {
   96|  4.44k|   ffi_clear_last_exception();
   97|       |
   98|  4.44k|   try {
   99|  4.44k|      return thunk();
  100|  4.44k|   } catch(std::bad_alloc&) {
  101|      0|      return ffi_error_exception_thrown(func_name, "bad_alloc", BOTAN_FFI_ERROR_OUT_OF_MEMORY);
  102|      0|   } catch(Botan_FFI::FFI_Error& e) {
  103|      0|      return ffi_error_exception_thrown(func_name, e.what(), e.error_code());
  104|      0|   } catch(Botan::Exception& e) {
  105|      0|      return ffi_error_exception_thrown(func_name, e.what(), e.error_type());
  106|      0|   } catch(std::exception& e) {
  107|      0|      return ffi_error_exception_thrown(func_name, e.what(), BOTAN_FFI_ERROR_EXCEPTION_THROWN);
  108|      0|   } catch(...) {
  109|      0|      return ffi_error_exception_thrown(func_name, "unknown exception", BOTAN_FFI_ERROR_EXCEPTION_THROWN);
  110|      0|   }
  111|  4.44k|}
_ZN9Botan_FFI14ffi_new_objectIP16botan_rng_structJNSt3__110unique_ptrIN5Botan21RandomNumberGeneratorENS3_14default_deleteIS6_EEEEEEE15BOTAN_FFI_ERRORPT_DpOT0_:
  178|  4.44k|BOTAN_FFI_ERROR ffi_new_object(T* obj, Args&&... args) {
  179|  4.44k|   if(obj == nullptr) {
  ------------------
  |  Branch (179:7): [True: 0, False: 4.44k]
  ------------------
  180|      0|      return BOTAN_FFI_ERROR_NULL_POINTER;
  181|      0|   }
  182|       |   // NOLINTNEXTLINE(*-owning-memory)
  183|  4.44k|   *obj = new std::remove_pointer_t<T>(std::forward<Args>(args)...);
  184|  4.44k|   return BOTAN_FFI_SUCCESS;
  185|  4.44k|}
_ZN9Botan_FFI12botan_structIN5Botan21RandomNumberGeneratorELj1224866241EEC2ENSt3__110unique_ptrIS2_NS4_14default_deleteIS2_EEEE:
   38|  4.44k|      explicit botan_struct(std::unique_ptr<T> obj) : m_magic(MAGIC), m_obj(std::move(obj)) {}
_ZN9Botan_FFI12botan_structIN5Botan21RandomNumberGeneratorELj1224866241EED2Ev:
   40|  4.44k|      virtual ~botan_struct() {
   41|  4.44k|         m_magic = 0;
   42|  4.44k|         m_obj.reset();  // NOLINT(*-ambiguous-smartptr-reset-call)
   43|  4.44k|      }
_ZN9Botan_FFI17ffi_delete_objectIN5Botan21RandomNumberGeneratorELj1224866241EEEiPNS_12botan_structIT_XT0_EEEPKc:
  161|  4.44k|int ffi_delete_object(botan_struct<T, M>* obj, const char* func_name) {
  162|  4.44k|   return ffi_guard_thunk(func_name, [=]() -> int {
  163|       |      // ignore delete of null objects
  164|  4.44k|      if(obj == nullptr) {
  165|  4.44k|         return BOTAN_FFI_SUCCESS;
  166|  4.44k|      }
  167|       |
  168|  4.44k|      if(!obj->magic_ok()) {
  169|  4.44k|         return BOTAN_FFI_ERROR_INVALID_OBJECT;
  170|  4.44k|      }
  171|       |
  172|  4.44k|      delete obj;  // NOLINT(*-owning-memory)
  173|  4.44k|      return BOTAN_FFI_SUCCESS;
  174|  4.44k|   });
  175|  4.44k|}
_ZN9Botan_FFI15ffi_guard_thunkITkNSt3__19invocableEZNS_17ffi_delete_objectIN5Botan21RandomNumberGeneratorELj1224866241EEEiPNS_12botan_structIT_XT0_EEEPKcEUlvE_EEiSA_S6_:
   95|  4.44k|int ffi_guard_thunk(const char* func_name, T thunk) {
   96|  4.44k|   ffi_clear_last_exception();
   97|       |
   98|  4.44k|   try {
   99|  4.44k|      return thunk();
  100|  4.44k|   } catch(std::bad_alloc&) {
  101|      0|      return ffi_error_exception_thrown(func_name, "bad_alloc", BOTAN_FFI_ERROR_OUT_OF_MEMORY);
  102|      0|   } catch(Botan_FFI::FFI_Error& e) {
  103|      0|      return ffi_error_exception_thrown(func_name, e.what(), e.error_code());
  104|      0|   } catch(Botan::Exception& e) {
  105|      0|      return ffi_error_exception_thrown(func_name, e.what(), e.error_type());
  106|      0|   } catch(std::exception& e) {
  107|      0|      return ffi_error_exception_thrown(func_name, e.what(), BOTAN_FFI_ERROR_EXCEPTION_THROWN);
  108|      0|   } catch(...) {
  109|      0|      return ffi_error_exception_thrown(func_name, "unknown exception", BOTAN_FFI_ERROR_EXCEPTION_THROWN);
  110|      0|   }
  111|  4.44k|}
_ZZN9Botan_FFI17ffi_delete_objectIN5Botan21RandomNumberGeneratorELj1224866241EEEiPNS_12botan_structIT_XT0_EEEPKcENKUlvE_clEv:
  162|  4.44k|   return ffi_guard_thunk(func_name, [=]() -> int {
  163|       |      // ignore delete of null objects
  164|  4.44k|      if(obj == nullptr) {
  ------------------
  |  Branch (164:10): [True: 0, False: 4.44k]
  ------------------
  165|      0|         return BOTAN_FFI_SUCCESS;
  166|      0|      }
  167|       |
  168|  4.44k|      if(!obj->magic_ok()) {
  ------------------
  |  Branch (168:10): [True: 0, False: 4.44k]
  ------------------
  169|      0|         return BOTAN_FFI_ERROR_INVALID_OBJECT;
  170|      0|      }
  171|       |
  172|  4.44k|      delete obj;  // NOLINT(*-owning-memory)
  173|  4.44k|      return BOTAN_FFI_SUCCESS;
  174|  4.44k|   });

_ZN5Botan11checked_mulITkNSt3__117unsigned_integralEmEENS1_8optionalIT_EES3_S3_:
   46|  26.6k|constexpr inline std::optional<T> checked_mul(T a, T b) {
   47|       |   // Multiplication by 1U is a hack to work around C's insane
   48|       |   // integer promotion rules.
   49|       |   // https://stackoverflow.com/questions/24795651
   50|  26.6k|   const T r = (1U * a) * b;
   51|       |   // If a == 0 then the multiply certainly did not overflow
   52|       |   // Otherwise r / a == b unless overflow occurred
   53|  26.6k|   if(a != 0 && r / a != b) {
  ------------------
  |  Branch (53:7): [True: 26.6k, False: 0]
  |  Branch (53:17): [True: 0, False: 26.6k]
  ------------------
   54|      0|      return {};
   55|      0|   }
   56|  26.6k|   return r;
   57|  26.6k|}

_ZN5Botan6detail9store_anyILNSt3__16endianE64206ENS0_10AutoDetectETkNS0_20unsigned_integralishEmQoosr3stdE7same_asIS4_T0_Esr3stdE7same_asIT1_S5_EEEvS6_Ph:
  711|  62.2k|inline constexpr void store_any(T in, uint8_t out[]) {
  712|       |   // asserts that *out points to enough bytes to write into
  713|  62.2k|   store_any<endianness, InT>(in, std::span<uint8_t, sizeof(T)>(out, sizeof(T)));
  714|  62.2k|}
_ZN5Botan6detail9store_anyILNSt3__16endianE64206ENS0_10AutoDetectETkNS0_20unsigned_integralishEmTkNS_6ranges23contiguous_output_rangeIhEENS2_4spanIhLm8EEEQsr3stdE7same_asIS4_T0_EEEvT1_OT2_:
  646|  62.2k|inline constexpr void store_any(T in, OutR&& out_range) {
  647|  62.2k|   store_any<endianness, T>(in, std::forward<OutR>(out_range));
  648|  62.2k|}
_ZN5Botan6detail9store_anyILNSt3__16endianE64206ETkNS0_20unsigned_integralishEmTkNS_6ranges23contiguous_output_rangeIhEENS2_4spanIhLm8EEEQnt15custom_storableINS0_19wrapped_type_helperIu14__remove_cvrefIT0_EE4typeEEEEvS9_OT1_:
  525|   559k|inline constexpr void store_any(WrappedInT wrapped_in, OutR&& out_range) {
  526|   559k|   const auto in = detail::unwrap_strong_type_or_enum(wrapped_in);
  527|   559k|   using InT = decltype(in);
  528|   559k|   ranges::assert_exact_byte_length<sizeof(in)>(out_range);
  529|   559k|   const std::span out{out_range};
  530|       |
  531|       |   // At compile time we cannot use `typecast_copy` as it uses `std::memcpy`
  532|       |   // internally to copy ranges on a byte-by-byte basis, which is not allowed
  533|       |   // in a `constexpr` context.
  534|   559k|   if(std::is_constant_evaluated()) /* TODO: C++23: if consteval {} */ {
  ------------------
  |  Branch (534:7): [Folded, False: 559k]
  ------------------
  535|      0|      return fallback_store_any<endianness, InT>(in, std::forward<OutR>(out_range));
  536|   559k|   } else {
  537|       |      if constexpr(sizeof(InT) == 1) {
  538|       |         out[0] = static_cast<uint8_t>(in);
  539|       |      } else if constexpr(endianness == std::endian::native) {
  540|       |         typecast_copy(out, in);
  541|   559k|      } else {
  542|   559k|         static_assert(opposite(endianness) == std::endian::native);
  543|   559k|         typecast_copy(out, reverse_bytes(in));
  544|   559k|      }
  545|   559k|   }
  546|   559k|}
_ZN5Botan6detail26unwrap_strong_type_or_enumITkNS0_20unsigned_integralishEmEEDaT_:
  190|   559k|constexpr auto unwrap_strong_type_or_enum(InT t) {
  191|       |   if constexpr(std::is_enum_v<InT>) {
  192|       |      // TODO: C++23: use std::to_underlying(in) instead
  193|       |      return static_cast<std::underlying_type_t<InT>>(t);
  194|   559k|   } else {
  195|   559k|      return Botan::unwrap_strong_type(t);
  196|   559k|   }
  197|   559k|}
_ZN5Botan8get_byteILm3EjEEhT0_QltT_stS1_:
   81|  3.54M|{
   82|  3.54M|   const size_t shift = ((~B) & (sizeof(T) - 1)) << 3;
   83|  3.54M|   return static_cast<uint8_t>((input >> shift) & 0xFF);
   84|  3.54M|}
_ZN5Botan8get_byteILm2EjEEhT0_QltT_stS1_:
   81|  3.12M|{
   82|  3.12M|   const size_t shift = ((~B) & (sizeof(T) - 1)) << 3;
   83|  3.12M|   return static_cast<uint8_t>((input >> shift) & 0xFF);
   84|  3.12M|}
_ZN5Botan8get_byteILm1EjEEhT0_QltT_stS1_:
   81|  3.12M|{
   82|  3.12M|   const size_t shift = ((~B) & (sizeof(T) - 1)) << 3;
   83|  3.12M|   return static_cast<uint8_t>((input >> shift) & 0xFF);
   84|  3.12M|}
_ZN5Botan8get_byteILm0EjEEhT0_QltT_stS1_:
   81|  3.08M|{
   82|  3.08M|   const size_t shift = ((~B) & (sizeof(T) - 1)) << 3;
   83|  3.08M|   return static_cast<uint8_t>((input >> shift) & 0xFF);
   84|  3.08M|}
_ZN5Botan6detail8load_anyILNSt3__16endianE64206ETkNS0_20unsigned_integralishEmTkNS_6ranges16contiguous_rangeIhEENS2_4spanIKhLm8EEEQnt15custom_loadableINS0_19wrapped_type_helperIu14__remove_cvrefIT0_EE4typeEEEESA_OT1_:
  278|  2.27M|inline constexpr WrappedOutT load_any(InR&& in_range) {
  279|  2.27M|   using OutT = detail::wrapped_type<WrappedOutT>;
  280|  2.27M|   ranges::assert_exact_byte_length<sizeof(OutT)>(in_range);
  281|       |
  282|  2.27M|   return detail::wrap_strong_type_or_enum<WrappedOutT>([&]() -> OutT {
  283|       |      // At compile time we cannot use `typecast_copy` as it uses `std::memcpy`
  284|       |      // internally to copy ranges on a byte-by-byte basis, which is not allowed
  285|       |      // in a `constexpr` context.
  286|  2.27M|      if(std::is_constant_evaluated()) /* TODO: C++23: if consteval {} */ {
  287|  2.27M|         return fallback_load_any<endianness, OutT>(std::forward<InR>(in_range));
  288|  2.27M|      } else {
  289|  2.27M|         const std::span in{in_range};
  290|  2.27M|         if constexpr(sizeof(OutT) == 1) {
  291|  2.27M|            return static_cast<OutT>(in[0]);
  292|  2.27M|         } else if constexpr(endianness == std::endian::native) {
  293|  2.27M|            return typecast_copy<OutT>(in);
  294|  2.27M|         } else {
  295|  2.27M|            static_assert(opposite(endianness) == std::endian::native);
  296|  2.27M|            return reverse_bytes(typecast_copy<OutT>(in));
  297|  2.27M|         }
  298|  2.27M|      }
  299|  2.27M|   }());
  300|  2.27M|}
_ZN5Botan6detail24wrap_strong_type_or_enumITkNS0_20unsigned_integralishEmTkNSt3__117unsigned_integralEmEEDaT0_:
  200|  2.27M|constexpr auto wrap_strong_type_or_enum(T t) {
  201|       |   if constexpr(std::is_enum_v<OutT>) {
  202|       |      return static_cast<OutT>(t);
  203|  2.27M|   } else {
  204|  2.27M|      return Botan::wrap_strong_type<OutT>(t);
  205|  2.27M|   }
  206|  2.27M|}
_ZZN5Botan6detail8load_anyILNSt3__16endianE64206ETkNS0_20unsigned_integralishEmTkNS_6ranges16contiguous_rangeIhEENS2_4spanIKhLm8EEEQnt15custom_loadableINS0_19wrapped_type_helperIu14__remove_cvrefIT0_EE4typeEEEESA_OT1_ENKUlvE_clEv:
  282|  2.27M|   return detail::wrap_strong_type_or_enum<WrappedOutT>([&]() -> OutT {
  283|       |      // At compile time we cannot use `typecast_copy` as it uses `std::memcpy`
  284|       |      // internally to copy ranges on a byte-by-byte basis, which is not allowed
  285|       |      // in a `constexpr` context.
  286|  2.27M|      if(std::is_constant_evaluated()) /* TODO: C++23: if consteval {} */ {
  ------------------
  |  Branch (286:10): [Folded, False: 2.27M]
  ------------------
  287|      0|         return fallback_load_any<endianness, OutT>(std::forward<InR>(in_range));
  288|  2.27M|      } else {
  289|  2.27M|         const std::span in{in_range};
  290|       |         if constexpr(sizeof(OutT) == 1) {
  291|       |            return static_cast<OutT>(in[0]);
  292|       |         } else if constexpr(endianness == std::endian::native) {
  293|       |            return typecast_copy<OutT>(in);
  294|  2.27M|         } else {
  295|  2.27M|            static_assert(opposite(endianness) == std::endian::native);
  296|  2.27M|            return reverse_bytes(typecast_copy<OutT>(in));
  297|  2.27M|         }
  298|  2.27M|      }
  299|  2.27M|   }());
_ZN5Botan6detail9store_anyILNSt3__16endianE64206EmTkNS_6ranges23contiguous_output_rangeIhEENS2_4spanIhLm8EEETpTkNS0_20unsigned_integralishEJmEQaagtsZT2_Li0Eooaasr3stdE7same_asINS0_10AutoDetectET0_E10all_same_vIDpT2_Eaa20unsigned_integralishIS9_E10all_same_vIS9_SB_EEEvOT1_SB_:
  582|   497k|inline constexpr void store_any(OutR&& out /* NOLINT(*-std-forward) */, Ts... ins) {
  583|   497k|   ranges::assert_exact_byte_length<(sizeof(Ts) + ...)>(out);
  584|   497k|   auto store_one = [off = 0]<typename T>(auto o, T i) mutable {
  585|   497k|      store_any<endianness, T>(i, o.subspan(off).template first<sizeof(T)>());
  586|   497k|      off += sizeof(T);
  587|   497k|   };
  588|       |
  589|   497k|   (store_one(std::span{out}, ins), ...);
  590|   497k|}
_ZZN5Botan6detail9store_anyILNSt3__16endianE64206EmTkNS_6ranges23contiguous_output_rangeIhEENS2_4spanIhLm8EEETpTkNS0_20unsigned_integralishEJmEQaagtsZT2_Li0Eooaasr3stdE7same_asINS0_10AutoDetectET0_E10all_same_vIDpT2_Eaa20unsigned_integralishIS9_E10all_same_vIS9_SB_EEEvOT1_SB_ENUlTyS9_T_E_clImS7_EEDaS9_SE_:
  584|   497k|   auto store_one = [off = 0]<typename T>(auto o, T i) mutable {
  585|   497k|      store_any<endianness, T>(i, o.subspan(off).template first<sizeof(T)>());
  586|   497k|      off += sizeof(T);
  587|   497k|   };
_ZN5Botan7load_leINS_6detail10AutoDetectEJRA4_jPKhiEEEDaDpOT0_:
  495|   771k|inline constexpr auto load_le(ParamTs&&... params) {
  496|   771k|   return detail::load_any<std::endian::little, OutT>(std::forward<ParamTs>(params)...);
  497|   771k|}
_ZN5Botan6detail8load_anyILNSt3__16endianE57005ENS0_10AutoDetectETkNS0_20unsigned_integralishEjQoosr3stdE7same_asIS4_T0_Esr3stdE7same_asIT1_S5_EEEvPS6_PKhm:
  483|   771k|inline constexpr void load_any(T out[], const uint8_t in[], size_t count) {
  484|       |   // asserts that *in and *out point to the correct amount of memory
  485|   771k|   load_any<endianness, OutT>(std::span<T>(out, count), std::span<const uint8_t>(in, count * sizeof(T)));
  486|   771k|}
_ZN5Botan6detail8load_anyILNSt3__16endianE57005ENS0_10AutoDetectETkNS_6ranges23contiguous_output_rangeENS2_4spanIjLm18446744073709551615EEETkNS5_16contiguous_rangeIhEENS6_IKhLm18446744073709551615EEEQaa20unsigned_integralishINS2_11conditionalIXsr21__is_primary_templateINS2_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS2_6ranges5__cpo5beginEEclsr3stdE7declvalIRT1_EEEEEEEEE5valueENS2_26indirectly_readable_traitsISI_EESJ_E4type10value_typeEEoosr3stdE7same_asIS4_T0_Esr3stdE7same_asISP_SO_EEEvOSF_RKT2_:
  355|   771k|inline constexpr void load_any(OutR&& out /* NOLINT(*-std-forward) */, const InR& in) {
  356|   771k|   ranges::assert_equal_byte_lengths(out, in);
  357|   771k|   using element_type = std::ranges::range_value_t<OutR>;
  358|       |
  359|   771k|   auto load_elementwise = [&] {
  360|   771k|      constexpr size_t bytes_per_element = sizeof(element_type);
  361|   771k|      std::span<const uint8_t> in_s(in);
  362|   771k|      for(auto& out_elem : out) {
  363|   771k|         out_elem = load_any<endianness, element_type>(in_s.template first<bytes_per_element>());
  364|   771k|         in_s = in_s.subspan(bytes_per_element);
  365|   771k|      }
  366|   771k|   };
  367|       |
  368|       |   // At compile time we cannot use `typecast_copy` as it uses `std::memcpy`
  369|       |   // internally to copy ranges on a byte-by-byte basis, which is not allowed
  370|       |   // in a `constexpr` context.
  371|   771k|   if(std::is_constant_evaluated()) /* TODO: C++23: if consteval {} */ {
  ------------------
  |  Branch (371:7): [Folded, False: 771k]
  ------------------
  372|      0|      load_elementwise();
  373|   771k|   } else {
  374|   771k|      if constexpr(endianness == std::endian::native && !custom_loadable<element_type>) {
  375|   771k|         typecast_copy(out, in);
  376|       |      } else {
  377|       |         load_elementwise();
  378|       |      }
  379|   771k|   }
  380|   771k|}
_ZN5Botan8store_beINS_6detail10AutoDetectEJRKmPhEEEDaDpOT0_:
  745|  62.2k|inline constexpr auto store_be(ParamTs&&... params) {
  746|  62.2k|   return detail::store_any<std::endian::big, ModifierT>(std::forward<ParamTs>(params)...);
  747|  62.2k|}
_ZN5Botan7load_beINS_6detail10AutoDetectEJRNSt3__15arrayImLm16EEENS3_4spanIKhLm128EEEEEEDaDpOT0_:
  504|   142k|inline constexpr auto load_be(ParamTs&&... params) {
  505|   142k|   return detail::load_any<std::endian::big, OutT>(std::forward<ParamTs>(params)...);
  506|   142k|}
_ZN5Botan6detail8load_anyILNSt3__16endianE64206ENS0_10AutoDetectETkNS_6ranges23contiguous_output_rangeERNS2_5arrayImLm16EEETkNS5_16contiguous_rangeIhEENS2_4spanIKhLm128EEEQaa20unsigned_integralishINS2_11conditionalIXsr21__is_primary_templateINS2_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS2_6ranges5__cpo5beginEEclsr3stdE7declvalIRT1_EEEEEEEEE5valueENS2_26indirectly_readable_traitsISK_EESL_E4type10value_typeEEoosr3stdE7same_asIS4_T0_Esr3stdE7same_asISR_SQ_EEEvOSH_RKT2_:
  355|   142k|inline constexpr void load_any(OutR&& out /* NOLINT(*-std-forward) */, const InR& in) {
  356|   142k|   ranges::assert_equal_byte_lengths(out, in);
  357|   142k|   using element_type = std::ranges::range_value_t<OutR>;
  358|       |
  359|   142k|   auto load_elementwise = [&] {
  360|   142k|      constexpr size_t bytes_per_element = sizeof(element_type);
  361|   142k|      std::span<const uint8_t> in_s(in);
  362|   142k|      for(auto& out_elem : out) {
  363|   142k|         out_elem = load_any<endianness, element_type>(in_s.template first<bytes_per_element>());
  364|   142k|         in_s = in_s.subspan(bytes_per_element);
  365|   142k|      }
  366|   142k|   };
  367|       |
  368|       |   // At compile time we cannot use `typecast_copy` as it uses `std::memcpy`
  369|       |   // internally to copy ranges on a byte-by-byte basis, which is not allowed
  370|       |   // in a `constexpr` context.
  371|   142k|   if(std::is_constant_evaluated()) /* TODO: C++23: if consteval {} */ {
  ------------------
  |  Branch (371:7): [Folded, False: 142k]
  ------------------
  372|      0|      load_elementwise();
  373|   142k|   } else {
  374|       |      if constexpr(endianness == std::endian::native && !custom_loadable<element_type>) {
  375|       |         typecast_copy(out, in);
  376|   142k|      } else {
  377|   142k|         load_elementwise();
  378|   142k|      }
  379|   142k|   }
  380|   142k|}
_ZZN5Botan6detail8load_anyILNSt3__16endianE64206ENS0_10AutoDetectETkNS_6ranges23contiguous_output_rangeERNS2_5arrayImLm16EEETkNS5_16contiguous_rangeIhEENS2_4spanIKhLm128EEEQaa20unsigned_integralishINS2_11conditionalIXsr21__is_primary_templateINS2_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS2_6ranges5__cpo5beginEEclsr3stdE7declvalIRT1_EEEEEEEEE5valueENS2_26indirectly_readable_traitsISK_EESL_E4type10value_typeEEoosr3stdE7same_asIS4_T0_Esr3stdE7same_asISR_SQ_EEEvOSH_RKT2_ENKUlvE_clEv:
  359|   142k|   auto load_elementwise = [&] {
  360|   142k|      constexpr size_t bytes_per_element = sizeof(element_type);
  361|   142k|      std::span<const uint8_t> in_s(in);
  362|  2.27M|      for(auto& out_elem : out) {
  ------------------
  |  Branch (362:26): [True: 2.27M, False: 142k]
  ------------------
  363|  2.27M|         out_elem = load_any<endianness, element_type>(in_s.template first<bytes_per_element>());
  364|  2.27M|         in_s = in_s.subspan(bytes_per_element);
  365|  2.27M|      }
  366|   142k|   };
_ZN5Botan11copy_out_beITkNS_6ranges14spanable_rangeENSt3__16vectorImNS_16secure_allocatorImEEEEEEvNS2_4spanIhLm18446744073709551615EEERKT_:
  773|  62.2k|inline void copy_out_be(std::span<uint8_t> out, const InR& in) {
  774|  62.2k|   using T = std::ranges::range_value_t<InR>;
  775|  62.2k|   std::span<const T> in_s{in};
  776|  62.2k|   const auto remaining_bytes = detail::copy_out_any_word_aligned_portion<std::endian::big>(out, in_s);
  777|       |
  778|       |   // copy remaining bytes as a partial word
  779|  62.2k|   for(size_t i = 0; i < remaining_bytes; ++i) {
  ------------------
  |  Branch (779:22): [True: 0, False: 62.2k]
  ------------------
  780|      0|      out[i] = get_byte_var(i, in_s.front());
  781|      0|   }
  782|  62.2k|}
_ZN5Botan6detail33copy_out_any_word_aligned_portionILNSt3__16endianE64206ETkNS0_20unsigned_integralishEmEEmRNS2_4spanIhLm18446744073709551615EEERNS4_IKT0_Lm18446744073709551615EEE:
  752|  62.2k|inline size_t copy_out_any_word_aligned_portion(std::span<uint8_t>& out, std::span<const T>& in) {
  753|  62.2k|   const size_t full_words = out.size() / sizeof(T);
  754|  62.2k|   const size_t full_word_bytes = full_words * sizeof(T);
  755|  62.2k|   const size_t remaining_bytes = out.size() - full_word_bytes;
  756|  62.2k|   BOTAN_ASSERT_NOMSG(in.size_bytes() >= full_word_bytes + remaining_bytes);
  ------------------
  |  |   77|  62.2k|   do {                                                                     \
  |  |   78|  62.2k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   79|  62.2k|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (79:10): [True: 0, False: 62.2k]
  |  |  ------------------
  |  |   80|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   81|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   82|      0|      }                                                                     \
  |  |   83|  62.2k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (83:12): [Folded, False: 62.2k]
  |  |  ------------------
  ------------------
  757|       |
  758|       |   // copy full words
  759|  62.2k|   store_any<endianness, T>(out.first(full_word_bytes), in.first(full_words));
  760|  62.2k|   out = out.subspan(full_word_bytes);
  761|  62.2k|   in = in.subspan(full_words);
  762|       |
  763|  62.2k|   return remaining_bytes;
  764|  62.2k|}
_ZN5Botan6detail9store_anyILNSt3__16endianE64206EmTkNS_6ranges23contiguous_output_rangeIhEENS2_4spanIhLm18446744073709551615EEETkNS4_14spanable_rangeENS6_IKmLm18446744073709551615EEEQoosr3stdE7same_asINS0_10AutoDetectET0_Esr3stdE7same_asISB_NS2_11conditionalIXsr21__is_primary_templateINS2_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS2_6ranges5__cpo5beginEEclsr3stdE7declvalIRT2_EEEEEEEEE5valueENS2_26indirectly_readable_traitsISJ_EESK_E4type10value_typeEEEEvOT1_RKSG_:
  603|  62.2k|inline constexpr void store_any(OutR&& out /* NOLINT(*-std-forward) */, const InR& in) {
  604|  62.2k|   ranges::assert_equal_byte_lengths(out, in);
  605|  62.2k|   using element_type = std::ranges::range_value_t<InR>;
  606|       |
  607|  62.2k|   auto store_elementwise = [&] {
  608|  62.2k|      constexpr size_t bytes_per_element = sizeof(element_type);
  609|  62.2k|      std::span<uint8_t> out_s(out);
  610|  62.2k|      for(auto in_elem : in) {
  611|  62.2k|         store_any<endianness, element_type>(out_s.template first<bytes_per_element>(), in_elem);
  612|  62.2k|         out_s = out_s.subspan(bytes_per_element);
  613|  62.2k|      }
  614|  62.2k|   };
  615|       |
  616|       |   // At compile time we cannot use `typecast_copy` as it uses `std::memcpy`
  617|       |   // internally to copy ranges on a byte-by-byte basis, which is not allowed
  618|       |   // in a `constexpr` context.
  619|  62.2k|   if(std::is_constant_evaluated()) /* TODO: C++23: if consteval {} */ {
  ------------------
  |  Branch (619:7): [Folded, False: 62.2k]
  ------------------
  620|      0|      store_elementwise();
  621|  62.2k|   } else {
  622|       |      if constexpr(endianness == std::endian::native && !custom_storable<element_type>) {
  623|       |         typecast_copy(out, in);
  624|  62.2k|      } else {
  625|  62.2k|         store_elementwise();
  626|  62.2k|      }
  627|  62.2k|   }
  628|  62.2k|}
_ZZN5Botan6detail9store_anyILNSt3__16endianE64206EmTkNS_6ranges23contiguous_output_rangeIhEENS2_4spanIhLm18446744073709551615EEETkNS4_14spanable_rangeENS6_IKmLm18446744073709551615EEEQoosr3stdE7same_asINS0_10AutoDetectET0_Esr3stdE7same_asISB_NS2_11conditionalIXsr21__is_primary_templateINS2_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS2_6ranges5__cpo5beginEEclsr3stdE7declvalIRT2_EEEEEEEEE5valueENS2_26indirectly_readable_traitsISJ_EESK_E4type10value_typeEEEEvOT1_RKSG_ENKUlvE_clEv:
  607|  62.2k|   auto store_elementwise = [&] {
  608|  62.2k|      constexpr size_t bytes_per_element = sizeof(element_type);
  609|  62.2k|      std::span<uint8_t> out_s(out);
  610|   497k|      for(auto in_elem : in) {
  ------------------
  |  Branch (610:24): [True: 497k, False: 62.2k]
  ------------------
  611|   497k|         store_any<endianness, element_type>(out_s.template first<bytes_per_element>(), in_elem);
  612|   497k|         out_s = out_s.subspan(bytes_per_element);
  613|   497k|      }
  614|  62.2k|   };

_ZN5Botan18MerkleDamgard_HashINS_7SHA_512EEC2Ev:
   42|  4.44k|      MerkleDamgard_Hash() { clear(); }
_ZN5Botan18MerkleDamgard_HashINS_7SHA_512EE5clearEv:
   70|  84.4k|      void clear() {
   71|  84.4k|         MD::init(m_digest);
   72|  84.4k|         m_buffer.clear();
   73|  84.4k|         m_count = 0;
   74|  84.4k|      }
_ZN5Botan18MerkleDamgard_HashINS_7SHA_512EE6updateENSt3__14spanIKhLm18446744073709551615EEE:
   44|   164k|      void update(std::span<const uint8_t> input) {
   45|   164k|         BufferSlicer in(input);
   46|       |
   47|   328k|         while(!in.empty()) {
  ------------------
  |  Branch (47:16): [True: 164k, False: 164k]
  ------------------
   48|   164k|            if(const auto one_block = m_buffer.handle_unaligned_data(in)) {
  ------------------
  |  Branch (48:27): [True: 0, False: 164k]
  ------------------
   49|      0|               MD::compress_n(m_digest, one_block.value(), 1);
   50|      0|            }
   51|       |
   52|   164k|            if(m_buffer.in_alignment()) {
  ------------------
  |  Branch (52:16): [True: 79.9k, False: 84.4k]
  ------------------
   53|  79.9k|               const auto [aligned_data, full_blocks] = m_buffer.aligned_data_to_process(in);
   54|  79.9k|               if(full_blocks > 0) {
  ------------------
  |  Branch (54:19): [True: 79.9k, False: 0]
  ------------------
   55|  79.9k|                  MD::compress_n(m_digest, aligned_data, full_blocks);
   56|  79.9k|               }
   57|  79.9k|            }
   58|   164k|         }
   59|       |
   60|   164k|         m_count += input.size();
   61|   164k|      }
_ZN5Botan18MerkleDamgard_HashINS_7SHA_512EE5finalENSt3__14spanIhLm18446744073709551615EEE:
   63|  62.2k|      void final(std::span<uint8_t> output) {
   64|  62.2k|         append_padding_bit();
   65|  62.2k|         append_counter_and_finalize();
   66|  62.2k|         copy_output(output);
   67|  62.2k|         clear();
   68|  62.2k|      }
_ZN5Botan18MerkleDamgard_HashINS_7SHA_512EE18append_padding_bitEv:
   77|  62.2k|      void append_padding_bit() {
   78|  62.2k|         BOTAN_ASSERT_NOMSG(!m_buffer.ready_to_consume());
  ------------------
  |  |   77|  62.2k|   do {                                                                     \
  |  |   78|  62.2k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   79|  62.2k|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (79:10): [True: 0, False: 62.2k]
  |  |  ------------------
  |  |   80|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   81|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   82|      0|      }                                                                     \
  |  |   83|  62.2k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (83:12): [Folded, False: 62.2k]
  |  |  ------------------
  ------------------
   79|  62.2k|         if constexpr(MD::bit_endianness == MD_Endian::Big) {
   80|  62.2k|            const uint8_t final_byte = 0x80;
   81|  62.2k|            m_buffer.append({&final_byte, 1});
   82|       |         } else {
   83|       |            const uint8_t final_byte = 0x01;
   84|       |            m_buffer.append({&final_byte, 1});
   85|       |         }
   86|  62.2k|      }
_ZN5Botan18MerkleDamgard_HashINS_7SHA_512EE27append_counter_and_finalizeEv:
   88|  62.2k|      void append_counter_and_finalize() {
   89|       |         // Compress the remaining data if the final data block does not provide
   90|       |         // enough space for the counter bytes.
   91|  62.2k|         if(m_buffer.elements_until_alignment() < MD::ctr_bytes) {
  ------------------
  |  Branch (91:13): [True: 0, False: 62.2k]
  ------------------
   92|      0|            m_buffer.fill_up_with_zeros();
   93|      0|            MD::compress_n(m_digest, m_buffer.consume(), 1);
   94|      0|         }
   95|       |
   96|       |         // Make sure that any remaining bytes in the very last block are zero.
   97|  62.2k|         BOTAN_ASSERT_NOMSG(m_buffer.elements_until_alignment() >= MD::ctr_bytes);
  ------------------
  |  |   77|  62.2k|   do {                                                                     \
  |  |   78|  62.2k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   79|  62.2k|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (79:10): [True: 0, False: 62.2k]
  |  |  ------------------
  |  |   80|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   81|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   82|      0|      }                                                                     \
  |  |   83|  62.2k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (83:12): [Folded, False: 62.2k]
  |  |  ------------------
  ------------------
   98|  62.2k|         m_buffer.fill_up_with_zeros();
   99|       |
  100|       |         // Replace a bunch of the right-most zero-padding with the counter bytes.
  101|  62.2k|         const uint64_t bit_count = m_count * 8;
  102|  62.2k|         auto last_bytes = m_buffer.directly_modify_last(sizeof(bit_count));
  103|  62.2k|         if constexpr(MD::byte_endianness == MD_Endian::Big) {
  104|  62.2k|            store_be(bit_count, last_bytes.data());
  105|       |         } else {
  106|       |            store_le(bit_count, last_bytes.data());
  107|       |         }
  108|       |
  109|       |         // Compress the very last block.
  110|  62.2k|         MD::compress_n(m_digest, m_buffer.consume(), 1);
  111|  62.2k|      }
_ZN5Botan18MerkleDamgard_HashINS_7SHA_512EE11copy_outputENSt3__14spanIhLm18446744073709551615EEE:
  113|  62.2k|      void copy_output(std::span<uint8_t> output) {
  114|  62.2k|         BOTAN_ASSERT_NOMSG(output.size() >= MD::output_bytes);
  ------------------
  |  |   77|  62.2k|   do {                                                                     \
  |  |   78|  62.2k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   79|  62.2k|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (79:10): [True: 0, False: 62.2k]
  |  |  ------------------
  |  |   80|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   81|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   82|      0|      }                                                                     \
  |  |   83|  62.2k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (83:12): [Folded, False: 62.2k]
  |  |  ------------------
  ------------------
  115|       |
  116|  62.2k|         if constexpr(MD::byte_endianness == MD_Endian::Big) {
  117|  62.2k|            copy_out_be(output.first(MD::output_bytes), m_digest);
  118|       |         } else {
  119|       |            copy_out_le(output.first(MD::output_bytes), m_digest);
  120|       |         }
  121|  62.2k|      }

_ZN5Botan14zeroize_bufferITkNSt3__117unsigned_integralEhEEvPT_m:
   37|   146k|inline void zeroize_buffer(T buf[], size_t n) {
   38|   146k|   if(n > 0) {
  ------------------
  |  Branch (38:7): [True: 146k, False: 0]
  ------------------
   39|   146k|      std::memset(buf, 0, sizeof(T) * n);
   40|   146k|   }
   41|   146k|}

_ZN5Botan3rhoILm14ELm18ELm41ETkNSt3__117unsigned_integralEmEET2_S2_:
   53|  11.3M|BOTAN_FORCE_INLINE constexpr T rho(T x) {
   54|  11.3M|   return rotr<R1>(x) ^ rotr<R2>(x) ^ rotr<R3>(x);
   55|  11.3M|}
_ZN5Botan4rotrILm14ETkNSt3__117unsigned_integralEmEET0_S2_QaagtT_Li0EltT_mlLi8EstS2_:
   37|  11.3M|{
   38|  11.3M|   return static_cast<T>((input >> ROT) | (input << (8 * sizeof(T) - ROT)));
   39|  11.3M|}
_ZN5Botan4rotrILm18ETkNSt3__117unsigned_integralEmEET0_S2_QaagtT_Li0EltT_mlLi8EstS2_:
   37|  11.3M|{
   38|  11.3M|   return static_cast<T>((input >> ROT) | (input << (8 * sizeof(T) - ROT)));
   39|  11.3M|}
_ZN5Botan4rotrILm41ETkNSt3__117unsigned_integralEmEET0_S2_QaagtT_Li0EltT_mlLi8EstS2_:
   37|  11.3M|{
   38|  11.3M|   return static_cast<T>((input >> ROT) | (input << (8 * sizeof(T) - ROT)));
   39|  11.3M|}
_ZN5Botan3rhoILm28ELm34ELm39ETkNSt3__117unsigned_integralEmEET2_S2_:
   53|  11.3M|BOTAN_FORCE_INLINE constexpr T rho(T x) {
   54|  11.3M|   return rotr<R1>(x) ^ rotr<R2>(x) ^ rotr<R3>(x);
   55|  11.3M|}
_ZN5Botan4rotrILm28ETkNSt3__117unsigned_integralEmEET0_S2_QaagtT_Li0EltT_mlLi8EstS2_:
   37|  11.3M|{
   38|  11.3M|   return static_cast<T>((input >> ROT) | (input << (8 * sizeof(T) - ROT)));
   39|  11.3M|}
_ZN5Botan4rotrILm34ETkNSt3__117unsigned_integralEmEET0_S2_QaagtT_Li0EltT_mlLi8EstS2_:
   37|  11.3M|{
   38|  11.3M|   return static_cast<T>((input >> ROT) | (input << (8 * sizeof(T) - ROT)));
   39|  11.3M|}
_ZN5Botan4rotrILm39ETkNSt3__117unsigned_integralEmEET0_S2_QaagtT_Li0EltT_mlLi8EstS2_:
   37|  11.3M|{
   38|  11.3M|   return static_cast<T>((input >> ROT) | (input << (8 * sizeof(T) - ROT)));
   39|  11.3M|}
_ZN5Botan5sigmaILm19ELm61ELm6ETkNSt3__117unsigned_integralEmEET2_S2_:
   45|  11.3M|BOTAN_FORCE_INLINE constexpr T sigma(T x) {
   46|  11.3M|   return rotr<R1>(x) ^ rotr<R2>(x) ^ (x >> S);
   47|  11.3M|}
_ZN5Botan4rotrILm19ETkNSt3__117unsigned_integralEmEET0_S2_QaagtT_Li0EltT_mlLi8EstS2_:
   37|  11.3M|{
   38|  11.3M|   return static_cast<T>((input >> ROT) | (input << (8 * sizeof(T) - ROT)));
   39|  11.3M|}
_ZN5Botan4rotrILm61ETkNSt3__117unsigned_integralEmEET0_S2_QaagtT_Li0EltT_mlLi8EstS2_:
   37|  11.3M|{
   38|  11.3M|   return static_cast<T>((input >> ROT) | (input << (8 * sizeof(T) - ROT)));
   39|  11.3M|}
_ZN5Botan5sigmaILm1ELm8ELm7ETkNSt3__117unsigned_integralEmEET2_S2_:
   45|  11.3M|BOTAN_FORCE_INLINE constexpr T sigma(T x) {
   46|  11.3M|   return rotr<R1>(x) ^ rotr<R2>(x) ^ (x >> S);
   47|  11.3M|}
_ZN5Botan4rotrILm1ETkNSt3__117unsigned_integralEmEET0_S2_QaagtT_Li0EltT_mlLi8EstS2_:
   37|  11.3M|{
   38|  11.3M|   return static_cast<T>((input >> ROT) | (input << (8 * sizeof(T) - ROT)));
   39|  11.3M|}
_ZN5Botan4rotrILm8ETkNSt3__117unsigned_integralEmEET0_S2_QaagtT_Li0EltT_mlLi8EstS2_:
   37|  11.3M|{
   38|  11.3M|   return static_cast<T>((input >> ROT) | (input << (8 * sizeof(T) - ROT)));
   39|  11.3M|}

_ZNK5Botan9SCAN_Name9algo_nameEv:
   38|  4.44k|      const std::string& algo_name() const { return m_alg_name; }
_ZNK5Botan9SCAN_Name9arg_countEv:
   43|  8.88k|      size_t arg_count() const { return m_args.size(); }

_ZNK5Botan7SHA_51213output_lengthEv:
   74|   128k|      size_t output_length() const override { return output_bytes; }
_ZNK5Botan7SHA_51215hash_block_sizeEv:
   76|  4.44k|      size_t hash_block_size() const override { return block_bytes; }
_ZN5Botan7SHA_5125clearEv:
   84|  17.7k|      void clear() override { m_md.clear(); }

_ZN5Botan9SHA2_64_FEmmmRmmmmS0_S0_mmmm:
   31|  11.3M|                                  uint64_t magic) {
   32|  11.3M|   H += magic + rho<14, 18, 41>(E) + choose(E, F, G) + M1;
   33|  11.3M|   D += H;
   34|  11.3M|   H += rho<28, 34, 39>(A) + majority(A, B, C);
   35|  11.3M|   M1 += sigma<19, 61, 6>(M2) + M3 + sigma<1, 8, 7>(M4);
   36|  11.3M|}

_ZN5Botan20Buffered_Computation6updateEPKhm:
   35|  83.3k|      void update(const uint8_t in[], size_t length) { add_data({in, length}); }
_ZN5Botan20Buffered_Computation6updateENSt3__14spanIKhLm18446744073709551615EEE:
   41|   204k|      void update(std::span<const uint8_t> in) { add_data(in); }
_ZN5Botan20Buffered_Computation6updateEh:
   90|  13.3k|      void update(uint8_t in) { add_data({&in, 1}); }
_ZN5Botan20Buffered_Computation5finalEPh:
   97|  42.5k|      void final(uint8_t out[]) { final_result({out, output_length()}); }
_ZN5Botan20Buffered_ComputationD2Ev:
  169|  52.8k|      virtual ~Buffered_Computation() = default;
_ZN5Botan20Buffered_Computation5finalITkNS_8concepts21resizable_byte_bufferENSt3__16vectorIhNS_16secure_allocatorIhEEEEEEvRT_:
  127|  31.1k|      void final(T& out) {
  128|  31.1k|         out.resize(output_length());
  129|  31.1k|         final_result(out);
  130|  31.1k|      }

_ZNK5Botan9HMAC_DRBG31max_number_of_bytes_per_requestEv:
  151|  4.44k|      size_t max_number_of_bytes_per_request() const override { return m_max_number_of_bytes_per_request; }

_ZN5Botan11clear_bytesEPvm:
  101|  35.5k|inline constexpr void clear_bytes(void* ptr, size_t bytes) {
  102|  35.5k|   if(bytes > 0) {
  ------------------
  |  Branch (102:7): [True: 35.5k, False: 0]
  ------------------
  103|  35.5k|      std::memset(ptr, 0, bytes);
  104|  35.5k|   }
  105|  35.5k|}
_ZN5Botan8copy_memIhQsr3stdE12is_trivial_vIu7__decayIT_EEEEvPS1_PKS1_m:
  144|  4.44k|inline constexpr void copy_mem(T* out, const T* in, size_t n) {
  145|  4.44k|   BOTAN_ASSERT_IMPLICATION(n > 0, in != nullptr && out != nullptr, "If n > 0 then args are not null");
  ------------------
  |  |  103|  4.44k|   do {                                                                                          \
  |  |  104|  4.44k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                                              \
  |  |  105|  8.88k|      if((expr1) && !(expr2)) {                                                                  \
  |  |  ------------------
  |  |  |  Branch (105:10): [True: 4.44k, False: 0]
  |  |  |  Branch (105:23): [True: 4.44k, False: 0]
  |  |  |  Branch (105:23): [True: 4.44k, False: 0]
  |  |  ------------------
  |  |  106|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                                     \
  |  |  107|      0|         Botan::assertion_failure(#expr1 " implies " #expr2, msg, __func__, __FILE__, __LINE__); \
  |  |  108|      0|      }                                                                                          \
  |  |  109|  4.44k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (109:12): [Folded, False: 4.44k]
  |  |  ------------------
  ------------------
  146|       |
  147|  4.44k|   if(in != nullptr && out != nullptr && n > 0) {
  ------------------
  |  Branch (147:7): [True: 4.44k, False: 0]
  |  Branch (147:24): [True: 4.44k, False: 0]
  |  Branch (147:42): [True: 4.44k, False: 0]
  ------------------
  148|  4.44k|      std::memmove(out, in, sizeof(T) * n);
  149|  4.44k|   }
  150|  4.44k|}
_ZN5Botan13typecast_copyITkNS_6ranges23contiguous_output_rangeERKNSt3__14spanIhLm8EEEmQaaaasr3stdE23is_trivially_copyable_vIT0_Entsr3std6rangesE5rangeIS7_Esr3stdE23is_trivially_copyable_vINS2_11conditionalIXsr21__is_primary_templateINS2_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS2_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS2_26indirectly_readable_traitsISF_EESG_E4type10value_typeEEEEvOSC_RKS7_:
  199|   559k|inline constexpr void typecast_copy(ToR&& out /* NOLINT(*-std-forward) */, const FromT& in) {
  200|   559k|   typecast_copy(out, std::span<const FromT, 1>(&in, 1));
  201|   559k|}
_ZN5Botan13typecast_copyITkNS_6ranges23contiguous_output_rangeERKNSt3__14spanIhLm8EEETkNS1_16contiguous_rangeENS3_IKmLm1EEEQaasr3stdE23is_trivially_copyable_vINS2_11conditionalIXsr21__is_primary_templateINS2_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS2_6ranges5__cpo5beginEEclsr3stdE7declvalIRT0_EEEEEEEEE5valueENS2_26indirectly_readable_traitsISG_EESH_E4type10value_typeEEsr3stdE23is_trivially_copyable_vINS9_IXsr21__is_primary_templateINSA_Iu14__remove_cvrefIDTclL_ZNSC_5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENSI_ISQ_EESR_E4type10value_typeEEEEvOSN_RKSD_:
  176|   559k|inline constexpr void typecast_copy(ToR&& out /* NOLINT(*-std-forward) */, const FromR& in) {
  177|   559k|   ranges::assert_equal_byte_lengths(out, in);
  178|   559k|   std::memcpy(std::ranges::data(out), std::ranges::data(in), ranges::size_bytes(out));
  179|   559k|}
_ZN5Botan13typecast_copyImTkNS_6ranges16contiguous_rangeENSt3__14spanIKhLm8EEEQaaaasr3stdE26is_default_constructible_vIT_Esr3stdE23is_trivially_copyable_vIS6_Esr3stdE23is_trivially_copyable_vINS2_11conditionalIXsr21__is_primary_templateINS2_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS2_6ranges5__cpo5beginEEclsr3stdE7declvalIRT0_EEEEEEEEE5valueENS2_26indirectly_readable_traitsISE_EESF_E4type10value_typeEEEES6_RKSB_:
  210|  2.27M|inline constexpr ToT typecast_copy(const FromR& src) {
  211|  2.27M|   ToT dst;  // NOLINT(*-member-init)
  212|  2.27M|   typecast_copy(dst, src);
  213|  2.27M|   return dst;
  214|  2.27M|}
_ZN5Botan13typecast_copyImTkNS_6ranges16contiguous_rangeENSt3__14spanIKhLm8EEEQaaaasr3stdE23is_trivially_copyable_vINS2_11conditionalIXsr21__is_primary_templateINS2_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS2_6ranges5__cpo5beginEEclsr3stdE7declvalIRT0_EEEEEEEEE5valueENS2_26indirectly_readable_traitsISD_EESE_E4type10value_typeEEsr3stdE23is_trivially_copyable_vIT_Entsr3std6rangesE5rangeISK_EEEvRSK_RKSA_:
  188|  2.27M|inline constexpr void typecast_copy(ToT& out, const FromR& in) {
  189|  2.27M|   typecast_copy(std::span<ToT, 1>(&out, 1), in);
  190|  2.27M|}
_ZN5Botan13typecast_copyITkNS_6ranges23contiguous_output_rangeENSt3__14spanImLm1EEETkNS1_16contiguous_rangeENS3_IKhLm8EEEQaasr3stdE23is_trivially_copyable_vINS2_11conditionalIXsr21__is_primary_templateINS2_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS2_6ranges5__cpo5beginEEclsr3stdE7declvalIRT0_EEEEEEEEE5valueENS2_26indirectly_readable_traitsISE_EESF_E4type10value_typeEEsr3stdE23is_trivially_copyable_vINS7_IXsr21__is_primary_templateINS8_Iu14__remove_cvrefIDTclL_ZNSA_5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENSG_ISO_EESP_E4type10value_typeEEEEvOSL_RKSB_:
  176|  2.27M|inline constexpr void typecast_copy(ToR&& out /* NOLINT(*-std-forward) */, const FromR& in) {
  177|  2.27M|   ranges::assert_equal_byte_lengths(out, in);
  178|  2.27M|   std::memcpy(std::ranges::data(out), std::ranges::data(in), ranges::size_bytes(out));
  179|  2.27M|}
_ZN5Botan9clear_memIhEEvPT_m:
  118|  35.5k|inline constexpr void clear_mem(T* ptr, size_t n) {
  119|  35.5k|   clear_bytes(ptr, sizeof(T) * n);
  120|  35.5k|}
_ZN5Botan13typecast_copyITkNS_6ranges23contiguous_output_rangeERNSt3__14spanIjLm18446744073709551615EEETkNS1_16contiguous_rangeENS3_IKhLm18446744073709551615EEEQaasr3stdE23is_trivially_copyable_vINS2_11conditionalIXsr21__is_primary_templateINS2_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS2_6ranges5__cpo5beginEEclsr3stdE7declvalIRT0_EEEEEEEEE5valueENS2_26indirectly_readable_traitsISF_EESG_E4type10value_typeEEsr3stdE23is_trivially_copyable_vINS8_IXsr21__is_primary_templateINS9_Iu14__remove_cvrefIDTclL_ZNSB_5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENSH_ISP_EESQ_E4type10value_typeEEEEvOSM_RKSC_:
  176|   771k|inline constexpr void typecast_copy(ToR&& out /* NOLINT(*-std-forward) */, const FromR& in) {
  177|   771k|   ranges::assert_equal_byte_lengths(out, in);
  178|   771k|   std::memcpy(std::ranges::data(out), std::ranges::data(in), ranges::size_bytes(out));
  179|   771k|}
_ZN5Botan8copy_memITkNS_6ranges23contiguous_output_rangeENSt3__14spanIhLm18446744073709551615EEETkNS1_16contiguous_rangeENS3_IKhLm18446744073709551615EEEQaasr3stdE9is_same_vINS2_11conditionalIXsr21__is_primary_templateINS2_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS2_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS2_26indirectly_readable_traitsISE_EESF_E4type10value_typeENS7_IXsr21__is_primary_templateINS8_Iu14__remove_cvrefIDTclL_ZNSA_5beginEEclsr3stdE7declvalIRT0_EEEEEEEEE5valueENSG_ISO_EESP_E4type10value_typeEEsr3stdE23is_trivially_copyable_vIST_EEEvOSB_RKSL_:
  160|  17.7k|inline constexpr void copy_mem(OutR&& out /* NOLINT(*-std-forward) */, const InR& in) {
  161|  17.7k|   ranges::assert_equal_byte_lengths(out, in);
  162|  17.7k|   if(std::is_constant_evaluated()) {
  ------------------
  |  Branch (162:7): [Folded, False: 17.7k]
  ------------------
  163|      0|      std::copy(std::ranges::begin(in), std::ranges::end(in), std::ranges::begin(out));
  164|  17.7k|   } else if(ranges::size_bytes(out) > 0) {
  ------------------
  |  Branch (164:14): [True: 17.7k, False: 0]
  ------------------
  165|  17.7k|      std::memmove(std::ranges::data(out), std::ranges::data(in), ranges::size_bytes(out));
  166|  17.7k|   }
  167|  17.7k|}

_ZN5Botan6ranges25assert_equal_byte_lengthsITkNS0_14spanable_rangeENSt3__14spanIhLm18446744073709551615EEETpTkNS0_14spanable_rangeEJNS3_IKhLm18446744073709551615EEEEEEvRKT_DpRKT0_QgtsZT0_Li0E:
  100|  17.7k|{
  101|  17.7k|   const std::span s0{r0};
  102|       |
  103|       |   if constexpr(statically_spanable_range<R0>) {
  104|       |      constexpr size_t expected_size = s0.size_bytes();
  105|       |      (assert_exact_byte_length<expected_size>(rs), ...);
  106|  17.7k|   } else {
  107|  17.7k|      const size_t expected_size = s0.size_bytes();
  108|  17.7k|      const bool correct_size =
  109|  17.7k|         ((std::span<const std::ranges::range_value_t<Rs>>{rs}.size_bytes() == expected_size) && ...);
  110|       |
  111|  17.7k|      if(!correct_size) {
  ------------------
  |  Branch (111:10): [True: 0, False: 17.7k]
  ------------------
  112|      0|         memory_region_size_violation();
  113|      0|      }
  114|  17.7k|   }
  115|  17.7k|}
_ZN5Botan6ranges24assert_exact_byte_lengthILm8ETkNS0_14spanable_rangeENSt3__14spanIhLm8EEEEEvRKT0_:
   77|  1.05M|inline constexpr void assert_exact_byte_length(const R& r) {
   78|  1.05M|   const std::span s{r};
   79|  1.05M|   if constexpr(statically_spanable_range<R>) {
   80|  1.05M|      static_assert(s.size_bytes() == expected, "memory region does not have expected byte lengths");
   81|       |   } else {
   82|       |      if(s.size_bytes() != expected) {
   83|       |         memory_region_size_violation();
   84|       |      }
   85|       |   }
   86|  1.05M|}
_ZN5Botan6ranges25assert_equal_byte_lengthsITkNS0_14spanable_rangeENSt3__14spanIhLm8EEETpTkNS0_14spanable_rangeEJNS3_IKmLm1EEEEEEvRKT_DpRKT0_QgtsZT0_Li0E:
  100|   559k|{
  101|   559k|   const std::span s0{r0};
  102|       |
  103|   559k|   if constexpr(statically_spanable_range<R0>) {
  104|   559k|      constexpr size_t expected_size = s0.size_bytes();
  105|   559k|      (assert_exact_byte_length<expected_size>(rs), ...);
  106|       |   } else {
  107|       |      const size_t expected_size = s0.size_bytes();
  108|       |      const bool correct_size =
  109|       |         ((std::span<const std::ranges::range_value_t<Rs>>{rs}.size_bytes() == expected_size) && ...);
  110|       |
  111|       |      if(!correct_size) {
  112|       |         memory_region_size_violation();
  113|       |      }
  114|       |   }
  115|   559k|}
_ZN5Botan6ranges24assert_exact_byte_lengthILm8ETkNS0_14spanable_rangeENSt3__14spanIKmLm1EEEEEvRKT0_:
   77|   559k|inline constexpr void assert_exact_byte_length(const R& r) {
   78|   559k|   const std::span s{r};
   79|   559k|   if constexpr(statically_spanable_range<R>) {
   80|   559k|      static_assert(s.size_bytes() == expected, "memory region does not have expected byte lengths");
   81|       |   } else {
   82|       |      if(s.size_bytes() != expected) {
   83|       |         memory_region_size_violation();
   84|       |      }
   85|       |   }
   86|   559k|}
_ZN5Botan6ranges10size_bytesITkNS0_14spanable_rangeENSt3__14spanIhLm8EEEEEmRKT_:
   59|   559k|inline constexpr size_t size_bytes(const spanable_range auto& r) {
   60|   559k|   return std::span{r}.size_bytes();
   61|   559k|}
_ZN5Botan6ranges25assert_equal_byte_lengthsITkNS0_14spanable_rangeENSt3__14spanIjLm18446744073709551615EEETpTkNS0_14spanable_rangeEJNS3_IKhLm18446744073709551615EEEEEEvRKT_DpRKT0_QgtsZT0_Li0E:
  100|  1.54M|{
  101|  1.54M|   const std::span s0{r0};
  102|       |
  103|       |   if constexpr(statically_spanable_range<R0>) {
  104|       |      constexpr size_t expected_size = s0.size_bytes();
  105|       |      (assert_exact_byte_length<expected_size>(rs), ...);
  106|  1.54M|   } else {
  107|  1.54M|      const size_t expected_size = s0.size_bytes();
  108|  1.54M|      const bool correct_size =
  109|  1.54M|         ((std::span<const std::ranges::range_value_t<Rs>>{rs}.size_bytes() == expected_size) && ...);
  110|       |
  111|  1.54M|      if(!correct_size) {
  ------------------
  |  Branch (111:10): [True: 0, False: 1.54M]
  ------------------
  112|      0|         memory_region_size_violation();
  113|      0|      }
  114|  1.54M|   }
  115|  1.54M|}
_ZN5Botan6ranges24assert_exact_byte_lengthILm8ETkNS0_14spanable_rangeENSt3__14spanIKhLm8EEEEEvRKT0_:
   77|  4.55M|inline constexpr void assert_exact_byte_length(const R& r) {
   78|  4.55M|   const std::span s{r};
   79|  4.55M|   if constexpr(statically_spanable_range<R>) {
   80|  4.55M|      static_assert(s.size_bytes() == expected, "memory region does not have expected byte lengths");
   81|       |   } else {
   82|       |      if(s.size_bytes() != expected) {
   83|       |         memory_region_size_violation();
   84|       |      }
   85|       |   }
   86|  4.55M|}
_ZN5Botan6ranges25assert_equal_byte_lengthsITkNS0_14spanable_rangeENSt3__14spanImLm1EEETpTkNS0_14spanable_rangeEJNS3_IKhLm8EEEEEEvRKT_DpRKT0_QgtsZT0_Li0E:
  100|  2.27M|{
  101|  2.27M|   const std::span s0{r0};
  102|       |
  103|  2.27M|   if constexpr(statically_spanable_range<R0>) {
  104|  2.27M|      constexpr size_t expected_size = s0.size_bytes();
  105|  2.27M|      (assert_exact_byte_length<expected_size>(rs), ...);
  106|       |   } else {
  107|       |      const size_t expected_size = s0.size_bytes();
  108|       |      const bool correct_size =
  109|       |         ((std::span<const std::ranges::range_value_t<Rs>>{rs}.size_bytes() == expected_size) && ...);
  110|       |
  111|       |      if(!correct_size) {
  112|       |         memory_region_size_violation();
  113|       |      }
  114|       |   }
  115|  2.27M|}
_ZN5Botan6ranges10size_bytesITkNS0_14spanable_rangeENSt3__14spanImLm1EEEEEmRKT_:
   59|  2.27M|inline constexpr size_t size_bytes(const spanable_range auto& r) {
   60|  2.27M|   return std::span{r}.size_bytes();
   61|  2.27M|}
_ZN5Botan6ranges10size_bytesITkNS0_14spanable_rangeENSt3__14spanIhLm18446744073709551615EEEEEmRKT_:
   59|  35.5k|inline constexpr size_t size_bytes(const spanable_range auto& r) {
   60|  35.5k|   return std::span{r}.size_bytes();
   61|  35.5k|}
_ZN5Botan6ranges25assert_equal_byte_lengthsITkNS0_14spanable_rangeENSt3__14spanIhLm18446744073709551615EEETpTkNS0_14spanable_rangeEJNS3_IKmLm18446744073709551615EEEEEEvRKT_DpRKT0_QgtsZT0_Li0E:
  100|  62.2k|{
  101|  62.2k|   const std::span s0{r0};
  102|       |
  103|       |   if constexpr(statically_spanable_range<R0>) {
  104|       |      constexpr size_t expected_size = s0.size_bytes();
  105|       |      (assert_exact_byte_length<expected_size>(rs), ...);
  106|  62.2k|   } else {
  107|  62.2k|      const size_t expected_size = s0.size_bytes();
  108|  62.2k|      const bool correct_size =
  109|  62.2k|         ((std::span<const std::ranges::range_value_t<Rs>>{rs}.size_bytes() == expected_size) && ...);
  110|       |
  111|  62.2k|      if(!correct_size) {
  ------------------
  |  Branch (111:10): [True: 0, False: 62.2k]
  ------------------
  112|      0|         memory_region_size_violation();
  113|      0|      }
  114|  62.2k|   }
  115|  62.2k|}
_ZN5Botan6ranges10size_bytesITkNS0_14spanable_rangeENSt3__14spanIjLm18446744073709551615EEEEEmRKT_:
   59|   771k|inline constexpr size_t size_bytes(const spanable_range auto& r) {
   60|   771k|   return std::span{r}.size_bytes();
   61|   771k|}
_ZN5Botan6ranges25assert_equal_byte_lengthsITkNS0_14spanable_rangeENSt3__15arrayImLm16EEETpTkNS0_14spanable_rangeEJNS2_4spanIKhLm128EEEEEEvRKT_DpRKT0_QgtsZT0_Li0E:
  100|   142k|{
  101|   142k|   const std::span s0{r0};
  102|       |
  103|   142k|   if constexpr(statically_spanable_range<R0>) {
  104|   142k|      constexpr size_t expected_size = s0.size_bytes();
  105|   142k|      (assert_exact_byte_length<expected_size>(rs), ...);
  106|       |   } else {
  107|       |      const size_t expected_size = s0.size_bytes();
  108|       |      const bool correct_size =
  109|       |         ((std::span<const std::ranges::range_value_t<Rs>>{rs}.size_bytes() == expected_size) && ...);
  110|       |
  111|       |      if(!correct_size) {
  112|       |         memory_region_size_violation();
  113|       |      }
  114|       |   }
  115|   142k|}
_ZN5Botan6ranges24assert_exact_byte_lengthILm128ETkNS0_14spanable_rangeENSt3__14spanIKhLm128EEEEEvRKT0_:
   77|   142k|inline constexpr void assert_exact_byte_length(const R& r) {
   78|   142k|   const std::span s{r};
   79|   142k|   if constexpr(statically_spanable_range<R>) {
   80|   142k|      static_assert(s.size_bytes() == expected, "memory region does not have expected byte lengths");
   81|       |   } else {
   82|       |      if(s.size_bytes() != expected) {
   83|       |         memory_region_size_violation();
   84|       |      }
   85|       |   }
   86|   142k|}

_ZN5Botan21RandomNumberGenerator10random_vecITkNS_8concepts21resizable_byte_bufferENSt3__16vectorIhNS_16secure_allocatorIhEEEEEEvRT_m:
  255|  4.44k|      void random_vec(T& v, size_t bytes) {
  256|  4.44k|         v.resize(bytes);
  257|  4.44k|         random_vec(v);
  258|  4.44k|      }
_ZN5Botan21RandomNumberGenerator10random_vecENSt3__14spanIhLm18446744073709551615EEE:
  244|  4.44k|      void random_vec(std::span<uint8_t> v) { this->randomize(v); }
_ZN5Botan21RandomNumberGenerator9randomizeENSt3__14spanIhLm18446744073709551615EEE:
   86|  4.44k|      void randomize(std::span<uint8_t> output) { this->fill_bytes_with_input(output, {}); }
_ZN5Botan21RandomNumberGenerator11add_entropyENSt3__14spanIKhLm18446744073709551615EEE:
  114|  4.44k|      void add_entropy(std::span<const uint8_t> input) { this->fill_bytes_with_input({}, input); }
_ZN5Botan21RandomNumberGenerator9next_byteEv:
  292|  4.44k|      uint8_t next_byte() {
  293|  4.44k|         uint8_t b = 0;
  294|  4.44k|         this->fill_bytes_with_input(std::span(&b, 1), {});
  295|  4.44k|         return b;
  296|  4.44k|      }
_ZN5Botan21RandomNumberGeneratorC2Ev:
   57|  8.88k|      RandomNumberGenerator() = default;
_ZN5Botan21RandomNumberGeneratorD2Ev:
   52|  8.88k|      virtual ~RandomNumberGenerator() = default;
_ZN5Botan21RandomNumberGenerator10random_vecITkNS_8concepts21resizable_byte_bufferENSt3__16vectorIhNS_16secure_allocatorIhEEEEQsr3stdE21default_initializableIT_EEES8_m:
  270|  4.44k|      T random_vec(size_t bytes) {
  271|  4.44k|         T result;
  272|  4.44k|         random_vec(result, bytes);
  273|  4.44k|         return result;
  274|  4.44k|      }

_ZN5Botan16secure_allocatorIhE10deallocateEPhm:
  102|  22.2k|      void deallocate(T* p, std::size_t n) { deallocate_memory(p, n, sizeof(T)); }
_ZN5Botan16secure_allocatorIhE8allocateEm:
   95|  22.2k|      T* allocate(std::size_t n) { return static_cast<T*>(allocate_memory(n, sizeof(T))); }
_ZN5Botan16secure_allocatorImE10deallocateEPmm:
  102|  4.44k|      void deallocate(T* p, std::size_t n) { deallocate_memory(p, n, sizeof(T)); }
_ZN5Botan16secure_allocatorImE8allocateEm:
   95|  4.44k|      T* allocate(std::size_t n) { return static_cast<T*>(allocate_memory(n, sizeof(T))); }

_ZN5Botan12Stateful_RNGC2ERNS_21RandomNumberGeneratorEm:
   49|  4.44k|            m_underlying_rng(&rng), m_reseed_interval(reseed_interval) {}
_ZNK5Botan12Stateful_RNG13accepts_inputEv:
   91|  4.44k|      bool accepts_input() const final { return true; }

_ZN5Botan18unwrap_strong_typeIRmEEDcOT_:
  328|   559k|[[nodiscard]] constexpr decltype(auto) unwrap_strong_type(T&& t) {
  329|   559k|   if constexpr(!concepts::strong_type<std::remove_cvref_t<T>>) {
  330|       |      // If the parameter type isn't a strong type, return it as is.
  331|   559k|      return std::forward<T>(t);
  332|       |   } else {
  333|       |      // Unwrap the strong type and return the underlying value.
  334|       |      return std::forward<T>(t).get();
  335|       |   }
  336|   559k|}
_ZN5Botan16wrap_strong_typeImRmQoosr3stdE18constructible_fromIT_T0_Eaasr8conceptsE11strong_typeIS2_Esr3stdE18constructible_fromINS2_12wrapped_typeES3_EEEDcOS3_:
  353|  2.27M|[[nodiscard]] constexpr decltype(auto) wrap_strong_type(ParamT&& t) {
  354|  2.27M|   if constexpr(std::same_as<std::remove_cvref_t<ParamT>, T>) {
  355|       |      // Noop, if the parameter type already is the desired return type.
  356|  2.27M|      return std::forward<ParamT>(t);
  357|       |   } else if constexpr(std::constructible_from<T, ParamT>) {
  358|       |      // Implicit conversion from the parameter type to the return type.
  359|       |      return T{std::forward<ParamT>(t)};
  360|       |   } else {
  361|       |      // Explicitly calling the wrapped type's constructor to support
  362|       |      // implicit conversions on types that mark their constructors as explicit.
  363|       |      static_assert(concepts::strong_type<T> && std::constructible_from<typename T::wrapped_type, ParamT>);
  364|       |      return T{typename T::wrapped_type{std::forward<ParamT>(t)}};
  365|       |   }
  366|  2.27M|}

_ZNK5Botan18SymmetricAlgorithm15valid_keylengthEm:
  143|  17.7k|      bool valid_keylength(size_t length) const { return key_spec().valid_keylength(length); }
_ZNK5Botan24Key_Length_Specification15valid_keylengthEm:
   44|  17.7k|      bool valid_keylength(size_t length) const {
   45|  17.7k|         return ((length >= m_min_keylen) && (length <= m_max_keylen) && (length % m_keylen_mod == 0));
  ------------------
  |  Branch (45:18): [True: 17.7k, False: 0]
  |  Branch (45:46): [True: 17.7k, False: 0]
  |  Branch (45:74): [True: 17.7k, False: 0]
  ------------------
   46|  17.7k|      }
_ZN5Botan24Key_Length_SpecificationC2Emmm:
   37|  17.7k|            m_min_keylen(min_k), m_max_keylen(max_k > 0 ? max_k : min_k), m_keylen_mod(k_mod) {}
  ------------------
  |  Branch (37:47): [True: 17.7k, False: 0]
  ------------------
_ZNK5Botan18SymmetricAlgorithm23assert_key_material_setEv:
  180|  84.4k|      void assert_key_material_set() const { assert_key_material_set(has_keying_material()); }
_ZNK5Botan18SymmetricAlgorithm23assert_key_material_setEb:
  186|  84.4k|      void assert_key_material_set(bool predicate) const {
  187|  84.4k|         if(!predicate) {
  ------------------
  |  Branch (187:13): [True: 0, False: 84.4k]
  ------------------
  188|      0|            throw_key_not_set_error();
  189|      0|         }
  190|  84.4k|      }
_ZN5Botan18SymmetricAlgorithmD2Ev:
   90|  4.44k|      virtual ~SymmetricAlgorithm() = default;
_ZN5Botan18SymmetricAlgorithmC2Ev:
   88|  4.44k|      SymmetricAlgorithm() = default;

_ZN5Botan20Buffered_Computation5finalENSt3__14spanIhLm18446744073709551615EEE:
   54|  62.2k|void Buffered_Computation::final(std::span<uint8_t> out) {
   55|  62.2k|   BOTAN_ARG_CHECK(out.size() >= output_length(), "Output buffer has insufficient capacity");
  ------------------
  |  |   35|  62.2k|   do {                                                          \
  |  |   36|  62.2k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */              \
  |  |   37|  62.2k|      if(!(expr)) {                                              \
  |  |  ------------------
  |  |  |  Branch (37:10): [True: 0, False: 62.2k]
  |  |  ------------------
  |  |   38|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */     \
  |  |   39|      0|         Botan::throw_invalid_argument(msg, __func__, __FILE__); \
  |  |   40|      0|      }                                                          \
  |  |   41|  62.2k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 62.2k]
  |  |  ------------------
  ------------------
   56|       |   // Pass exactly output_length() bytes so that an oversized buffer has the
   57|       |   // result written to its leading bytes with the remainder left untouched.
   58|  62.2k|   final_result(out.first(output_length()));
   59|  62.2k|}

_ZN5Botan18SymmetricAlgorithm7set_keyENSt3__14spanIKhLm18446744073709551615EEE:
   22|  17.7k|void SymmetricAlgorithm::set_key(std::span<const uint8_t> key) {
   23|  17.7k|   if(!valid_keylength(key.size())) {
  ------------------
  |  Branch (23:7): [True: 0, False: 17.7k]
  ------------------
   24|      0|      throw Invalid_Key_Length(name(), key.size());
   25|      0|   }
   26|  17.7k|   key_schedule(key);
   27|  17.7k|}

_ZN9Botan_FFI24ffi_clear_last_exceptionEv:
   85|   266k|void ffi_clear_last_exception() {
   86|   266k|   g_last_exception_what.clear();
   87|   266k|}
botan_scrub_mem:
  340|  1.25M|int botan_scrub_mem(void* mem, size_t bytes) {
  341|  1.25M|   if(bytes > 0 && mem == nullptr) {
  ------------------
  |  Branch (341:7): [True: 1.25M, False: 0]
  |  Branch (341:20): [True: 0, False: 1.25M]
  ------------------
  342|      0|      return BOTAN_FFI_ERROR_NULL_POINTER;
  343|      0|   }
  344|  1.25M|   Botan::secure_scrub_memory(mem, bytes);
  345|  1.25M|   return BOTAN_FFI_SUCCESS;
  346|  1.25M|}

botan_hash_init:
   18|  43.9k|int botan_hash_init(botan_hash_t* hash, const char* hash_name, uint32_t flags) {
   19|  43.9k|   return ffi_guard_thunk(__func__, [=]() -> int {
   20|  43.9k|      if(hash == nullptr || hash_name == nullptr || *hash_name == 0) {
   21|  43.9k|         return BOTAN_FFI_ERROR_NULL_POINTER;
   22|  43.9k|      }
   23|  43.9k|      if(flags != 0) {
   24|  43.9k|         return BOTAN_FFI_ERROR_BAD_FLAG;
   25|  43.9k|      }
   26|       |
   27|  43.9k|      auto h = Botan::HashFunction::create(hash_name);
   28|  43.9k|      if(h == nullptr) {
   29|  43.9k|         return BOTAN_FFI_ERROR_NOT_IMPLEMENTED;
   30|  43.9k|      }
   31|       |
   32|  43.9k|      ffi_new_object(hash, std::move(h));
   33|  43.9k|      return BOTAN_FFI_SUCCESS;
   34|  43.9k|   });
   35|  43.9k|}
botan_hash_destroy:
   37|  43.9k|int botan_hash_destroy(botan_hash_t hash) {
   38|  43.9k|   return BOTAN_FFI_CHECKED_DELETE(hash);
  ------------------
  |  |  188|  43.9k|#define BOTAN_FFI_CHECKED_DELETE(o) ffi_delete_object(o, __func__)
  ------------------
   39|  43.9k|}
botan_hash_output_length:
   41|  43.9k|int botan_hash_output_length(botan_hash_t hash, size_t* out) {
   42|  43.9k|   if(out == nullptr) {
  ------------------
  |  Branch (42:7): [True: 0, False: 43.9k]
  ------------------
   43|      0|      return BOTAN_FFI_ERROR_NULL_POINTER;
   44|      0|   }
   45|  43.9k|   return BOTAN_FFI_VISIT(hash, [=](const auto& h) { *out = h.output_length(); });
  ------------------
  |  |  158|  43.9k|#define BOTAN_FFI_VISIT(obj, lambda) botan_ffi_visit(obj, lambda, __func__)
  ------------------
   46|  43.9k|}
botan_hash_update:
   66|  85.2k|int botan_hash_update(botan_hash_t hash, const uint8_t* buf, size_t len) {
   67|  85.2k|   if(len == 0) {
  ------------------
  |  Branch (67:7): [True: 1.88k, False: 83.3k]
  ------------------
   68|  1.88k|      return 0;
   69|  1.88k|   }
   70|       |
   71|  83.3k|   if(buf == nullptr) {
  ------------------
  |  Branch (71:7): [True: 0, False: 83.3k]
  ------------------
   72|      0|      return BOTAN_FFI_ERROR_NULL_POINTER;
   73|      0|   }
   74|       |
   75|  83.3k|   return BOTAN_FFI_VISIT(hash, [=](auto& h) { h.update(buf, len); });
  ------------------
  |  |  158|  83.3k|#define BOTAN_FFI_VISIT(obj, lambda) botan_ffi_visit(obj, lambda, __func__)
  ------------------
   76|  83.3k|}
botan_hash_final:
   78|  42.5k|int botan_hash_final(botan_hash_t hash, uint8_t out[]) {
   79|  42.5k|   if(out == nullptr) {
  ------------------
  |  Branch (79:7): [True: 0, False: 42.5k]
  ------------------
   80|      0|      return BOTAN_FFI_ERROR_NULL_POINTER;
   81|      0|   }
   82|  42.5k|   return BOTAN_FFI_VISIT(hash, [=](auto& h) { h.final(out); });
  ------------------
  |  |  158|  42.5k|#define BOTAN_FFI_VISIT(obj, lambda) botan_ffi_visit(obj, lambda, __func__)
  ------------------
   83|  42.5k|}
ffi_hash.cpp:_ZZ15botan_hash_initENK3$_0clEv:
   19|  43.9k|   return ffi_guard_thunk(__func__, [=]() -> int {
   20|  43.9k|      if(hash == nullptr || hash_name == nullptr || *hash_name == 0) {
  ------------------
  |  Branch (20:10): [True: 0, False: 43.9k]
  |  Branch (20:29): [True: 0, False: 43.9k]
  |  Branch (20:53): [True: 0, False: 43.9k]
  ------------------
   21|      0|         return BOTAN_FFI_ERROR_NULL_POINTER;
   22|      0|      }
   23|  43.9k|      if(flags != 0) {
  ------------------
  |  Branch (23:10): [True: 0, False: 43.9k]
  ------------------
   24|      0|         return BOTAN_FFI_ERROR_BAD_FLAG;
   25|      0|      }
   26|       |
   27|  43.9k|      auto h = Botan::HashFunction::create(hash_name);
   28|  43.9k|      if(h == nullptr) {
  ------------------
  |  Branch (28:10): [True: 0, False: 43.9k]
  ------------------
   29|      0|         return BOTAN_FFI_ERROR_NOT_IMPLEMENTED;
   30|      0|      }
   31|       |
   32|  43.9k|      ffi_new_object(hash, std::move(h));
   33|  43.9k|      return BOTAN_FFI_SUCCESS;
   34|  43.9k|   });

botan_rng_init:
   38|  4.44k|int botan_rng_init(botan_rng_t* rng_out, const char* rng_type) {
   39|  4.44k|   return ffi_guard_thunk(__func__, [=]() -> int {
   40|  4.44k|      if(rng_out == nullptr) {
   41|  4.44k|         return BOTAN_FFI_ERROR_NULL_POINTER;
   42|  4.44k|      }
   43|       |
   44|  4.44k|      const std::string rng_type_s(rng_type != nullptr ? rng_type : "system");
   45|       |
   46|  4.44k|      std::unique_ptr<Botan::RandomNumberGenerator> rng;
   47|       |
   48|  4.44k|      if(rng_type_s == "system") {
   49|  4.44k|         rng = std::make_unique<Botan::System_RNG>();
   50|  4.44k|      } else if(rng_type_s == "user" || rng_type_s == "user-threadsafe") {
   51|  4.44k|         rng = std::make_unique<Botan::AutoSeeded_RNG>();
   52|  4.44k|      } else if(rng_type_s == "null") {
   53|  4.44k|         rng = std::make_unique<Botan::Null_RNG>();
   54|  4.44k|      }
   55|       |#if defined(BOTAN_HAS_PROCESSOR_RNG)
   56|       |      else if((rng_type_s == "rdrand" || rng_type_s == "hwrng") && Botan::Processor_RNG::available()) {
   57|       |         rng = std::make_unique<Botan::Processor_RNG>();
   58|       |      }
   59|       |#endif
   60|       |#if defined(BOTAN_HAS_JITTER_RNG)
   61|       |      else if(rng_type_s == "jitter") {
   62|       |         rng = std::make_unique<Botan::Jitter_RNG>();
   63|       |      }
   64|       |#endif
   65|       |#if defined(BOTAN_HAS_ESDM_RNG)
   66|       |      else if(rng_type_s == "esdm-full") {
   67|       |         rng = std::make_unique<Botan::ESDM_RNG>(false);
   68|       |      } else if(rng_type_s == "esdm-pr") {
   69|       |         rng = std::make_unique<Botan::ESDM_RNG>(true);
   70|       |      }
   71|       |#endif
   72|       |
   73|  4.44k|      if(!rng) {
   74|  4.44k|         return BOTAN_FFI_ERROR_NOT_IMPLEMENTED;
   75|  4.44k|      }
   76|       |
   77|  4.44k|      return ffi_new_object(rng_out, std::move(rng));
   78|  4.44k|   });
   79|  4.44k|}
botan_rng_destroy:
  164|  4.44k|int botan_rng_destroy(botan_rng_t rng) {
  165|  4.44k|   return BOTAN_FFI_CHECKED_DELETE(rng);
  ------------------
  |  |  188|  4.44k|#define BOTAN_FFI_CHECKED_DELETE(o) ffi_delete_object(o, __func__)
  ------------------
  166|  4.44k|}
ffi_rng.cpp:_ZZ14botan_rng_initENK3$_0clEv:
   39|  4.44k|   return ffi_guard_thunk(__func__, [=]() -> int {
   40|  4.44k|      if(rng_out == nullptr) {
  ------------------
  |  Branch (40:10): [True: 0, False: 4.44k]
  ------------------
   41|      0|         return BOTAN_FFI_ERROR_NULL_POINTER;
   42|      0|      }
   43|       |
   44|  4.44k|      const std::string rng_type_s(rng_type != nullptr ? rng_type : "system");
  ------------------
  |  Branch (44:36): [True: 4.44k, False: 0]
  ------------------
   45|       |
   46|  4.44k|      std::unique_ptr<Botan::RandomNumberGenerator> rng;
   47|       |
   48|  4.44k|      if(rng_type_s == "system") {
  ------------------
  |  Branch (48:10): [True: 0, False: 4.44k]
  ------------------
   49|      0|         rng = std::make_unique<Botan::System_RNG>();
   50|  4.44k|      } else if(rng_type_s == "user" || rng_type_s == "user-threadsafe") {
  ------------------
  |  Branch (50:17): [True: 4.44k, False: 0]
  |  Branch (50:41): [True: 0, False: 0]
  ------------------
   51|  4.44k|         rng = std::make_unique<Botan::AutoSeeded_RNG>();
   52|  4.44k|      } else if(rng_type_s == "null") {
  ------------------
  |  Branch (52:17): [True: 0, False: 0]
  ------------------
   53|      0|         rng = std::make_unique<Botan::Null_RNG>();
   54|      0|      }
   55|       |#if defined(BOTAN_HAS_PROCESSOR_RNG)
   56|       |      else if((rng_type_s == "rdrand" || rng_type_s == "hwrng") && Botan::Processor_RNG::available()) {
   57|       |         rng = std::make_unique<Botan::Processor_RNG>();
   58|       |      }
   59|       |#endif
   60|       |#if defined(BOTAN_HAS_JITTER_RNG)
   61|       |      else if(rng_type_s == "jitter") {
   62|       |         rng = std::make_unique<Botan::Jitter_RNG>();
   63|       |      }
   64|       |#endif
   65|       |#if defined(BOTAN_HAS_ESDM_RNG)
   66|       |      else if(rng_type_s == "esdm-full") {
   67|       |         rng = std::make_unique<Botan::ESDM_RNG>(false);
   68|       |      } else if(rng_type_s == "esdm-pr") {
   69|       |         rng = std::make_unique<Botan::ESDM_RNG>(true);
   70|       |      }
   71|       |#endif
   72|       |
   73|  4.44k|      if(!rng) {
  ------------------
  |  Branch (73:10): [True: 0, False: 4.44k]
  ------------------
   74|      0|         return BOTAN_FFI_ERROR_NOT_IMPLEMENTED;
   75|      0|      }
   76|       |
   77|  4.44k|      return ffi_new_object(rng_out, std::move(rng));
   78|  4.44k|   });

_ZN5Botan5CRC248add_dataENSt3__14spanIKhLm18446744073709551615EEE:
   85|  83.3k|void CRC24::add_data(std::span<const uint8_t> input) {
   86|  83.3k|   uint32_t tmp = m_crc;
   87|       |
   88|       |   // Input is word aligned if WA & input == 0
   89|  83.3k|   static const uint8_t WA = sizeof(size_t) - 1;
   90|       |
   91|       |   // Ensure input is word aligned before processing in parallel
   92|  83.6k|   for(; !input.empty() && (reinterpret_cast<uintptr_t>(input.data()) & WA) > 0; input = input.last(input.size() - 1)) {
  ------------------
  |  Branch (92:10): [True: 83.6k, False: 76]
  |  Branch (92:28): [True: 319, False: 83.2k]
  ------------------
   93|    319|      tmp = process8(tmp, input.front());
   94|    319|   }
   95|       |
   96|   854k|   while(input.size() >= 16) {
  ------------------
  |  Branch (96:10): [True: 771k, False: 83.3k]
  ------------------
   97|   771k|      uint32_t d[4];
   98|   771k|      load_le(d, input.data(), 4);
   99|   771k|      tmp = process32(tmp, d[0]);
  100|   771k|      tmp = process32(tmp, d[1]);
  101|   771k|      tmp = process32(tmp, d[2]);
  102|   771k|      tmp = process32(tmp, d[3]);
  103|       |
  104|   771k|      input = input.last(input.size() - 16);
  105|   771k|   }
  106|       |
  107|   501k|   for(; !input.empty(); input = input.last(input.size() - 1)) {
  ------------------
  |  Branch (107:10): [True: 418k, False: 83.3k]
  ------------------
  108|   418k|      tmp = process8(tmp, input.front());
  109|   418k|   }
  110|       |
  111|  83.3k|   m_crc = tmp;
  112|  83.3k|}
_ZN5Botan5CRC2412final_resultENSt3__14spanIhLm18446744073709551615EEE:
  117|  42.5k|void CRC24::final_result(std::span<uint8_t> output) {
  118|  42.5k|   output[0] = get_byte<3>(m_crc);
  119|  42.5k|   output[1] = get_byte<2>(m_crc);
  120|  42.5k|   output[2] = get_byte<1>(m_crc);
  121|  42.5k|   clear();
  122|  42.5k|}
crc24.cpp:_ZN5Botan12_GLOBAL__N_18process8Ejh:
   59|   418k|inline uint32_t process8(uint32_t crc, uint8_t data) {
   60|   418k|   return (crc >> 8) ^ CRC24_T0[get_byte<3>(crc) ^ data];
   61|   418k|}
crc24.cpp:_ZN5Botan12_GLOBAL__N_19process32Ejj:
   63|  3.08M|inline uint32_t process32(uint32_t crc, uint32_t word) {
   64|  3.08M|   const uint32_t sum = crc ^ word;
   65|       |
   66|  3.08M|   return CRC24_T3[get_byte<3>(sum)] ^ CRC24_T2[get_byte<2>(sum)] ^ CRC24_T1[get_byte<1>(sum)] ^
   67|  3.08M|          CRC24_T0[get_byte<0>(sum)];
   68|  3.08M|}

_ZN5Botan12HashFunction6createENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEES5_:
  111|  48.3k|std::unique_ptr<HashFunction> HashFunction::create(std::string_view algo_spec, std::string_view provider) {
  112|       |#if defined(BOTAN_HAS_COMMONCRYPTO)
  113|       |   if(provider.empty() || provider == "commoncrypto") {
  114|       |      if(auto hash = make_commoncrypto_hash(algo_spec))
  115|       |         return hash;
  116|       |
  117|       |      if(!provider.empty())
  118|       |         return nullptr;
  119|       |   }
  120|       |#endif
  121|       |
  122|  48.3k|   if(provider.empty() == false && provider != "base") {
  ------------------
  |  Branch (122:7): [True: 0, False: 48.3k]
  |  Branch (122:36): [True: 0, False: 0]
  ------------------
  123|      0|      return nullptr;  // unknown provider
  124|      0|   }
  125|       |
  126|  48.3k|#if defined(BOTAN_HAS_SHA1)
  127|  48.3k|   if(algo_spec == "SHA-1") {
  ------------------
  |  Branch (127:7): [True: 0, False: 48.3k]
  ------------------
  128|      0|      return std::make_unique<SHA_1>();
  129|      0|   }
  130|  48.3k|#endif
  131|       |
  132|  48.3k|#if defined(BOTAN_HAS_SHA2_32)
  133|  48.3k|   if(algo_spec == "SHA-224") {
  ------------------
  |  Branch (133:7): [True: 0, False: 48.3k]
  ------------------
  134|      0|      return std::make_unique<SHA_224>();
  135|      0|   }
  136|       |
  137|  48.3k|   if(algo_spec == "SHA-256") {
  ------------------
  |  Branch (137:7): [True: 0, False: 48.3k]
  ------------------
  138|      0|      return std::make_unique<SHA_256>();
  139|      0|   }
  140|  48.3k|#endif
  141|       |
  142|  48.3k|#if defined(BOTAN_HAS_SHA2_64)
  143|  48.3k|   if(algo_spec == "SHA-384") {
  ------------------
  |  Branch (143:7): [True: 0, False: 48.3k]
  ------------------
  144|      0|      return std::make_unique<SHA_384>();
  145|      0|   }
  146|       |
  147|  48.3k|   if(algo_spec == "SHA-512") {
  ------------------
  |  Branch (147:7): [True: 4.44k, False: 43.9k]
  ------------------
  148|  4.44k|      return std::make_unique<SHA_512>();
  149|  4.44k|   }
  150|       |
  151|  43.9k|   if(algo_spec == "SHA-512-256") {
  ------------------
  |  Branch (151:7): [True: 0, False: 43.9k]
  ------------------
  152|      0|      return std::make_unique<SHA_512_256>();
  153|      0|   }
  154|  43.9k|#endif
  155|       |
  156|  43.9k|#if defined(BOTAN_HAS_RIPEMD_160)
  157|  43.9k|   if(algo_spec == "RIPEMD-160") {
  ------------------
  |  Branch (157:7): [True: 0, False: 43.9k]
  ------------------
  158|      0|      return std::make_unique<RIPEMD_160>();
  159|      0|   }
  160|  43.9k|#endif
  161|       |
  162|       |#if defined(BOTAN_HAS_WHIRLPOOL)
  163|       |   if(algo_spec == "Whirlpool") {
  164|       |      return std::make_unique<Whirlpool>();
  165|       |   }
  166|       |#endif
  167|       |
  168|  43.9k|#if defined(BOTAN_HAS_MD5)
  169|  43.9k|   if(algo_spec == "MD5") {
  ------------------
  |  Branch (169:7): [True: 0, False: 43.9k]
  ------------------
  170|      0|      return std::make_unique<MD5>();
  171|      0|   }
  172|  43.9k|#endif
  173|       |
  174|       |#if defined(BOTAN_HAS_MD4)
  175|       |   if(algo_spec == "MD4") {
  176|       |      return std::make_unique<MD4>();
  177|       |   }
  178|       |#endif
  179|       |
  180|       |#if defined(BOTAN_HAS_GOST_34_11)
  181|       |   if(algo_spec == "GOST-R-34.11-94" || algo_spec == "GOST-34.11") {
  182|       |      return std::make_unique<GOST_34_11>();
  183|       |   }
  184|       |#endif
  185|       |
  186|       |#if defined(BOTAN_HAS_ADLER32)
  187|       |   if(algo_spec == "Adler32") {
  188|       |      return std::make_unique<Adler32>();
  189|       |   }
  190|       |#endif
  191|       |
  192|       |#if defined(BOTAN_HAS_ASCON_HASH256)
  193|       |   if(algo_spec == "Ascon-Hash256") {
  194|       |      return std::make_unique<Ascon_Hash256>();
  195|       |   }
  196|       |#endif
  197|       |
  198|  43.9k|#if defined(BOTAN_HAS_CRC24)
  199|  43.9k|   if(algo_spec == "CRC24") {
  ------------------
  |  Branch (199:7): [True: 43.9k, False: 0]
  ------------------
  200|  43.9k|      return std::make_unique<CRC24>();
  201|  43.9k|   }
  202|      0|#endif
  203|       |
  204|       |#if defined(BOTAN_HAS_CRC32)
  205|       |   if(algo_spec == "CRC32") {
  206|       |      return std::make_unique<CRC32>();
  207|       |   }
  208|       |#endif
  209|       |
  210|       |#if defined(BOTAN_HAS_STREEBOG)
  211|       |   if(algo_spec == "Streebog-256") {
  212|       |      return std::make_unique<Streebog>(256);
  213|       |   }
  214|       |   if(algo_spec == "Streebog-512") {
  215|       |      return std::make_unique<Streebog>(512);
  216|       |   }
  217|       |#endif
  218|       |
  219|      0|#if defined(BOTAN_HAS_SM3)
  220|      0|   if(algo_spec == "SM3") {
  ------------------
  |  Branch (220:7): [True: 0, False: 0]
  ------------------
  221|      0|      return std::make_unique<SM3>();
  222|      0|   }
  223|      0|#endif
  224|       |
  225|      0|   const SCAN_Name req(algo_spec);
  226|       |
  227|       |#if defined(BOTAN_HAS_SKEIN_512)
  228|       |   if(req.algo_name() == "Skein-512") {
  229|       |      return std::make_unique<Skein_512>(req.arg_as_integer(0, 512), req.arg(1, ""));
  230|       |   }
  231|       |#endif
  232|       |
  233|      0|#if defined(BOTAN_HAS_BLAKE2B)
  234|      0|   if(req.algo_name() == "Blake2b" || req.algo_name() == "BLAKE2b") {
  ------------------
  |  Branch (234:7): [True: 0, False: 0]
  |  Branch (234:39): [True: 0, False: 0]
  ------------------
  235|      0|      return std::make_unique<BLAKE2b>(req.arg_as_integer(0, 512));
  236|      0|   }
  237|      0|#endif
  238|       |
  239|       |#if defined(BOTAN_HAS_BLAKE2S)
  240|       |   if(req.algo_name() == "Blake2s" || req.algo_name() == "BLAKE2s") {
  241|       |      return std::make_unique<BLAKE2s>(req.arg_as_integer(0, 256));
  242|       |   }
  243|       |#endif
  244|       |
  245|       |#if defined(BOTAN_HAS_KECCAK)
  246|       |   if(req.algo_name() == "Keccak-1600") {
  247|       |      return std::make_unique<Keccak_1600>(req.arg_as_integer(0, 512));
  248|       |   }
  249|       |#endif
  250|       |
  251|      0|#if defined(BOTAN_HAS_SHA3)
  252|      0|   if(req.algo_name() == "SHA-3") {
  ------------------
  |  Branch (252:7): [True: 0, False: 0]
  ------------------
  253|      0|      return std::make_unique<SHA_3>(req.arg_as_integer(0, 512));
  254|      0|   }
  255|      0|#endif
  256|       |
  257|      0|#if defined(BOTAN_HAS_SHAKE)
  258|      0|   if(req.algo_name() == "SHAKE-128" && req.arg_count() == 1) {
  ------------------
  |  Branch (258:7): [True: 0, False: 0]
  |  Branch (258:41): [True: 0, False: 0]
  ------------------
  259|      0|      return std::make_unique<SHAKE_128>(req.arg_as_integer(0));
  260|      0|   }
  261|      0|   if(req.algo_name() == "SHAKE-256" && req.arg_count() == 1) {
  ------------------
  |  Branch (261:7): [True: 0, False: 0]
  |  Branch (261:41): [True: 0, False: 0]
  ------------------
  262|      0|      return std::make_unique<SHAKE_256>(req.arg_as_integer(0));
  263|      0|   }
  264|      0|#endif
  265|       |
  266|       |#if defined(BOTAN_HAS_PARALLEL_HASH)
  267|       |   if(req.algo_name() == "Parallel") {
  268|       |      std::vector<std::unique_ptr<HashFunction>> hashes;
  269|       |
  270|       |      for(size_t i = 0; i != req.arg_count(); ++i) {
  271|       |         auto h = HashFunction::create(req.arg(i));
  272|       |         if(!h) {
  273|       |            return nullptr;
  274|       |         }
  275|       |         hashes.push_back(std::move(h));
  276|       |      }
  277|       |
  278|       |      return std::make_unique<Parallel>(hashes);
  279|       |   }
  280|       |#endif
  281|       |
  282|      0|#if defined(BOTAN_HAS_TRUNCATED_HASH)
  283|      0|   if(req.algo_name() == "Truncated" && req.arg_count() == 2) {
  ------------------
  |  Branch (283:7): [True: 0, False: 0]
  |  Branch (283:41): [True: 0, False: 0]
  ------------------
  284|      0|      auto hash = HashFunction::create(req.arg(0));
  285|      0|      if(!hash) {
  ------------------
  |  Branch (285:10): [True: 0, False: 0]
  ------------------
  286|      0|         return nullptr;
  287|      0|      }
  288|       |
  289|      0|      return std::make_unique<Truncated_Hash>(std::move(hash), req.arg_as_integer(1));
  290|      0|   }
  291|      0|#endif
  292|       |
  293|       |#if defined(BOTAN_HAS_COMB4P)
  294|       |   if(req.algo_name() == "Comb4P" && req.arg_count() == 2) {
  295|       |      auto h1 = HashFunction::create(req.arg(0));
  296|       |      auto h2 = HashFunction::create(req.arg(1));
  297|       |
  298|       |      if(h1 && h2) {
  299|       |         return std::make_unique<Comb4P>(std::move(h1), std::move(h2));
  300|       |      }
  301|       |   }
  302|       |#endif
  303|       |
  304|      0|   return nullptr;
  305|      0|}

_ZN5Botan7SHA_51215compress_digestERNSt3__16vectorImNS_16secure_allocatorImEEEENS1_4spanIKhLm18446744073709551615EEEm:
   56|   142k|void SHA_512::compress_digest(digest_type& digest, std::span<const uint8_t> input, size_t blocks) {
   57|       |#if defined(BOTAN_HAS_SHA2_64_X86)
   58|       |   if(CPUID::has(CPUID::Feature::SHA512)) {
   59|       |      return compress_digest_x86(digest, input, blocks);
   60|       |   }
   61|       |#endif
   62|       |
   63|       |#if defined(BOTAN_HAS_SHA2_64_ARMV8)
   64|       |   if(CPUID::has(CPUID::Feature::SHA2_512)) {
   65|       |      return compress_digest_armv8(digest, input, blocks);
   66|       |   }
   67|       |#endif
   68|       |
   69|       |#if defined(BOTAN_HAS_SHA2_64_X86_AVX512)
   70|       |   if(CPUID::has(CPUID::Feature::AVX512, CPUID::Feature::BMI)) {
   71|       |      return compress_digest_x86_avx512(digest, input, blocks);
   72|       |   }
   73|       |#endif
   74|       |
   75|       |#if defined(BOTAN_HAS_SHA2_64_X86_AVX2)
   76|       |   if(CPUID::has(CPUID::Feature::AVX2, CPUID::Feature::BMI)) {
   77|       |      return compress_digest_x86_avx2(digest, input, blocks);
   78|       |   }
   79|       |#endif
   80|       |
   81|   142k|   uint64_t A = digest[0];
   82|   142k|   uint64_t B = digest[1];
   83|   142k|   uint64_t C = digest[2];
   84|   142k|   uint64_t D = digest[3];
   85|   142k|   uint64_t E = digest[4];
   86|   142k|   uint64_t F = digest[5];
   87|   142k|   uint64_t G = digest[6];
   88|   142k|   uint64_t H = digest[7];
   89|       |
   90|   142k|   std::array<uint64_t, 16> W{};
   91|       |
   92|   142k|   BufferSlicer in(input);
   93|       |
   94|   284k|   for(size_t i = 0; i != blocks; ++i) {
  ------------------
  |  Branch (94:22): [True: 142k, False: 142k]
  ------------------
   95|   142k|      load_be(W, in.take<block_bytes>());
   96|       |
   97|       |      // clang-format off
   98|       |
   99|   142k|      SHA2_64_F(A, B, C, D, E, F, G, H, W[ 0], W[14], W[ 9], W[ 1], 0x428A2F98D728AE22);
  100|   142k|      SHA2_64_F(H, A, B, C, D, E, F, G, W[ 1], W[15], W[10], W[ 2], 0x7137449123EF65CD);
  101|   142k|      SHA2_64_F(G, H, A, B, C, D, E, F, W[ 2], W[ 0], W[11], W[ 3], 0xB5C0FBCFEC4D3B2F);
  102|   142k|      SHA2_64_F(F, G, H, A, B, C, D, E, W[ 3], W[ 1], W[12], W[ 4], 0xE9B5DBA58189DBBC);
  103|   142k|      SHA2_64_F(E, F, G, H, A, B, C, D, W[ 4], W[ 2], W[13], W[ 5], 0x3956C25BF348B538);
  104|   142k|      SHA2_64_F(D, E, F, G, H, A, B, C, W[ 5], W[ 3], W[14], W[ 6], 0x59F111F1B605D019);
  105|   142k|      SHA2_64_F(C, D, E, F, G, H, A, B, W[ 6], W[ 4], W[15], W[ 7], 0x923F82A4AF194F9B);
  106|   142k|      SHA2_64_F(B, C, D, E, F, G, H, A, W[ 7], W[ 5], W[ 0], W[ 8], 0xAB1C5ED5DA6D8118);
  107|   142k|      SHA2_64_F(A, B, C, D, E, F, G, H, W[ 8], W[ 6], W[ 1], W[ 9], 0xD807AA98A3030242);
  108|   142k|      SHA2_64_F(H, A, B, C, D, E, F, G, W[ 9], W[ 7], W[ 2], W[10], 0x12835B0145706FBE);
  109|   142k|      SHA2_64_F(G, H, A, B, C, D, E, F, W[10], W[ 8], W[ 3], W[11], 0x243185BE4EE4B28C);
  110|   142k|      SHA2_64_F(F, G, H, A, B, C, D, E, W[11], W[ 9], W[ 4], W[12], 0x550C7DC3D5FFB4E2);
  111|   142k|      SHA2_64_F(E, F, G, H, A, B, C, D, W[12], W[10], W[ 5], W[13], 0x72BE5D74F27B896F);
  112|   142k|      SHA2_64_F(D, E, F, G, H, A, B, C, W[13], W[11], W[ 6], W[14], 0x80DEB1FE3B1696B1);
  113|   142k|      SHA2_64_F(C, D, E, F, G, H, A, B, W[14], W[12], W[ 7], W[15], 0x9BDC06A725C71235);
  114|   142k|      SHA2_64_F(B, C, D, E, F, G, H, A, W[15], W[13], W[ 8], W[ 0], 0xC19BF174CF692694);
  115|   142k|      SHA2_64_F(A, B, C, D, E, F, G, H, W[ 0], W[14], W[ 9], W[ 1], 0xE49B69C19EF14AD2);
  116|   142k|      SHA2_64_F(H, A, B, C, D, E, F, G, W[ 1], W[15], W[10], W[ 2], 0xEFBE4786384F25E3);
  117|   142k|      SHA2_64_F(G, H, A, B, C, D, E, F, W[ 2], W[ 0], W[11], W[ 3], 0x0FC19DC68B8CD5B5);
  118|   142k|      SHA2_64_F(F, G, H, A, B, C, D, E, W[ 3], W[ 1], W[12], W[ 4], 0x240CA1CC77AC9C65);
  119|   142k|      SHA2_64_F(E, F, G, H, A, B, C, D, W[ 4], W[ 2], W[13], W[ 5], 0x2DE92C6F592B0275);
  120|   142k|      SHA2_64_F(D, E, F, G, H, A, B, C, W[ 5], W[ 3], W[14], W[ 6], 0x4A7484AA6EA6E483);
  121|   142k|      SHA2_64_F(C, D, E, F, G, H, A, B, W[ 6], W[ 4], W[15], W[ 7], 0x5CB0A9DCBD41FBD4);
  122|   142k|      SHA2_64_F(B, C, D, E, F, G, H, A, W[ 7], W[ 5], W[ 0], W[ 8], 0x76F988DA831153B5);
  123|   142k|      SHA2_64_F(A, B, C, D, E, F, G, H, W[ 8], W[ 6], W[ 1], W[ 9], 0x983E5152EE66DFAB);
  124|   142k|      SHA2_64_F(H, A, B, C, D, E, F, G, W[ 9], W[ 7], W[ 2], W[10], 0xA831C66D2DB43210);
  125|   142k|      SHA2_64_F(G, H, A, B, C, D, E, F, W[10], W[ 8], W[ 3], W[11], 0xB00327C898FB213F);
  126|   142k|      SHA2_64_F(F, G, H, A, B, C, D, E, W[11], W[ 9], W[ 4], W[12], 0xBF597FC7BEEF0EE4);
  127|   142k|      SHA2_64_F(E, F, G, H, A, B, C, D, W[12], W[10], W[ 5], W[13], 0xC6E00BF33DA88FC2);
  128|   142k|      SHA2_64_F(D, E, F, G, H, A, B, C, W[13], W[11], W[ 6], W[14], 0xD5A79147930AA725);
  129|   142k|      SHA2_64_F(C, D, E, F, G, H, A, B, W[14], W[12], W[ 7], W[15], 0x06CA6351E003826F);
  130|   142k|      SHA2_64_F(B, C, D, E, F, G, H, A, W[15], W[13], W[ 8], W[ 0], 0x142929670A0E6E70);
  131|   142k|      SHA2_64_F(A, B, C, D, E, F, G, H, W[ 0], W[14], W[ 9], W[ 1], 0x27B70A8546D22FFC);
  132|   142k|      SHA2_64_F(H, A, B, C, D, E, F, G, W[ 1], W[15], W[10], W[ 2], 0x2E1B21385C26C926);
  133|   142k|      SHA2_64_F(G, H, A, B, C, D, E, F, W[ 2], W[ 0], W[11], W[ 3], 0x4D2C6DFC5AC42AED);
  134|   142k|      SHA2_64_F(F, G, H, A, B, C, D, E, W[ 3], W[ 1], W[12], W[ 4], 0x53380D139D95B3DF);
  135|   142k|      SHA2_64_F(E, F, G, H, A, B, C, D, W[ 4], W[ 2], W[13], W[ 5], 0x650A73548BAF63DE);
  136|   142k|      SHA2_64_F(D, E, F, G, H, A, B, C, W[ 5], W[ 3], W[14], W[ 6], 0x766A0ABB3C77B2A8);
  137|   142k|      SHA2_64_F(C, D, E, F, G, H, A, B, W[ 6], W[ 4], W[15], W[ 7], 0x81C2C92E47EDAEE6);
  138|   142k|      SHA2_64_F(B, C, D, E, F, G, H, A, W[ 7], W[ 5], W[ 0], W[ 8], 0x92722C851482353B);
  139|   142k|      SHA2_64_F(A, B, C, D, E, F, G, H, W[ 8], W[ 6], W[ 1], W[ 9], 0xA2BFE8A14CF10364);
  140|   142k|      SHA2_64_F(H, A, B, C, D, E, F, G, W[ 9], W[ 7], W[ 2], W[10], 0xA81A664BBC423001);
  141|   142k|      SHA2_64_F(G, H, A, B, C, D, E, F, W[10], W[ 8], W[ 3], W[11], 0xC24B8B70D0F89791);
  142|   142k|      SHA2_64_F(F, G, H, A, B, C, D, E, W[11], W[ 9], W[ 4], W[12], 0xC76C51A30654BE30);
  143|   142k|      SHA2_64_F(E, F, G, H, A, B, C, D, W[12], W[10], W[ 5], W[13], 0xD192E819D6EF5218);
  144|   142k|      SHA2_64_F(D, E, F, G, H, A, B, C, W[13], W[11], W[ 6], W[14], 0xD69906245565A910);
  145|   142k|      SHA2_64_F(C, D, E, F, G, H, A, B, W[14], W[12], W[ 7], W[15], 0xF40E35855771202A);
  146|   142k|      SHA2_64_F(B, C, D, E, F, G, H, A, W[15], W[13], W[ 8], W[ 0], 0x106AA07032BBD1B8);
  147|   142k|      SHA2_64_F(A, B, C, D, E, F, G, H, W[ 0], W[14], W[ 9], W[ 1], 0x19A4C116B8D2D0C8);
  148|   142k|      SHA2_64_F(H, A, B, C, D, E, F, G, W[ 1], W[15], W[10], W[ 2], 0x1E376C085141AB53);
  149|   142k|      SHA2_64_F(G, H, A, B, C, D, E, F, W[ 2], W[ 0], W[11], W[ 3], 0x2748774CDF8EEB99);
  150|   142k|      SHA2_64_F(F, G, H, A, B, C, D, E, W[ 3], W[ 1], W[12], W[ 4], 0x34B0BCB5E19B48A8);
  151|   142k|      SHA2_64_F(E, F, G, H, A, B, C, D, W[ 4], W[ 2], W[13], W[ 5], 0x391C0CB3C5C95A63);
  152|   142k|      SHA2_64_F(D, E, F, G, H, A, B, C, W[ 5], W[ 3], W[14], W[ 6], 0x4ED8AA4AE3418ACB);
  153|   142k|      SHA2_64_F(C, D, E, F, G, H, A, B, W[ 6], W[ 4], W[15], W[ 7], 0x5B9CCA4F7763E373);
  154|   142k|      SHA2_64_F(B, C, D, E, F, G, H, A, W[ 7], W[ 5], W[ 0], W[ 8], 0x682E6FF3D6B2B8A3);
  155|   142k|      SHA2_64_F(A, B, C, D, E, F, G, H, W[ 8], W[ 6], W[ 1], W[ 9], 0x748F82EE5DEFB2FC);
  156|   142k|      SHA2_64_F(H, A, B, C, D, E, F, G, W[ 9], W[ 7], W[ 2], W[10], 0x78A5636F43172F60);
  157|   142k|      SHA2_64_F(G, H, A, B, C, D, E, F, W[10], W[ 8], W[ 3], W[11], 0x84C87814A1F0AB72);
  158|   142k|      SHA2_64_F(F, G, H, A, B, C, D, E, W[11], W[ 9], W[ 4], W[12], 0x8CC702081A6439EC);
  159|   142k|      SHA2_64_F(E, F, G, H, A, B, C, D, W[12], W[10], W[ 5], W[13], 0x90BEFFFA23631E28);
  160|   142k|      SHA2_64_F(D, E, F, G, H, A, B, C, W[13], W[11], W[ 6], W[14], 0xA4506CEBDE82BDE9);
  161|   142k|      SHA2_64_F(C, D, E, F, G, H, A, B, W[14], W[12], W[ 7], W[15], 0xBEF9A3F7B2C67915);
  162|   142k|      SHA2_64_F(B, C, D, E, F, G, H, A, W[15], W[13], W[ 8], W[ 0], 0xC67178F2E372532B);
  163|   142k|      SHA2_64_F(A, B, C, D, E, F, G, H, W[ 0], W[14], W[ 9], W[ 1], 0xCA273ECEEA26619C);
  164|   142k|      SHA2_64_F(H, A, B, C, D, E, F, G, W[ 1], W[15], W[10], W[ 2], 0xD186B8C721C0C207);
  165|   142k|      SHA2_64_F(G, H, A, B, C, D, E, F, W[ 2], W[ 0], W[11], W[ 3], 0xEADA7DD6CDE0EB1E);
  166|   142k|      SHA2_64_F(F, G, H, A, B, C, D, E, W[ 3], W[ 1], W[12], W[ 4], 0xF57D4F7FEE6ED178);
  167|   142k|      SHA2_64_F(E, F, G, H, A, B, C, D, W[ 4], W[ 2], W[13], W[ 5], 0x06F067AA72176FBA);
  168|   142k|      SHA2_64_F(D, E, F, G, H, A, B, C, W[ 5], W[ 3], W[14], W[ 6], 0x0A637DC5A2C898A6);
  169|   142k|      SHA2_64_F(C, D, E, F, G, H, A, B, W[ 6], W[ 4], W[15], W[ 7], 0x113F9804BEF90DAE);
  170|   142k|      SHA2_64_F(B, C, D, E, F, G, H, A, W[ 7], W[ 5], W[ 0], W[ 8], 0x1B710B35131C471B);
  171|   142k|      SHA2_64_F(A, B, C, D, E, F, G, H, W[ 8], W[ 6], W[ 1], W[ 9], 0x28DB77F523047D84);
  172|   142k|      SHA2_64_F(H, A, B, C, D, E, F, G, W[ 9], W[ 7], W[ 2], W[10], 0x32CAAB7B40C72493);
  173|   142k|      SHA2_64_F(G, H, A, B, C, D, E, F, W[10], W[ 8], W[ 3], W[11], 0x3C9EBE0A15C9BEBC);
  174|   142k|      SHA2_64_F(F, G, H, A, B, C, D, E, W[11], W[ 9], W[ 4], W[12], 0x431D67C49C100D4C);
  175|   142k|      SHA2_64_F(E, F, G, H, A, B, C, D, W[12], W[10], W[ 5], W[13], 0x4CC5D4BECB3E42B6);
  176|   142k|      SHA2_64_F(D, E, F, G, H, A, B, C, W[13], W[11], W[ 6], W[14], 0x597F299CFC657E2A);
  177|   142k|      SHA2_64_F(C, D, E, F, G, H, A, B, W[14], W[12], W[ 7], W[15], 0x5FCB6FAB3AD6FAEC);
  178|   142k|      SHA2_64_F(B, C, D, E, F, G, H, A, W[15], W[13], W[ 8], W[ 0], 0x6C44198C4A475817);
  179|       |
  180|       |      // clang-format on
  181|       |
  182|   142k|      A = (digest[0] += A);
  183|   142k|      B = (digest[1] += B);
  184|   142k|      C = (digest[2] += C);
  185|   142k|      D = (digest[3] += D);
  186|   142k|      E = (digest[4] += E);
  187|   142k|      F = (digest[5] += F);
  188|   142k|      G = (digest[6] += G);
  189|   142k|      H = (digest[7] += H);
  190|   142k|   }
  191|   142k|}
_ZN5Botan7SHA_51210compress_nERNSt3__16vectorImNS_16secure_allocatorImEEEENS1_4spanIKhLm18446744073709551615EEEm:
  213|   142k|void SHA_512::compress_n(digest_type& digest, std::span<const uint8_t> input, size_t blocks) {
  214|   142k|   SHA_512::compress_digest(digest, input, blocks);
  215|   142k|}
_ZN5Botan7SHA_5124initERNSt3__16vectorImNS_16secure_allocatorImEEEE:
  239|  84.4k|void SHA_512::init(digest_type& digest) {
  240|  84.4k|   digest.assign({0x6A09E667F3BCC908,
  241|  84.4k|                  0xBB67AE8584CAA73B,
  242|  84.4k|                  0x3C6EF372FE94F82B,
  243|  84.4k|                  0xA54FF53A5F1D36F1,
  244|  84.4k|                  0x510E527FADE682D1,
  245|  84.4k|                  0x9B05688C2B3E6C1F,
  246|  84.4k|                  0x1F83D9ABFB41BD6B,
  247|  84.4k|                  0x5BE0CD19137E2179});
  248|  84.4k|}
_ZN5Botan7SHA_5128add_dataENSt3__14spanIKhLm18446744073709551615EEE:
  278|   164k|void SHA_512::add_data(std::span<const uint8_t> input) {
  279|   164k|   m_md.update(input);
  280|   164k|}
_ZN5Botan7SHA_51212final_resultENSt3__14spanIhLm18446744073709551615EEE:
  290|  62.2k|void SHA_512::final_result(std::span<uint8_t> output) {
  291|  62.2k|   m_md.final(output);
  292|  62.2k|}

_ZN5Botan4HMAC8add_dataENSt3__14spanIKhLm18446744073709551615EEE:
   21|  53.3k|void HMAC::add_data(std::span<const uint8_t> input) {
   22|  53.3k|   assert_key_material_set();
   23|  53.3k|   m_hash->update(input);
   24|  53.3k|}
_ZN5Botan4HMAC12final_resultENSt3__14spanIhLm18446744073709551615EEE:
   29|  31.1k|void HMAC::final_result(std::span<uint8_t> mac) {
   30|  31.1k|   assert_key_material_set();
   31|  31.1k|   m_hash->final(mac);
   32|  31.1k|   m_hash->update(m_okey);
   33|  31.1k|   m_hash->update(mac.first(m_hash_output_length));
   34|  31.1k|   m_hash->final(mac);
   35|  31.1k|   m_hash->update(m_ikey);
   36|  31.1k|}
_ZNK5Botan4HMAC8key_specEv:
   48|  17.7k|Key_Length_Specification HMAC::key_spec() const {
   49|       |   // Support very long lengths for things like PBKDF2 and the TLS PRF
   50|  17.7k|   return Key_Length_Specification(0, 8192);
   51|  17.7k|}
_ZNK5Botan4HMAC13output_lengthEv:
   53|  39.9k|size_t HMAC::output_length() const {
   54|  39.9k|   return m_hash_output_length;
   55|  39.9k|}
_ZNK5Botan4HMAC19has_keying_materialEv:
   57|  84.4k|bool HMAC::has_keying_material() const {
   58|  84.4k|   return !m_okey.empty();
   59|  84.4k|}
_ZN5Botan4HMAC12key_scheduleENSt3__14spanIKhLm18446744073709551615EEE:
   64|  17.7k|void HMAC::key_schedule(std::span<const uint8_t> key) {
   65|  17.7k|   const uint8_t ipad = 0x36;
   66|  17.7k|   const uint8_t opad = 0x5C;
   67|       |
   68|  17.7k|   m_hash->clear();
   69|       |
   70|  17.7k|   m_ikey.resize(m_hash_block_size);
   71|  17.7k|   m_okey.resize(m_hash_block_size);
   72|       |
   73|  17.7k|   clear_mem(m_ikey.data(), m_ikey.size());
   74|  17.7k|   clear_mem(m_okey.data(), m_okey.size());
   75|       |
   76|       |   /*
   77|       |   * Sometimes the HMAC key length itself is sensitive, as with PBKDF2 where it
   78|       |   * reveals the length of the passphrase. Make some attempt to hide this to
   79|       |   * side channels. Clearly if the secret is longer than the block size then the
   80|       |   * branch to hash first reveals that. In addition, counting the number of
   81|       |   * compression functions executed reveals the size at the granularity of the
   82|       |   * hash function's block size.
   83|       |   *
   84|       |   * The greater concern is for smaller keys; being able to detect when a
   85|       |   * passphrase is say 4 bytes may assist choosing weaker targets. Even though
   86|       |   * the loop bounds are constant, we can only actually read key[0..length] so
   87|       |   * it doesn't seem possible to make this computation truly constant time.
   88|       |   *
   89|       |   * We don't mind leaking if the length is exactly zero since that's
   90|       |   * trivial to simply check.
   91|       |   */
   92|       |
   93|  17.7k|   if(key.size() > m_hash_block_size) {
  ------------------
  |  Branch (93:7): [True: 0, False: 17.7k]
  ------------------
   94|      0|      m_hash->update(key);
   95|      0|      m_hash->final(m_ikey.data());
   96|  17.7k|   } else if(key.size() >= 20) {
  ------------------
  |  Branch (96:14): [True: 17.7k, False: 0]
  ------------------
   97|       |      // For long keys we just leak the length either it is a cryptovariable
   98|       |      // or a long enough password that just the length is not a useful signal
   99|  17.7k|      copy_mem(std::span{m_ikey}.first(key.size()), key);
  100|  17.7k|   } else if(!key.empty()) {
  ------------------
  |  Branch (100:14): [True: 0, False: 0]
  ------------------
  101|      0|      for(size_t i = 0, i_mod_length = 0; i != m_hash_block_size; ++i) {
  ------------------
  |  Branch (101:43): [True: 0, False: 0]
  ------------------
  102|       |         /*
  103|       |         access key[i % length] but avoiding division due to variable
  104|       |         time computation on some processors.
  105|       |         */
  106|      0|         auto needs_reduction = CT::Mask<size_t>::is_lte(key.size(), i_mod_length);
  107|      0|         i_mod_length = needs_reduction.select(0, i_mod_length);
  108|      0|         const uint8_t kb = key[i_mod_length];
  109|       |
  110|      0|         auto in_range = CT::Mask<size_t>::is_lt(i, key.size());
  111|      0|         m_ikey[i] = static_cast<uint8_t>(in_range.if_set_return(kb));
  112|      0|         i_mod_length += 1;
  113|      0|      }
  114|      0|   }
  115|       |
  116|  2.29M|   for(size_t i = 0; i != m_hash_block_size; ++i) {
  ------------------
  |  Branch (116:22): [True: 2.27M, False: 17.7k]
  ------------------
  117|  2.27M|      m_ikey[i] ^= ipad;
  118|  2.27M|      m_okey[i] = m_ikey[i] ^ ipad ^ opad;
  119|  2.27M|   }
  120|       |
  121|  17.7k|   m_hash->update(m_ikey);
  122|  17.7k|}
_ZN5Botan4HMACC2ENSt3__110unique_ptrINS_12HashFunctionENS1_14default_deleteIS3_EEEE:
  151|  4.44k|      m_hash(std::move(hash)),
  152|  4.44k|      m_hash_output_length(m_hash->output_length()),
  153|  4.44k|      m_hash_block_size(m_hash->hash_block_size()) {
  154|  4.44k|   BOTAN_ARG_CHECK(m_hash_output_length >= 8, "HMAC is not compatible with this hash function");
  ------------------
  |  |   35|  4.44k|   do {                                                          \
  |  |   36|  4.44k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */              \
  |  |   37|  4.44k|      if(!(expr)) {                                              \
  |  |  ------------------
  |  |  |  Branch (37:10): [True: 0, False: 4.44k]
  |  |  ------------------
  |  |   38|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */     \
  |  |   39|      0|         Botan::throw_invalid_argument(msg, __func__, __FILE__); \
  |  |   40|      0|      }                                                          \
  |  |   41|  4.44k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 4.44k]
  |  |  ------------------
  ------------------
  155|  4.44k|   BOTAN_ARG_CHECK(m_hash_block_size >= m_hash_output_length, "HMAC is not compatible with this hash function");
  ------------------
  |  |   35|  4.44k|   do {                                                          \
  |  |   36|  4.44k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */              \
  |  |   37|  4.44k|      if(!(expr)) {                                              \
  |  |  ------------------
  |  |  |  Branch (37:10): [True: 0, False: 4.44k]
  |  |  ------------------
  |  |   38|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */     \
  |  |   39|      0|         Botan::throw_invalid_argument(msg, __func__, __FILE__); \
  |  |   40|      0|      }                                                          \
  |  |   41|  4.44k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 4.44k]
  |  |  ------------------
  ------------------
  156|  4.44k|}

_ZN5Botan25MessageAuthenticationCode6createENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEES5_:
   51|  4.44k|                                                                             std::string_view provider) {
   52|  4.44k|   const SCAN_Name req(algo_spec);
   53|       |
   54|       |#if defined(BOTAN_HAS_BLAKE2BMAC)
   55|       |   if(req.algo_name() == "Blake2b" || req.algo_name() == "BLAKE2b") {
   56|       |      if(provider.empty() || provider == "base") {
   57|       |         return std::make_unique<BLAKE2bMAC>(req.arg_as_integer(0, 512));
   58|       |      }
   59|       |   }
   60|       |#endif
   61|       |
   62|       |#if defined(BOTAN_HAS_GMAC)
   63|       |   if(req.algo_name() == "GMAC" && req.arg_count() == 1) {
   64|       |      if(provider.empty() || provider == "base") {
   65|       |         if(auto bc = BlockCipher::create(req.arg(0))) {
   66|       |            return std::make_unique<GMAC>(std::move(bc));
   67|       |         }
   68|       |      }
   69|       |   }
   70|       |#endif
   71|       |
   72|  4.44k|#if defined(BOTAN_HAS_HMAC)
   73|  4.44k|   if(req.algo_name() == "HMAC" && req.arg_count() == 1) {
  ------------------
  |  Branch (73:7): [True: 4.44k, False: 0]
  |  Branch (73:36): [True: 4.44k, False: 0]
  ------------------
   74|  4.44k|      if(provider.empty() || provider == "base") {
  ------------------
  |  Branch (74:10): [True: 4.44k, False: 0]
  |  Branch (74:30): [True: 0, False: 0]
  ------------------
   75|  4.44k|         if(auto hash = HashFunction::create(req.arg(0))) {
  ------------------
  |  Branch (75:18): [True: 4.44k, False: 0]
  ------------------
   76|  4.44k|            return std::make_unique<HMAC>(std::move(hash));
   77|  4.44k|         }
   78|  4.44k|      }
   79|  4.44k|   }
   80|      0|#endif
   81|       |
   82|       |#if defined(BOTAN_HAS_POLY1305)
   83|       |   if(req.algo_name() == "Poly1305" && req.arg_count() == 0) {
   84|       |      if(provider.empty() || provider == "base") {
   85|       |         return std::make_unique<Poly1305>();
   86|       |      }
   87|       |   }
   88|       |#endif
   89|       |
   90|       |#if defined(BOTAN_HAS_SIPHASH)
   91|       |   if(req.algo_name() == "SipHash") {
   92|       |      if(provider.empty() || provider == "base") {
   93|       |         return std::make_unique<SipHash>(req.arg_as_integer(0, 2), req.arg_as_integer(1, 4));
   94|       |      }
   95|       |   }
   96|       |#endif
   97|       |
   98|      0|#if defined(BOTAN_HAS_CMAC)
   99|      0|   if((req.algo_name() == "CMAC" || req.algo_name() == "OMAC") && req.arg_count() == 1) {
  ------------------
  |  Branch (99:8): [True: 0, False: 0]
  |  Branch (99:37): [True: 0, False: 0]
  |  Branch (99:67): [True: 0, False: 0]
  ------------------
  100|      0|      if(provider.empty() || provider == "base") {
  ------------------
  |  Branch (100:10): [True: 0, False: 0]
  |  Branch (100:30): [True: 0, False: 0]
  ------------------
  101|      0|         if(auto bc = BlockCipher::create(req.arg(0))) {
  ------------------
  |  Branch (101:18): [True: 0, False: 0]
  ------------------
  102|      0|            return std::make_unique<CMAC>(std::move(bc));
  103|      0|         }
  104|      0|      }
  105|      0|   }
  106|      0|#endif
  107|       |
  108|       |#if defined(BOTAN_HAS_ANSI_X919_MAC)
  109|       |   if(req.algo_name() == "X9.19-MAC") {
  110|       |      if(provider.empty() || provider == "base") {
  111|       |         return std::make_unique<ANSI_X919_MAC>();
  112|       |      }
  113|       |   }
  114|       |#endif
  115|       |
  116|      0|#if defined(BOTAN_HAS_KMAC)
  117|      0|   if(req.algo_name() == "KMAC-128") {
  ------------------
  |  Branch (117:7): [True: 0, False: 0]
  ------------------
  118|      0|      if(provider.empty() || provider == "base") {
  ------------------
  |  Branch (118:10): [True: 0, False: 0]
  |  Branch (118:30): [True: 0, False: 0]
  ------------------
  119|      0|         if(req.arg_count() != 1) {
  ------------------
  |  Branch (119:13): [True: 0, False: 0]
  ------------------
  120|      0|            throw Invalid_Argument(
  121|      0|               "invalid algorithm specification for KMAC-128: need exactly one argument for output bit length");
  122|      0|         }
  123|      0|         return std::make_unique<KMAC128>(req.arg_as_integer(0));
  124|      0|      }
  125|      0|   }
  126|       |
  127|      0|   if(req.algo_name() == "KMAC-256") {
  ------------------
  |  Branch (127:7): [True: 0, False: 0]
  ------------------
  128|      0|      if(provider.empty() || provider == "base") {
  ------------------
  |  Branch (128:10): [True: 0, False: 0]
  |  Branch (128:30): [True: 0, False: 0]
  ------------------
  129|      0|         if(req.arg_count() != 1) {
  ------------------
  |  Branch (129:13): [True: 0, False: 0]
  ------------------
  130|      0|            throw Invalid_Argument(
  131|      0|               "invalid algorithm specification for KMAC-256: need exactly one argument for output bit length");
  132|      0|         }
  133|      0|         return std::make_unique<KMAC256>(req.arg_as_integer(0));
  134|      0|      }
  135|      0|   }
  136|      0|#endif
  137|       |
  138|      0|   BOTAN_UNUSED(req);
  ------------------
  |  |  144|      0|#define BOTAN_UNUSED Botan::ignore_params
  ------------------
  139|      0|   BOTAN_UNUSED(provider);
  ------------------
  |  |  144|      0|#define BOTAN_UNUSED Botan::ignore_params
  ------------------
  140|       |
  141|      0|   return nullptr;
  142|      0|}

_ZN5Botan14AutoSeeded_RNGD2Ev:
   46|  4.44k|AutoSeeded_RNG::~AutoSeeded_RNG() = default;
_ZN5Botan14AutoSeeded_RNGC2Em:
   68|  4.44k|AutoSeeded_RNG::AutoSeeded_RNG(size_t reseed_interval) {
   69|  4.44k|#if defined(BOTAN_HAS_SYSTEM_RNG)
   70|  4.44k|   m_rng = std::make_unique<HMAC_DRBG>(auto_rng_hmac(), system_rng(), reseed_interval);
   71|       |#elif defined(BOTAN_HAS_ENTROPY_SOURCE)
   72|       |   m_rng = std::make_unique<HMAC_DRBG>(auto_rng_hmac(), Entropy_Sources::global_sources(), reseed_interval);
   73|       |#else
   74|       |   BOTAN_UNUSED(reseed_interval);
   75|       |   throw Not_Implemented("AutoSeeded_RNG default constructor not available due to no RNG or entropy sources");
   76|       |#endif
   77|       |
   78|  4.44k|   force_reseed();
   79|  4.44k|}
_ZN5Botan14AutoSeeded_RNG12force_reseedEv:
   81|  4.44k|void AutoSeeded_RNG::force_reseed() {
   82|  4.44k|   m_rng->force_reseed();
   83|  4.44k|   m_rng->next_byte();
   84|       |
   85|  4.44k|   if(!m_rng->is_seeded()) {
  ------------------
  |  Branch (85:7): [True: 0, False: 4.44k]
  ------------------
   86|      0|      throw Internal_Error("AutoSeeded_RNG reseeding failed");
   87|      0|   }
   88|  4.44k|}
auto_rng.cpp:_ZN5Botan12_GLOBAL__N_113auto_rng_hmacEv:
   26|  4.44k|std::unique_ptr<MessageAuthenticationCode> auto_rng_hmac() {
   27|  4.44k|   const std::string possible_auto_rng_hmacs[] = {
   28|  4.44k|      "HMAC(SHA-512)",
   29|  4.44k|      "HMAC(SHA-256)",
   30|  4.44k|   };
   31|       |
   32|  4.44k|   for(const auto& hmac : possible_auto_rng_hmacs) {
  ------------------
  |  Branch (32:25): [True: 4.44k, False: 0]
  ------------------
   33|  4.44k|      if(auto mac = MessageAuthenticationCode::create(hmac)) {
  ------------------
  |  Branch (33:15): [True: 4.44k, False: 0]
  ------------------
   34|  4.44k|         return mac;
   35|  4.44k|      }
   36|  4.44k|   }
   37|       |
   38|       |   // This shouldn't happen since this module has a dependency on sha2_32
   39|      0|   throw Internal_Error("AutoSeeded_RNG: No usable HMAC hash found");
   40|  4.44k|}

_ZN5Botan9HMAC_DRBGD2Ev:
   60|  4.44k|HMAC_DRBG::~HMAC_DRBG() = default;
_ZN5Botan9HMAC_DRBGC2ENSt3__110unique_ptrINS_25MessageAuthenticationCodeENS1_14default_deleteIS3_EEEERNS_21RandomNumberGeneratorEmm:
   66|  4.44k|      Stateful_RNG(underlying_rng, reseed_interval),
   67|  4.44k|      m_mac(check_not_null(std::move(prf))),
   68|  4.44k|      m_max_number_of_bytes_per_request(max_number_of_bytes_per_request),
   69|  4.44k|      m_security_level(hmac_drbg_security_level(m_mac->output_length())) {
   70|  4.44k|   check_limits(reseed_interval, max_number_of_bytes_per_request);
   71|       |
   72|  4.44k|   clear();
   73|  4.44k|}
_ZN5Botan9HMAC_DRBG11clear_stateEv:
  116|  4.44k|void HMAC_DRBG::clear_state() {
  117|  4.44k|   if(m_V.empty()) {
  ------------------
  |  Branch (117:7): [True: 4.44k, False: 0]
  ------------------
  118|  4.44k|      const size_t output_length = m_mac->output_length();
  119|  4.44k|      m_V.resize(output_length);
  120|  4.44k|      m_T.resize(output_length);
  121|  4.44k|   }
  122|       |
  123|  4.44k|   std::fill(m_V.begin(), m_V.end(), 0x01);
  124|  4.44k|   m_mac->set_key(std::vector<uint8_t>(m_V.size(), 0x00));
  125|  4.44k|}
_ZN5Botan9HMAC_DRBG15generate_outputENSt3__14spanIhLm18446744073709551615EEENS2_IKhLm18446744073709551615EEE:
  135|  4.44k|void HMAC_DRBG::generate_output(std::span<uint8_t> output, std::span<const uint8_t> input) {
  136|       |   // This is an internal function, callers should have validated this beforehand
  137|  4.44k|   BOTAN_ASSERT_NOMSG(!output.empty());
  ------------------
  |  |   77|  4.44k|   do {                                                                     \
  |  |   78|  4.44k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   79|  4.44k|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (79:10): [True: 0, False: 4.44k]
  |  |  ------------------
  |  |   80|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   81|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   82|      0|      }                                                                     \
  |  |   83|  4.44k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (83:12): [Folded, False: 4.44k]
  |  |  ------------------
  ------------------
  138|       |
  139|  4.44k|   if(!input.empty()) {
  ------------------
  |  Branch (139:7): [True: 0, False: 4.44k]
  ------------------
  140|      0|      update(input);
  141|      0|   }
  142|       |
  143|  8.88k|   while(!output.empty()) {
  ------------------
  |  Branch (143:10): [True: 4.44k, False: 4.44k]
  ------------------
  144|  4.44k|      const size_t to_copy = std::min(output.size(), m_V.size());
  145|  4.44k|      m_mac->update(m_V);
  146|  4.44k|      m_mac->final(m_V);
  147|  4.44k|      copy_mem(output.data(), m_V.data(), to_copy);
  148|       |
  149|  4.44k|      output = output.subspan(to_copy);
  150|  4.44k|   }
  151|       |
  152|  4.44k|   update(input);
  153|  4.44k|}
_ZN5Botan9HMAC_DRBG6updateENSt3__14spanIKhLm18446744073709551615EEE:
  159|  8.88k|void HMAC_DRBG::update(std::span<const uint8_t> input) {
  160|  8.88k|   m_mac->update(m_V);
  161|  8.88k|   m_mac->update(0x00);
  162|  8.88k|   if(!input.empty()) {
  ------------------
  |  Branch (162:7): [True: 4.44k, False: 4.44k]
  ------------------
  163|  4.44k|      m_mac->update(input);
  164|  4.44k|   }
  165|  8.88k|   m_mac->final(m_T);
  166|  8.88k|   m_mac->set_key(m_T);
  167|       |
  168|  8.88k|   m_mac->update(m_V);
  169|  8.88k|   m_mac->final(m_V);
  170|       |
  171|  8.88k|   if(!input.empty()) {
  ------------------
  |  Branch (171:7): [True: 4.44k, False: 4.44k]
  ------------------
  172|  4.44k|      m_mac->update(m_V);
  173|  4.44k|      m_mac->update(0x01);
  174|  4.44k|      m_mac->update(input);
  175|  4.44k|      m_mac->final(m_T);
  176|  4.44k|      m_mac->set_key(m_T);
  177|       |
  178|  4.44k|      m_mac->update(m_V);
  179|  4.44k|      m_mac->final(m_V);
  180|  4.44k|   }
  181|  8.88k|}
_ZNK5Botan9HMAC_DRBG14security_levelEv:
  183|  13.3k|size_t HMAC_DRBG::security_level() const {
  184|  13.3k|   return m_security_level;
  185|  13.3k|}
hmac_drbg.cpp:_ZN5Botan12_GLOBAL__N_124hmac_drbg_security_levelEm:
   21|  4.44k|size_t hmac_drbg_security_level(size_t mac_output_length) {
   22|       |   // security strength of the hash function
   23|       |   // for pre-image resistance (see NIST SP 800-57)
   24|       |   // SHA-1: 128 bits
   25|       |   // SHA-224, SHA-512/224: 192 bits,
   26|       |   // SHA-256, SHA-512/256, SHA-384, SHA-512: >= 256 bits
   27|       |   // NIST SP 800-90A only supports up to 256 bits though
   28|       |
   29|  4.44k|   if(mac_output_length < 20) {
  ------------------
  |  Branch (29:7): [True: 0, False: 4.44k]
  ------------------
   30|      0|      throw Invalid_Argument(fmt("HMAC_DRBG MAC output length {} is too small", mac_output_length));
   31|      0|   }
   32|       |
   33|  4.44k|   if(mac_output_length < 32) {
  ------------------
  |  Branch (33:7): [True: 0, False: 4.44k]
  ------------------
   34|      0|      return (mac_output_length - 4) * 8;
   35|  4.44k|   } else {
   36|  4.44k|      return 32 * 8;
   37|  4.44k|   }
   38|  4.44k|}
hmac_drbg.cpp:_ZN5Botan12_GLOBAL__N_112check_limitsEmm:
   40|  4.44k|void check_limits(size_t reseed_interval, size_t max_number_of_bytes_per_request) {
   41|       |   // SP800-90A permits up to 2^48, but it is not usable on 32 bit
   42|       |   // platforms, so we only allow up to 2^24, which is still reasonably high
   43|  4.44k|   if(reseed_interval == 0 || reseed_interval > static_cast<size_t>(1) << 24) {
  ------------------
  |  Branch (43:7): [True: 0, False: 4.44k]
  |  Branch (43:31): [True: 0, False: 4.44k]
  ------------------
   44|      0|      throw Invalid_Argument("Invalid value for reseed_interval");
   45|      0|   }
   46|       |
   47|  4.44k|   if(max_number_of_bytes_per_request == 0 || max_number_of_bytes_per_request > 64 * 1024) {
  ------------------
  |  Branch (47:7): [True: 0, False: 4.44k]
  |  Branch (47:47): [True: 0, False: 4.44k]
  ------------------
   48|      0|      throw Invalid_Argument("Invalid value for max_number_of_bytes_per_request");
   49|      0|   }
   50|  4.44k|}
hmac_drbg.cpp:_ZN5Botan12_GLOBAL__N_114check_not_nullINS_25MessageAuthenticationCodeEEENSt3__110unique_ptrIT_NS3_14default_deleteIS5_EEEES8_:
   53|  4.44k|std::unique_ptr<T> check_not_null(std::unique_ptr<T> obj) {
   54|  4.44k|   BOTAN_ARG_CHECK(obj != nullptr, "Argument must not be null");
  ------------------
  |  |   35|  4.44k|   do {                                                          \
  |  |   36|  4.44k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */              \
  |  |   37|  4.44k|      if(!(expr)) {                                              \
  |  |  ------------------
  |  |  |  Branch (37:10): [True: 0, False: 4.44k]
  |  |  ------------------
  |  |   38|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */     \
  |  |   39|      0|         Botan::throw_invalid_argument(msg, __func__, __FILE__); \
  |  |   40|      0|      }                                                          \
  |  |   41|  4.44k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 4.44k]
  |  |  ------------------
  ------------------
   55|  4.44k|   return obj;
   56|  4.44k|}

_ZN5Botan21RandomNumberGenerator15reseed_from_rngERS0_m:
   65|  4.44k|void RandomNumberGenerator::reseed_from_rng(RandomNumberGenerator& rng, size_t poll_bits) {
   66|  4.44k|   if(this->accepts_input()) {
  ------------------
  |  Branch (66:7): [True: 4.44k, False: 0]
  ------------------
   67|  4.44k|      this->add_entropy(rng.random_vec(poll_bits / 8));
   68|  4.44k|   }
   69|  4.44k|}

_ZN5Botan12Stateful_RNG5clearEv:
   15|  4.44k|void Stateful_RNG::clear() {
   16|  4.44k|   const lock_guard_type<recursive_mutex_type> lock(m_mutex);
   17|  4.44k|   m_reseed_counter = 0;
   18|  4.44k|   m_last_pid = 0;
   19|  4.44k|   clear_state();
   20|  4.44k|}
_ZN5Botan12Stateful_RNG12force_reseedEv:
   22|  4.44k|void Stateful_RNG::force_reseed() {
   23|  4.44k|   const lock_guard_type<recursive_mutex_type> lock(m_mutex);
   24|  4.44k|   m_reseed_counter = 0;
   25|  4.44k|}
_ZNK5Botan12Stateful_RNG9is_seededEv:
   27|  13.3k|bool Stateful_RNG::is_seeded() const {
   28|  13.3k|   const lock_guard_type<recursive_mutex_type> lock(m_mutex);
   29|  13.3k|   return m_reseed_counter > 0;
   30|  13.3k|}
_ZN5Botan12Stateful_RNG23generate_batched_outputENSt3__14spanIhLm18446744073709551615EEENS2_IKhLm18446744073709551615EEE:
   39|  4.44k|void Stateful_RNG::generate_batched_output(std::span<uint8_t> output, std::span<const uint8_t> input) {
   40|  4.44k|   BOTAN_ASSERT_NOMSG(!output.empty());
  ------------------
  |  |   77|  4.44k|   do {                                                                     \
  |  |   78|  4.44k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   79|  4.44k|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (79:10): [True: 0, False: 4.44k]
  |  |  ------------------
  |  |   80|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   81|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   82|      0|      }                                                                     \
  |  |   83|  4.44k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (83:12): [Folded, False: 4.44k]
  |  |  ------------------
  ------------------
   41|       |
   42|  4.44k|   const size_t max_per_request = max_number_of_bytes_per_request();
   43|       |
   44|  4.44k|   if(max_per_request == 0) {
  ------------------
  |  Branch (44:7): [True: 0, False: 4.44k]
  ------------------
   45|       |      // no limit
   46|      0|      reseed_check();
   47|      0|      this->generate_output(output, input);
   48|  4.44k|   } else {
   49|  8.88k|      while(!output.empty()) {
  ------------------
  |  Branch (49:13): [True: 4.44k, False: 4.44k]
  ------------------
   50|  4.44k|         const size_t this_req = std::min(max_per_request, output.size());
   51|       |
   52|  4.44k|         reseed_check();
   53|  4.44k|         this->generate_output(output.subspan(0, this_req), input);
   54|       |
   55|       |         // only include the input for the first iteration
   56|  4.44k|         input = {};
   57|       |
   58|  4.44k|         output = output.subspan(this_req);
   59|  4.44k|      }
   60|  4.44k|   }
   61|  4.44k|}
_ZN5Botan12Stateful_RNG21fill_bytes_with_inputENSt3__14spanIhLm18446744073709551615EEENS2_IKhLm18446744073709551615EEE:
   63|  8.88k|void Stateful_RNG::fill_bytes_with_input(std::span<uint8_t> output, std::span<const uint8_t> input) {
   64|  8.88k|   const lock_guard_type<recursive_mutex_type> lock(m_mutex);
   65|       |
   66|  8.88k|   if(output.empty()) {
  ------------------
  |  Branch (66:7): [True: 4.44k, False: 4.44k]
  ------------------
   67|       |      // Special case for exclusively adding entropy to the stateful RNG.
   68|  4.44k|      this->update(input);
   69|       |
   70|  4.44k|      if(8 * input.size() >= security_level()) {
  ------------------
  |  Branch (70:10): [True: 4.44k, False: 0]
  ------------------
   71|  4.44k|         reset_reseed_counter();
   72|  4.44k|      }
   73|  4.44k|   } else {
   74|  4.44k|      generate_batched_output(output, input);
   75|  4.44k|   }
   76|  8.88k|}
_ZN5Botan12Stateful_RNG15reseed_from_rngERNS_21RandomNumberGeneratorEm:
   90|  4.44k|void Stateful_RNG::reseed_from_rng(RandomNumberGenerator& rng, size_t poll_bits) {
   91|  4.44k|   const lock_guard_type<recursive_mutex_type> lock(m_mutex);
   92|       |
   93|  4.44k|   RandomNumberGenerator::reseed_from_rng(rng, poll_bits);
   94|       |
   95|  4.44k|   if(poll_bits >= security_level()) {
  ------------------
  |  Branch (95:7): [True: 4.44k, False: 0]
  ------------------
   96|  4.44k|      reset_reseed_counter();
   97|  4.44k|   }
   98|  4.44k|}
_ZN5Botan12Stateful_RNG20reset_reseed_counterEv:
  100|  8.88k|void Stateful_RNG::reset_reseed_counter() {
  101|       |   // Lock is held whenever this function is called
  102|  8.88k|   m_reseed_counter = 1;
  103|  8.88k|   m_last_pid = OS::get_process_id();
  104|  8.88k|}
_ZN5Botan12Stateful_RNG12reseed_checkEv:
  106|  4.44k|void Stateful_RNG::reseed_check() {
  107|       |   // Lock is held whenever this function is called
  108|       |
  109|  4.44k|   const uint32_t cur_pid = OS::get_process_id();
  110|       |
  111|  4.44k|   const bool fork_detected = (m_last_pid > 0) && (cur_pid != m_last_pid);
  ------------------
  |  Branch (111:31): [True: 0, False: 4.44k]
  |  Branch (111:51): [True: 0, False: 0]
  ------------------
  112|       |
  113|  4.44k|   if(is_seeded() == false || fork_detected || (m_reseed_interval > 0 && m_reseed_counter >= m_reseed_interval)) {
  ------------------
  |  Branch (113:7): [True: 4.44k, False: 0]
  |  Branch (113:31): [True: 0, False: 0]
  |  Branch (113:49): [True: 0, False: 0]
  |  Branch (113:74): [True: 0, False: 0]
  ------------------
  114|  4.44k|      m_reseed_counter = 0;
  115|  4.44k|      m_last_pid = cur_pid;
  116|       |
  117|  4.44k|      if(m_underlying_rng != nullptr) {
  ------------------
  |  Branch (117:10): [True: 4.44k, False: 0]
  ------------------
  118|  4.44k|         reseed_from_rng(*m_underlying_rng, security_level());
  119|  4.44k|      }
  120|       |
  121|  4.44k|      if(m_entropy_sources != nullptr) {
  ------------------
  |  Branch (121:10): [True: 0, False: 4.44k]
  ------------------
  122|      0|         reseed_from_sources(*m_entropy_sources, security_level());
  123|      0|      }
  124|       |
  125|  4.44k|      if(!is_seeded()) {
  ------------------
  |  Branch (125:10): [True: 0, False: 4.44k]
  ------------------
  126|      0|         if(fork_detected) {
  ------------------
  |  Branch (126:13): [True: 0, False: 0]
  ------------------
  127|      0|            throw Invalid_State("Detected use of fork but cannot reseed DRBG");
  128|      0|         } else {
  129|      0|            throw PRNG_Unseeded(name());
  130|      0|         }
  131|      0|      }
  132|  4.44k|   } else {
  133|      0|      BOTAN_ASSERT(m_reseed_counter != 0, "RNG is seeded");
  ------------------
  |  |   64|      0|   do {                                                                                 \
  |  |   65|      0|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                                     \
  |  |   66|      0|      if(!(expr)) {                                                                     \
  |  |  ------------------
  |  |  |  Branch (66:10): [True: 0, False: 0]
  |  |  ------------------
  |  |   67|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                            \
  |  |   68|      0|         Botan::assertion_failure(#expr, assertion_made, __func__, __FILE__, __LINE__); \
  |  |   69|      0|      }                                                                                 \
  |  |   70|      0|   } while(0)
  |  |  ------------------
  |  |  |  Branch (70:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
  134|      0|      m_reseed_counter += 1;
  135|      0|   }
  136|  4.44k|}

_ZN5Botan10system_rngEv:
  377|  4.44k|RandomNumberGenerator& system_rng() {
  378|  4.44k|   static System_RNG_Impl g_system_rng;
  379|  4.44k|   return g_system_rng;
  380|  4.44k|}
system_rng.cpp:_ZN5Botan12_GLOBAL__N_115System_RNG_Impl21fill_bytes_with_inputENSt3__14spanIhLm18446744073709551615EEENS3_IKhLm18446744073709551615EEE:
  215|  4.44k|      void fill_bytes_with_input(std::span<uint8_t> output, std::span<const uint8_t> /* ignored */) override {
  216|  4.44k|         const unsigned int flags = 0;
  217|       |
  218|  4.44k|         uint8_t* buf = output.data();
  219|  4.44k|         size_t len = output.size();
  220|  8.88k|         while(len > 0) {
  ------------------
  |  Branch (220:16): [True: 4.44k, False: 4.44k]
  ------------------
  221|       |   #if defined(__GLIBC__) && __GLIBC__ == 2 && __GLIBC_MINOR__ < 25
  222|       |            const ssize_t got = ::syscall(SYS_getrandom, buf, len, flags);
  223|       |   #else
  224|  4.44k|            const ssize_t got = ::getrandom(buf, len, flags);
  225|  4.44k|   #endif
  226|       |
  227|  4.44k|            if(got < 0) {
  ------------------
  |  Branch (227:16): [True: 0, False: 4.44k]
  ------------------
  228|      0|               if(errno == EINTR) {
  ------------------
  |  Branch (228:19): [True: 0, False: 0]
  ------------------
  229|      0|                  continue;
  230|      0|               }
  231|      0|               throw System_Error("System_RNG getrandom failed", errno);
  232|      0|            }
  233|       |
  234|  4.44k|            if(got == 0) {
  ------------------
  |  Branch (234:16): [True: 0, False: 4.44k]
  ------------------
  235|      0|               throw System_Error("System_RNG getrandom unexpectedly returned 0");
  236|      0|            }
  237|       |
  238|  4.44k|            buf += got;
  239|  4.44k|            len -= got;
  240|  4.44k|         }
  241|  4.44k|      }

_ZN5Botan15allocate_memoryEmm:
   21|  26.6k|BOTAN_MALLOC_FN void* allocate_memory(size_t elems, size_t elem_size) {
   22|  26.6k|   if(elems == 0 || elem_size == 0) {
  ------------------
  |  Branch (22:7): [True: 0, False: 26.6k]
  |  Branch (22:21): [True: 0, False: 26.6k]
  ------------------
   23|      0|      return nullptr;
   24|      0|   }
   25|       |
   26|       |   // Some calloc implementations do not check for overflow (?!?)
   27|  26.6k|   if(!checked_mul(elems, elem_size).has_value()) {
  ------------------
  |  Branch (27:7): [True: 0, False: 26.6k]
  ------------------
   28|      0|      throw std::bad_alloc();
   29|      0|   }
   30|       |
   31|       |#if defined(BOTAN_HAS_LOCKING_ALLOCATOR)
   32|       |   // NOLINTNEXTLINE(*-const-correctness) bug in clang-tidy
   33|       |   if(void* p = mlock_allocator::instance().allocate(elems, elem_size)) {
   34|       |      return p;
   35|       |   }
   36|       |#endif
   37|       |
   38|       |#if defined(BOTAN_TARGET_OS_HAS_ALLOC_CONCEAL)
   39|       |   void* ptr = ::calloc_conceal(elems, elem_size);
   40|       |#else
   41|       |   // NOLINTNEXTLINE(*-const-correctness) bug in clang-tidy
   42|  26.6k|   void* ptr = std::calloc(elems, elem_size);  // NOLINT(*-no-malloc,*-owning-memory)
   43|  26.6k|#endif
   44|  26.6k|   if(ptr == nullptr) {
  ------------------
  |  Branch (44:7): [True: 0, False: 26.6k]
  ------------------
   45|      0|      [[unlikely]] throw std::bad_alloc();
   46|      0|   }
   47|  26.6k|   return ptr;
   48|  26.6k|}
_ZN5Botan17deallocate_memoryEPvmm:
   50|  26.6k|void deallocate_memory(void* p, size_t elems, size_t elem_size) {
   51|  26.6k|   if(p == nullptr) {
  ------------------
  |  Branch (51:7): [True: 0, False: 26.6k]
  ------------------
   52|      0|      [[unlikely]] return;
   53|      0|   }
   54|       |
   55|  26.6k|   secure_scrub_memory(p, elems * elem_size);
   56|       |
   57|       |#if defined(BOTAN_HAS_LOCKING_ALLOCATOR)
   58|       |   if(mlock_allocator::instance().deallocate(p, elems, elem_size)) {
   59|       |      return;
   60|       |   }
   61|       |#endif
   62|       |
   63|  26.6k|   std::free(p);  // NOLINT(*-no-malloc,*-owning-memory)
   64|  26.6k|}

_ZN5Botan19secure_scrub_memoryEPvm:
   25|  1.27M|void secure_scrub_memory(void* ptr, size_t n) {
   26|  1.27M|   return secure_zeroize_buffer(ptr, n);
   27|  1.27M|}
_ZN5Botan21secure_zeroize_bufferEPvm:
   29|  1.28M|void secure_zeroize_buffer(void* ptr, size_t n) {
   30|  1.28M|   if(n == 0) {
  ------------------
  |  Branch (30:7): [True: 0, False: 1.28M]
  ------------------
   31|      0|      return;
   32|      0|   }
   33|       |
   34|       |#if defined(BOTAN_TARGET_OS_HAS_RTLSECUREZEROMEMORY)
   35|       |   ::RtlSecureZeroMemory(ptr, n);
   36|       |
   37|       |#elif defined(BOTAN_TARGET_OS_HAS_EXPLICIT_BZERO)
   38|  1.28M|   ::explicit_bzero(ptr, n);
   39|       |
   40|       |#elif defined(BOTAN_TARGET_OS_HAS_EXPLICIT_MEMSET)
   41|       |   (void)::explicit_memset(ptr, 0, n);
   42|       |
   43|       |#else
   44|       |   /*
   45|       |   * Call memset through a static volatile pointer, which the compiler should
   46|       |   * not elide. This construct should be safe in conforming compilers, but who
   47|       |   * knows. This has been checked to generate the expected code, which saves the
   48|       |   * memset address in the data segment and unconditionally loads and jumps to
   49|       |   * that address, with the following targets:
   50|       |   *
   51|       |   * x86-64: Clang 19, GCC 6, 11, 13, 14
   52|       |   * riscv64: GCC 14
   53|       |   * aarch64: GCC 14
   54|       |   * armv7: GCC 14
   55|       |   *
   56|       |   * Actually all of them generated the expected jump even without marking the
   57|       |   * function pointer as volatile. However this seems worth including as an
   58|       |   * additional precaution.
   59|       |   */
   60|       |   static void* (*const volatile memset_ptr)(void*, int, size_t) = std::memset;
   61|       |   (memset_ptr)(ptr, 0, n);
   62|       |#endif
   63|  1.28M|}

_ZN5Botan2OS14get_process_idEv:
   77|  13.3k|uint32_t OS::get_process_id() {
   78|  13.3k|#if defined(BOTAN_TARGET_OS_HAS_POSIX1)
   79|  13.3k|   return ::getpid();
   80|       |#elif defined(BOTAN_TARGET_OS_HAS_WIN32)
   81|       |   return ::GetCurrentProcessId();
   82|       |#elif defined(BOTAN_TARGET_OS_IS_LLVM) || defined(BOTAN_TARGET_OS_IS_NONE)
   83|       |   return 0;  // truly no meaningful value
   84|       |#else
   85|       |   #error "Missing get_process_id"
   86|       |#endif
   87|  13.3k|}

_ZN5Botan9SCAN_NameC2ENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
   61|  4.44k|SCAN_Name::SCAN_Name(std::string_view algo_spec) : m_orig_algo_spec(algo_spec) {
   62|  4.44k|   if(algo_spec.empty()) {
  ------------------
  |  Branch (62:7): [True: 0, False: 4.44k]
  ------------------
   63|      0|      throw Invalid_Argument("Expected algorithm name, got empty string");
   64|      0|   }
   65|       |
   66|       |   // Fast path for a bare name with no arguments or modes (eg "SHA-256"),
   67|       |   // which is the common case. Equivalent to the general parse below, which
   68|       |   // for such input produces a single token and no args/modes.
   69|  4.44k|   if(algo_spec.find_first_of("(),/") == std::string_view::npos) {
  ------------------
  |  Branch (69:7): [True: 0, False: 4.44k]
  ------------------
   70|      0|      m_alg_name = std::string(algo_spec);
   71|      0|      return;
   72|      0|   }
   73|       |
   74|  4.44k|   std::vector<std::pair<size_t, std::string>> name;
   75|  4.44k|   size_t level = 0;
   76|  4.44k|   std::pair<size_t, std::string> accum = std::make_pair(level, "");
   77|       |
   78|  4.44k|   bool expect_token = true;
   79|       |
   80|  57.7k|   for(const char c : algo_spec) {
  ------------------
  |  Branch (80:21): [True: 57.7k, False: 4.44k]
  ------------------
   81|  57.7k|      if(c == '/' || c == ',' || c == '(' || c == ')') {
  ------------------
  |  Branch (81:10): [True: 0, False: 57.7k]
  |  Branch (81:22): [True: 0, False: 57.7k]
  |  Branch (81:34): [True: 4.44k, False: 53.3k]
  |  Branch (81:46): [True: 4.44k, False: 48.8k]
  ------------------
   82|  8.88k|         if(c == '(') {
  ------------------
  |  Branch (82:13): [True: 4.44k, False: 4.44k]
  ------------------
   83|  4.44k|            ++level;
   84|  4.44k|         } else if(c == ')') {
  ------------------
  |  Branch (84:20): [True: 4.44k, False: 0]
  ------------------
   85|  4.44k|            if(level == 0) {
  ------------------
  |  Branch (85:16): [True: 0, False: 4.44k]
  ------------------
   86|      0|               throw Invalid_Algorithm_Name(m_orig_algo_spec);
   87|      0|            }
   88|  4.44k|            --level;
   89|  4.44k|         }
   90|       |
   91|  8.88k|         if(c == '/' && level > 0) {
  ------------------
  |  Branch (91:13): [True: 0, False: 8.88k]
  |  Branch (91:25): [True: 0, False: 0]
  ------------------
   92|      0|            accum.second.push_back(c);
   93|      0|            expect_token = false;
   94|  8.88k|         } else {
   95|  8.88k|            if(expect_token) {
  ------------------
  |  Branch (95:16): [True: 0, False: 8.88k]
  ------------------
   96|      0|               throw Invalid_Algorithm_Name(m_orig_algo_spec);
   97|      0|            }
   98|  8.88k|            if(!accum.second.empty()) {
  ------------------
  |  Branch (98:16): [True: 8.88k, False: 0]
  ------------------
   99|  8.88k|               name.push_back(accum);
  100|  8.88k|            }
  101|  8.88k|            accum = std::make_pair(level, "");
  102|  8.88k|            expect_token = (c != ')');
  103|  8.88k|         }
  104|  48.8k|      } else {
  105|  48.8k|         accum.second.push_back(c);
  106|  48.8k|         expect_token = false;
  107|  48.8k|      }
  108|  57.7k|   }
  109|       |
  110|  4.44k|   if(!accum.second.empty()) {
  ------------------
  |  Branch (110:7): [True: 0, False: 4.44k]
  ------------------
  111|      0|      name.push_back(accum);
  112|      0|   }
  113|       |
  114|  4.44k|   if(level != 0) {
  ------------------
  |  Branch (114:7): [True: 0, False: 4.44k]
  ------------------
  115|      0|      throw Invalid_Algorithm_Name(m_orig_algo_spec);
  116|      0|   }
  117|       |
  118|  4.44k|   if(expect_token) {
  ------------------
  |  Branch (118:7): [True: 0, False: 4.44k]
  ------------------
  119|       |      // A trailing separator with no following token, eg "Foo/" or "Foo,"
  120|      0|      throw Invalid_Algorithm_Name(m_orig_algo_spec);
  121|      0|   }
  122|       |
  123|  4.44k|   if(name.empty()) {
  ------------------
  |  Branch (123:7): [True: 0, False: 4.44k]
  ------------------
  124|      0|      throw Invalid_Algorithm_Name(m_orig_algo_spec);
  125|      0|   }
  126|       |
  127|  4.44k|   m_alg_name = name[0].second;
  128|       |
  129|  4.44k|   bool in_modes = false;
  130|       |
  131|  8.88k|   for(size_t i = 1; i != name.size(); ++i) {
  ------------------
  |  Branch (131:22): [True: 4.44k, False: 4.44k]
  ------------------
  132|  4.44k|      if(name[i].first == 0) {
  ------------------
  |  Branch (132:10): [True: 0, False: 4.44k]
  ------------------
  133|      0|         m_mode_info.push_back(make_arg(name, i));
  134|      0|         in_modes = true;
  135|  4.44k|      } else if(name[i].first == 1 && !in_modes) {
  ------------------
  |  Branch (135:17): [True: 4.44k, False: 0]
  |  Branch (135:39): [True: 4.44k, False: 0]
  ------------------
  136|  4.44k|         m_args.push_back(make_arg(name, i));
  137|  4.44k|      }
  138|  4.44k|   }
  139|  4.44k|}
_ZNK5Botan9SCAN_Name3argEm:
  141|  4.44k|std::string SCAN_Name::arg(size_t i) const {
  142|  4.44k|   if(i >= arg_count()) {
  ------------------
  |  Branch (142:7): [True: 0, False: 4.44k]
  ------------------
  143|      0|      throw Invalid_Argument("SCAN_Name::arg " + std::to_string(i) + " out of range for '" + to_string() + "'");
  144|      0|   }
  145|  4.44k|   return m_args[i];
  146|  4.44k|}
scan_name.cpp:_ZN5Botan12_GLOBAL__N_18make_argERKNSt3__16vectorINS1_4pairImNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEEENS7_ISA_EEEEm:
   18|  4.44k|std::string make_arg(const std::vector<std::pair<size_t, std::string>>& name, size_t start) {
   19|  4.44k|   std::string output = name[start].second;
   20|  4.44k|   size_t level = name[start].first;
   21|       |
   22|  4.44k|   size_t paren_depth = 0;
   23|       |
   24|  4.44k|   for(size_t i = start + 1; i != name.size(); ++i) {
  ------------------
  |  Branch (24:30): [True: 0, False: 4.44k]
  ------------------
   25|      0|      if(name[i].first <= name[start].first) {
  ------------------
  |  Branch (25:10): [True: 0, False: 0]
  ------------------
   26|      0|         break;
   27|      0|      }
   28|       |
   29|      0|      if(name[i].first > level) {
  ------------------
  |  Branch (29:10): [True: 0, False: 0]
  ------------------
   30|      0|         for(size_t j = level; j < name[i].first; j++) {
  ------------------
  |  Branch (30:32): [True: 0, False: 0]
  ------------------
   31|      0|            output += "(";
   32|      0|            ++paren_depth;
   33|      0|         }
   34|      0|         output += name[i].second;
   35|      0|      } else if(name[i].first < level) {
  ------------------
  |  Branch (35:17): [True: 0, False: 0]
  ------------------
   36|      0|         for(size_t j = name[i].first; j < level; j++) {
  ------------------
  |  Branch (36:40): [True: 0, False: 0]
  ------------------
   37|      0|            output += ")";
   38|      0|            BOTAN_ASSERT_NOMSG(paren_depth != 0);
  ------------------
  |  |   77|      0|   do {                                                                     \
  |  |   78|      0|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   79|      0|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (79:10): [True: 0, False: 0]
  |  |  ------------------
  |  |   80|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   81|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   82|      0|      }                                                                     \
  |  |   83|      0|   } while(0)
  |  |  ------------------
  |  |  |  Branch (83:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
   39|      0|            --paren_depth;
   40|      0|         }
   41|      0|         output += "," + name[i].second;
   42|      0|      } else {
   43|      0|         if(output[output.size() - 1] != '(') {
  ------------------
  |  Branch (43:13): [True: 0, False: 0]
  ------------------
   44|      0|            output += ",";
   45|      0|         }
   46|      0|         output += name[i].second;
   47|      0|      }
   48|       |
   49|      0|      level = name[i].first;
   50|      0|   }
   51|       |
   52|  4.44k|   for(size_t i = 0; i != paren_depth; ++i) {
  ------------------
  |  Branch (52:22): [True: 0, False: 4.44k]
  ------------------
   53|      0|      output += ")";
   54|      0|   }
   55|       |
   56|  4.44k|   return output;
   57|  4.44k|}

_ZN3rnp13is_blank_lineEPKcm:
   71|  74.9k|{
   72|  81.1k|    for (size_t i = 0; i < len && line[i]; i++) {
  ------------------
  |  Branch (72:24): [True: 81.1k, False: 0]
  |  Branch (72:35): [True: 81.1k, False: 0]
  ------------------
   73|  81.1k|        if (line[i] != ' ' && line[i] != '\t' && line[i] != '\r') {
  ------------------
  |  Branch (73:13): [True: 75.9k, False: 5.22k]
  |  Branch (73:31): [True: 75.3k, False: 605]
  |  Branch (73:50): [True: 74.9k, False: 427]
  ------------------
   74|  74.9k|            return false;
   75|  74.9k|        }
   76|  81.1k|    }
   77|      0|    return true;
   78|  74.9k|}

LLVMFuzzerTestOneInput:
   37|  4.44k|{
   38|  4.44k|    rnp_input_t input = NULL;
   39|  4.44k|    rnp_ffi_t   ffi = NULL;
   40|       |
   41|  4.44k|    (void) rnp_input_from_memory(&input, data, size, false);
   42|  4.44k|    (void) rnp_ffi_create(&ffi, "GPG", "GPG");
   43|  4.44k|    char *results = NULL;
   44|  4.44k|    (void) rnp_import_signatures(ffi, input, 0, &results);
   45|  4.44k|    rnp_buffer_destroy(results);
   46|  4.44k|    rnp_input_destroy(input);
   47|  4.44k|    rnp_ffi_destroy(ffi);
   48|       |
   49|  4.44k|    return 0;
   50|  4.44k|}

_ZN3rnp12backend_initEPPv:
  192|  4.44k|{
  193|  4.44k|    return true;
  194|  4.44k|}
_ZN3rnp14backend_finishEPv:
  198|  4.44k|{
  199|       |    // Do nothing
  200|  4.44k|}

_Z24dilithium_signature_size21dilithium_parameter_e:
   83|    515|{
   84|    515|    switch (parameter) {
   85|    150|    case dilithium_L3:
  ------------------
  |  Branch (85:5): [True: 150, False: 365]
  ------------------
   86|    150|        return 3309;
   87|    365|    case dilithium_L5:
  ------------------
  |  Branch (87:5): [True: 365, False: 150]
  ------------------
   88|    365|        return 4627;
   89|      0|    default:
  ------------------
  |  Branch (89:5): [True: 0, False: 515]
  ------------------
   90|      0|        RNP_LOG("invalid parameter given");
  ------------------
  |  |   84|      0|#define RNP_LOG(...) RNP_LOG_FD(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   76|      0|    do {                                                                                 \
  |  |  |  |   77|      0|        if (!rnp_log_switch())                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   78|      0|            break;                                                                       \
  |  |  |  |   79|      0|        (void) fprintf((fd), "[%s() %s:%d] ", __func__, __SOURCE_PATH_FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define __SOURCE_PATH_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        (void) fprintf((fd), __VA_ARGS__);                                               \
  |  |  |  |   81|      0|        (void) fprintf((fd), "\n");                                                      \
  |  |  |  |   82|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   91|      0|        throw rnp::rnp_exception(RNP_ERROR_BAD_PARAMETERS);
   92|    515|    }
   93|    515|}

_ZN35pgp_dilithium_exdsa_composite_key_t26exdsa_curve_signature_sizeE11pgp_curve_t:
  117|    515|{
  118|    515|    switch (curve) {
  119|     59|    case PGP_CURVE_ED25519:
  ------------------
  |  Branch (119:5): [True: 59, False: 456]
  ------------------
  120|     59|        return 64;
  121|     25|    case PGP_CURVE_ED448:
  ------------------
  |  Branch (121:5): [True: 25, False: 490]
  ------------------
  122|     25|        return 114;
  123|     35|    case PGP_CURVE_NIST_P_384:
  ------------------
  |  Branch (123:5): [True: 35, False: 480]
  ------------------
  124|     35|        return 96;
  125|    166|    case PGP_CURVE_NIST_P_521:
  ------------------
  |  Branch (125:5): [True: 166, False: 349]
  ------------------
  126|    166|        return 132;
  127|     56|    case PGP_CURVE_BP384:
  ------------------
  |  Branch (127:5): [True: 56, False: 459]
  ------------------
  128|     56|        return 96;
  129|    174|    case PGP_CURVE_BP512:
  ------------------
  |  Branch (129:5): [True: 174, False: 341]
  ------------------
  130|    174|        return 128;
  131|      0|    default:
  ------------------
  |  Branch (131:5): [True: 0, False: 515]
  ------------------
  132|      0|        RNP_LOG("invalid curve given");
  ------------------
  |  |   84|      0|#define RNP_LOG(...) RNP_LOG_FD(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   76|      0|    do {                                                                                 \
  |  |  |  |   77|      0|        if (!rnp_log_switch())                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   78|      0|            break;                                                                       \
  |  |  |  |   79|      0|        (void) fprintf((fd), "[%s() %s:%d] ", __func__, __SOURCE_PATH_FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define __SOURCE_PATH_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        (void) fprintf((fd), __VA_ARGS__);                                               \
  |  |  |  |   81|      0|        (void) fprintf((fd), "\n");                                                      \
  |  |  |  |   82|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  133|      0|        throw rnp::rnp_exception(RNP_ERROR_BAD_PARAMETERS);
  134|    515|    }
  135|    515|}
_ZN35pgp_dilithium_exdsa_composite_key_t22pk_alg_to_dilithium_idE16pgp_pubkey_alg_t:
  139|    515|{
  140|    515|    switch (pk_alg) {
  141|     59|    case PGP_PKA_DILITHIUM3_ED25519:
  ------------------
  |  Branch (141:5): [True: 59, False: 456]
  ------------------
  142|     59|        FALLTHROUGH_STATEMENT;
  ------------------
  |  |  109|     59|# define FALLTHROUGH_STATEMENT [[fallthrough]]
  ------------------
  143|     94|    case PGP_PKA_DILITHIUM3_P384:
  ------------------
  |  Branch (143:5): [True: 35, False: 480]
  ------------------
  144|     94|        FALLTHROUGH_STATEMENT;
  ------------------
  |  |  109|     94|# define FALLTHROUGH_STATEMENT [[fallthrough]]
  ------------------
  145|    150|    case PGP_PKA_DILITHIUM3_BP384:
  ------------------
  |  Branch (145:5): [True: 56, False: 459]
  ------------------
  146|    150|        return dilithium_L3;
  147|    174|    case PGP_PKA_DILITHIUM5_BP512:
  ------------------
  |  Branch (147:5): [True: 174, False: 341]
  ------------------
  148|    174|        FALLTHROUGH_STATEMENT;
  ------------------
  |  |  109|    174|# define FALLTHROUGH_STATEMENT [[fallthrough]]
  ------------------
  149|    340|    case PGP_PKA_DILITHIUM5_P521:
  ------------------
  |  Branch (149:5): [True: 166, False: 349]
  ------------------
  150|    340|        FALLTHROUGH_STATEMENT;
  ------------------
  |  |  109|    340|# define FALLTHROUGH_STATEMENT [[fallthrough]]
  ------------------
  151|    365|    case PGP_PKA_DILITHIUM5_ED448:
  ------------------
  |  Branch (151:5): [True: 25, False: 490]
  ------------------
  152|    365|        return dilithium_L5;
  153|      0|    default:
  ------------------
  |  Branch (153:5): [True: 0, False: 515]
  ------------------
  154|      0|        RNP_LOG("invalid PK alg given");
  ------------------
  |  |   84|      0|#define RNP_LOG(...) RNP_LOG_FD(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   76|      0|    do {                                                                                 \
  |  |  |  |   77|      0|        if (!rnp_log_switch())                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   78|      0|            break;                                                                       \
  |  |  |  |   79|      0|        (void) fprintf((fd), "[%s() %s:%d] ", __func__, __SOURCE_PATH_FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define __SOURCE_PATH_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        (void) fprintf((fd), __VA_ARGS__);                                               \
  |  |  |  |   81|      0|        (void) fprintf((fd), "\n");                                                      \
  |  |  |  |   82|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  155|      0|        throw rnp::rnp_exception(RNP_ERROR_BAD_PARAMETERS);
  156|    515|    }
  157|    515|}
_ZN35pgp_dilithium_exdsa_composite_key_t18pk_alg_to_curve_idE16pgp_pubkey_alg_t:
  161|    515|{
  162|    515|    switch (pk_alg) {
  163|     59|    case PGP_PKA_DILITHIUM3_ED25519:
  ------------------
  |  Branch (163:5): [True: 59, False: 456]
  ------------------
  164|     59|        return PGP_CURVE_ED25519;
  165|     35|    case PGP_PKA_DILITHIUM3_P384:
  ------------------
  |  Branch (165:5): [True: 35, False: 480]
  ------------------
  166|     35|        return PGP_CURVE_NIST_P_384;
  167|     56|    case PGP_PKA_DILITHIUM3_BP384:
  ------------------
  |  Branch (167:5): [True: 56, False: 459]
  ------------------
  168|     56|        return PGP_CURVE_BP384;
  169|    174|    case PGP_PKA_DILITHIUM5_BP512:
  ------------------
  |  Branch (169:5): [True: 174, False: 341]
  ------------------
  170|    174|        return PGP_CURVE_BP512;
  171|    166|    case PGP_PKA_DILITHIUM5_P521:
  ------------------
  |  Branch (171:5): [True: 166, False: 349]
  ------------------
  172|    166|        return PGP_CURVE_NIST_P_521;
  173|     25|    case PGP_PKA_DILITHIUM5_ED448:
  ------------------
  |  Branch (173:5): [True: 25, False: 490]
  ------------------
  174|     25|        return PGP_CURVE_ED448;
  175|      0|    default:
  ------------------
  |  Branch (175:5): [True: 0, False: 515]
  ------------------
  176|      0|        RNP_LOG("invalid PK alg given");
  ------------------
  |  |   84|      0|#define RNP_LOG(...) RNP_LOG_FD(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   76|      0|    do {                                                                                 \
  |  |  |  |   77|      0|        if (!rnp_log_switch())                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   78|      0|            break;                                                                       \
  |  |  |  |   79|      0|        (void) fprintf((fd), "[%s() %s:%d] ", __func__, __SOURCE_PATH_FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define __SOURCE_PATH_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        (void) fprintf((fd), __VA_ARGS__);                                               \
  |  |  |  |   81|      0|        (void) fprintf((fd), "\n");                                                      \
  |  |  |  |   82|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  177|      0|        throw rnp::rnp_exception(RNP_ERROR_BAD_PARAMETERS);
  178|    515|    }
  179|    515|}

_ZN31pgp_dilithium_exdsa_signature_t24composite_signature_sizeE16pgp_pubkey_alg_t:
   72|    515|    {
   73|    515|        return dilithium_signature_size(
   74|    515|                 pgp_dilithium_exdsa_composite_key_t::pk_alg_to_dilithium_id(pk_alg)) +
   75|    515|               pgp_dilithium_exdsa_composite_key_t::exdsa_curve_signature_size(
   76|    515|                 pgp_dilithium_exdsa_composite_key_t::pk_alg_to_curve_id(pk_alg));
   77|    515|    }

_ZNK3pgp2ec5Curve5bytesEv:
  102|  1.48k|    {
  103|       |        return BITS_TO_BYTES(bitlen);
  ------------------
  |  |   56|  1.48k|#define BITS_TO_BYTES(b) (((b) + (CHAR_BIT - 1)) / CHAR_BIT)
  ------------------
  104|  1.48k|    }

_ZN3pgp2ec5Curve3getE11pgp_curve_t:
  322|  1.48k|{
  323|  1.48k|    return (curve_id < PGP_CURVE_MAX && curve_id > 0) ? &ec_curves[curve_id] : NULL;
  ------------------
  |  Branch (323:13): [True: 1.48k, False: 0]
  |  Branch (323:41): [True: 1.48k, False: 0]
  ------------------
  324|  1.48k|}

_ZN3rnp11CRC24_BotanC2Ev:
  129|  43.9k|{
  130|  43.9k|    if (botan_hash_init(&fn_, "CRC24", 0)) {
  ------------------
  |  Branch (130:9): [True: 0, False: 43.9k]
  ------------------
  131|      0|        RNP_LOG("Error creating CRC24 object");
  ------------------
  |  |   84|      0|#define RNP_LOG(...) RNP_LOG_FD(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   76|      0|    do {                                                                                 \
  |  |  |  |   77|      0|        if (!rnp_log_switch())                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   78|      0|            break;                                                                       \
  |  |  |  |   79|      0|        (void) fprintf((fd), "[%s() %s:%d] ", __func__, __SOURCE_PATH_FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define __SOURCE_PATH_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        (void) fprintf((fd), __VA_ARGS__);                                               \
  |  |  |  |   81|      0|        (void) fprintf((fd), "\n");                                                      \
  |  |  |  |   82|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  132|      0|        fn_ = nullptr;
  133|      0|        throw rnp_exception(RNP_ERROR_BAD_PARAMETERS);
  134|      0|    }
  135|  43.9k|    size_t outlen = 0;
  136|  43.9k|    botan_hash_output_length(fn_, &outlen);
  137|       |    assert(3 == outlen);
  138|  43.9k|}
_ZN3rnp11CRC24_BotanD2Ev:
  141|  43.9k|{
  142|  43.9k|    if (fn_) {
  ------------------
  |  Branch (142:9): [True: 1.40k, False: 42.5k]
  ------------------
  143|  1.40k|        botan_hash_destroy(fn_);
  144|  1.40k|    }
  145|  43.9k|}
_ZN3rnp11CRC24_Botan6createEv:
  149|  43.9k|{
  150|  43.9k|    return std::unique_ptr<CRC24_Botan>(new CRC24_Botan());
  151|  43.9k|}
_ZN3rnp11CRC24_Botan3addEPKvm:
  155|  85.2k|{
  156|  85.2k|    if (!fn_) {
  ------------------
  |  Branch (156:9): [True: 0, False: 85.2k]
  ------------------
  157|      0|        throw rnp_exception(RNP_ERROR_NULL_POINTER);
  158|      0|    }
  159|  85.2k|    if (botan_hash_update(fn_, static_cast<const uint8_t *>(buf), len)) {
  ------------------
  |  Branch (159:9): [True: 0, False: 85.2k]
  ------------------
  160|      0|        throw rnp_exception(RNP_ERROR_GENERIC);
  161|      0|    }
  162|  85.2k|}
_ZN3rnp11CRC24_Botan6finishEv:
  166|  42.5k|{
  167|  42.5k|    if (!fn_) {
  ------------------
  |  Branch (167:9): [True: 0, False: 42.5k]
  ------------------
  168|      0|        throw rnp_exception(RNP_ERROR_NULL_POINTER);
  169|      0|    }
  170|  42.5k|    std::array<uint8_t, 3> crc{};
  171|  42.5k|    botan_hash_final(fn_, crc.data());
  172|  42.5k|    botan_hash_destroy(fn_);
  173|  42.5k|    fn_ = nullptr;
  174|  42.5k|    return crc;
  175|  42.5k|}

_ZN3rnp5CRC24C2Ev:
   81|  43.9k|    CRC24(){};
_ZN3rnp5CRC24D2Ev:
   89|  43.9k|    virtual ~CRC24(){};

_ZN3rnp5CRC246createEv:
   95|  43.9k|{
   96|       |#if defined(CRYPTO_BACKEND_OPENSSL)
   97|       |    return CRC24_RNP::create();
   98|       |#elif defined(CRYPTO_BACKEND_BOTAN)
   99|       |    return CRC24_Botan::create();
  100|       |#else
  101|       |#error "Crypto backend not specified"
  102|       |#endif
  103|  43.9k|}

_ZN3rnp16secure_allocatorIhE8allocateEm:
   67|  1.25M|    {
   68|  1.25M|        if (!n) {
  ------------------
  |  Branch (68:13): [True: 0, False: 1.25M]
  ------------------
   69|      0|            return nullptr;
   70|      0|        }
   71|  1.25M|        T *ptr = static_cast<T *>(std::calloc(n, sizeof(T)));
   72|  1.25M|        if (!ptr)
  ------------------
  |  Branch (72:13): [True: 0, False: 1.25M]
  ------------------
   73|      0|            throw std::bad_alloc();
   74|  1.25M|        return ptr;
   75|  1.25M|    }
_ZN3rnp16secure_allocatorIhE10deallocateEPhm:
   79|  1.25M|    {
   80|  1.25M|        if (!p) {
  ------------------
  |  Branch (80:13): [True: 0, False: 1.25M]
  ------------------
   81|      0|            return;
   82|      0|        }
   83|  1.25M|        botan_scrub_mem(p, n * sizeof(T));
   84|  1.25M|        std::free(p);
   85|  1.25M|    }

_ZNK3pgp3mpi4bitsEv:
   37|   634k|{
   38|   634k|    size_t  bits = 0;
   39|   634k|    size_t  idx = 0;
   40|   634k|    uint8_t bt;
   41|       |
   42|   653k|    for (idx = 0; (idx < size()) && !data_[idx]; idx++)
  ------------------
  |  Branch (42:19): [True: 635k, False: 17.7k]
  |  Branch (42:37): [True: 19.2k, False: 616k]
  ------------------
   43|  19.2k|        ;
   44|       |
   45|   634k|    if (idx < size()) {
  ------------------
  |  Branch (45:9): [True: 616k, False: 17.7k]
  ------------------
   46|  4.90M|        for (bits = (size() - idx - 1) << 3, bt = data_[idx]; bt; bits++, bt = bt >> 1)
  ------------------
  |  Branch (46:63): [True: 4.28M, False: 616k]
  ------------------
   47|  4.28M|            ;
   48|   616k|    }
   49|       |
   50|   634k|    return bits;
   51|   634k|}
_ZNK3pgp3mpi4sizeEv:
   55|  1.90M|{
   56|  1.90M|    return data_.size();
   57|  1.90M|}
_ZN3pgp3mpi4dataEv:
   61|   634k|{
   62|   634k|    return data_.data();
   63|   634k|}
_ZN3pgp3mpi6resizeEmh:
  119|   634k|{
  120|   634k|    data_.resize(size, fill);
  121|   634k|}

_ZN3rnp3RNGC2ENS0_4TypeE:
   34|  4.44k|{
   35|  4.44k|    if (botan_rng_init(&botan_rng, type == Type::DRBG ? "user" : NULL)) {
  ------------------
  |  Branch (35:9): [True: 0, False: 4.44k]
  |  Branch (35:36): [True: 4.44k, False: 0]
  ------------------
   36|      0|        throw rnp::rnp_exception(RNP_ERROR_RNG);
   37|      0|    }
   38|  4.44k|}
_ZN3rnp3RNGD2Ev:
   41|  4.44k|{
   42|  4.44k|    (void) botan_rng_destroy(botan_rng);
   43|  4.44k|}

_Z26sphincsplus_signature_size16pgp_pubkey_alg_t:
  259|    381|{
  260|    381|    switch (alg) {
  261|    111|    case PGP_PKA_SPHINCSPLUS_SHAKE_128f:
  ------------------
  |  Branch (261:5): [True: 111, False: 270]
  ------------------
  262|    111|        return 17088;
  263|    163|    case PGP_PKA_SPHINCSPLUS_SHAKE_128s:
  ------------------
  |  Branch (263:5): [True: 163, False: 218]
  ------------------
  264|    163|        return 7856;
  265|    107|    case PGP_PKA_SPHINCSPLUS_SHAKE_256s:
  ------------------
  |  Branch (265:5): [True: 107, False: 274]
  ------------------
  266|    107|        return 29792;
  267|      0|    default:
  ------------------
  |  Branch (267:5): [True: 0, False: 381]
  ------------------
  268|      0|        RNP_LOG("invalid SLH-DSA algorithm identifier");
  ------------------
  |  |   84|      0|#define RNP_LOG(...) RNP_LOG_FD(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   76|      0|    do {                                                                                 \
  |  |  |  |   77|      0|        if (!rnp_log_switch())                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   78|      0|            break;                                                                       \
  |  |  |  |   79|      0|        (void) fprintf((fd), "[%s() %s:%d] ", __func__, __SOURCE_PATH_FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define __SOURCE_PATH_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        (void) fprintf((fd), __VA_ARGS__);                                               \
  |  |  |  |   81|      0|        (void) fprintf((fd), "\n");                                                      \
  |  |  |  |   82|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  269|      0|        return 0;
  270|    381|    }
  271|    381|}

_ZN3pgp11FingerprintC2Ev:
   38|   106k|Fingerprint::Fingerprint() : keyid_({})
   39|   106k|{
   40|   106k|}
_ZN3pgp11FingerprintC2EPKhm:
   42|  29.9k|Fingerprint::Fingerprint(const uint8_t *data, size_t size) : Fingerprint()
   43|  29.9k|{
   44|  29.9k|    fp_.assign(data, data + size);
   45|  29.9k|}
_ZNK3pgp11Fingerprint5keyidEv:
  119|  1.52k|{
  120|  1.52k|    return keyid_;
  121|  1.52k|}
_ZNK3pgp11Fingerprint4sizeEv:
  137|  45.4k|{
  138|  45.4k|    return fp_.size();
  139|  45.4k|}

_ZN3rnp4json3addERN8nlohmann16json_abi_v3_11_310basic_jsonINS2_11ordered_mapENSt3__16vectorENS5_12basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEEblmdSA_NS2_14adl_serializerENS6_IhNSA_IhEEEEvEEPKcSJ_:
   53|   108k|{
   54|   108k|    obj[name] = value;
   55|   108k|    return true;
   56|   108k|}
_ZN3rnp4json9array_addERN8nlohmann16json_abi_v3_11_310basic_jsonINS2_11ordered_mapENSt3__16vectorENS5_12basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEEblmdSA_NS2_14adl_serializerENS6_IhNSA_IhEEEEvEESG_:
  131|  54.3k|{
  132|  54.3k|    arr.push_back(std::move(val));
  133|  54.3k|    return true;
  134|  54.3k|}
_ZN3rnp4json11dump_prettyERKN8nlohmann16json_abi_v3_11_310basic_jsonINS2_11ordered_mapENSt3__16vectorENS5_12basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEEblmdSA_NS2_14adl_serializerENS6_IhNSA_IhEEEEvEE:
  213|    418|{
  214|       |    /* nlohmann::ordered_json::dump(2) produces 2-space indent but with `": ` after
  215|       |     * keys. json-c uses `":` (no space). Walk the dumped string and remove
  216|       |     * the space after structural colons (colons that follow an unescaped
  217|       |     * closing quote of a key). Inside-string `":` is part of a value and
  218|       |     * is left untouched because the preceding quote is escaped (`\"`). */
  219|    418|    std::string raw = jso.dump(2);
  220|    418|    std::string out;
  221|    418|    out.reserve(raw.size());
  222|    418|    bool   in_string = false;
  223|    418|    bool   escaped = false;
  224|    418|    size_t i = 0;
  225|  3.79M|    while (i < raw.size()) {
  ------------------
  |  Branch (225:12): [True: 3.79M, False: 418]
  ------------------
  226|  3.79M|        char c = raw[i];
  227|  3.79M|        if (escaped) {
  ------------------
  |  Branch (227:13): [True: 0, False: 3.79M]
  ------------------
  228|      0|            out.push_back(c);
  229|      0|            escaped = false;
  230|      0|            i++;
  231|      0|            continue;
  232|      0|        }
  233|  3.79M|        if (in_string) {
  ------------------
  |  Branch (233:13): [True: 1.94M, False: 1.85M]
  ------------------
  234|  1.94M|            if (c == '\\') {
  ------------------
  |  Branch (234:17): [True: 0, False: 1.94M]
  ------------------
  235|      0|                escaped = true;
  236|      0|                out.push_back(c);
  237|      0|                i++;
  238|      0|                continue;
  239|      0|            }
  240|  1.94M|            if (c == '"') {
  ------------------
  |  Branch (240:17): [True: 217k, False: 1.72M]
  ------------------
  241|   217k|                in_string = false;
  242|   217k|            }
  243|  1.94M|            out.push_back(c);
  244|  1.94M|            i++;
  245|  1.94M|            continue;
  246|  1.94M|        }
  247|  1.85M|        if (c == '"') {
  ------------------
  |  Branch (247:13): [True: 217k, False: 1.63M]
  ------------------
  248|   217k|            in_string = true;
  249|   217k|            out.push_back(c);
  250|   217k|            i++;
  251|   217k|            continue;
  252|   217k|        }
  253|       |        /* structural colon followed by space → drop the space */
  254|  1.63M|        if (c == ':' && i + 1 < raw.size() && raw[i + 1] == ' ') {
  ------------------
  |  Branch (254:13): [True: 109k, False: 1.52M]
  |  Branch (254:25): [True: 109k, False: 0]
  |  Branch (254:47): [True: 109k, False: 0]
  ------------------
  255|   109k|            out.push_back(':');
  256|   109k|            i += 2; /* skip the colon and its trailing space */
  257|   109k|            continue;
  258|   109k|        }
  259|  1.52M|        out.push_back(c);
  260|  1.52M|        i++;
  261|  1.52M|    }
  262|    418|    return out;
  263|    418|}

_ZN3rnp9KeySearch6createERKNSt3__15arrayIhLm8EEE:
   56|  3.05k|{
   57|  3.05k|    return std::unique_ptr<KeySearch>(new KeyIDSearch(keyid));
   58|  3.05k|}
_ZN3rnp9KeySearch6createERKN3pgp11FingerprintE:
   62|  43.6k|{
   63|  43.6k|    return std::unique_ptr<KeySearch>(new KeyFingerprintSearch(fp));
   64|  43.6k|}
_ZN3rnp11KeyIDSearchC2ERKNSt3__15arrayIhLm8EEE:
  148|  3.05k|{
  149|  3.05k|    type_ = Type::KeyID;
  150|  3.05k|    keyid_ = keyid;
  151|  3.05k|}
_ZN3rnp20KeyFingerprintSearchC2ERKN3pgp11FingerprintE:
  172|  43.6k|{
  173|  43.6k|    type_ = Type::Fingerprint;
  174|  43.6k|    fp_ = fp;
  175|  43.6k|}
_ZNK3rnp20KeyFingerprintSearch6get_fpEv:
  179|  43.6k|{
  180|  43.6k|    return fp_;
  181|  43.6k|}

_ZNK3rnp9KeySearch4typeEv:
   49|  46.7k|    {
   50|  46.7k|        return type_;
   51|  46.7k|    }
_ZN3rnp11KeyProviderC2EPFPNS_3KeyEPK21pgp_key_request_ctx_tPvES6_:
  120|  4.44k|        : callback(cb), userdata(ud){};
_ZN3rnp9KeySearchD2Ev:
   55|  46.7k|    virtual ~KeySearch() = default;

_Z14rnp_log_switchv:
   53|   813k|{
   54|   813k|    if (_rnp_log_switch < 0) {
  ------------------
  |  Branch (54:9): [True: 1, False: 813k]
  ------------------
   55|      1|        const char *var = getenv(RNP_LOG_CONSOLE);
   56|      1|        _rnp_log_switch = (var && strcmp(var, "0")) ? 1 : 0;
  ------------------
  |  Branch (56:28): [True: 0, False: 1]
  |  Branch (56:35): [True: 0, False: 0]
  ------------------
   57|      1|    }
   58|   813k|    return !_rnp_log_disable && !!_rnp_log_switch;
  ------------------
  |  Branch (58:12): [True: 813k, False: 0]
  |  Branch (58:33): [True: 0, False: 813k]
  ------------------
   59|   813k|}

_ZN8nlohmann16json_abi_v3_11_310basic_jsonINS0_11ordered_mapENSt3__16vectorENS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEblmdS8_NS0_14adl_serializerENS4_IhNS8_IhEEEEvE9push_backEOSE_:
22391|  54.3k|    {
22392|       |        // push_back only works for null objects or arrays
22393|  54.3k|        if (JSON_HEDLEY_UNLIKELY(!(is_null() || is_array())))
  ------------------
  |  | 1677|   108k|#  define JSON_HEDLEY_UNLIKELY(expr)                    __builtin_expect                 (!!(expr),    0                  )
  |  |  ------------------
  |  |  |  Branch (1677:57): [True: 0, False: 54.3k]
  |  |  |  Branch (1677:94): [True: 0, False: 54.3k]
  |  |  |  Branch (1677:94): [True: 54.3k, False: 0]
  |  |  ------------------
  ------------------
22394|      0|        {
22395|      0|            JSON_THROW(type_error::create(308, detail::concat("cannot use push_back() with ", type_name()), this));
  ------------------
  |  | 2517|      0|    #define JSON_THROW(exception) throw exception
  ------------------
22396|      0|        }
22397|       |
22398|       |        // transform null object into an array
22399|  54.3k|        if (is_null())
  ------------------
  |  Branch (22399:13): [True: 0, False: 54.3k]
  ------------------
22400|      0|        {
22401|      0|            m_data.m_type = value_t::array;
22402|      0|            m_data.m_value = value_t::array;
22403|      0|            assert_invariant();
22404|      0|        }
22405|       |
22406|       |        // add element to array (move semantics)
22407|  54.3k|        const auto old_capacity = m_data.m_value.array->capacity();
22408|  54.3k|        m_data.m_value.array->push_back(std::move(val));
22409|  54.3k|        set_parent(m_data.m_value.array->back(), old_capacity);
22410|       |        // if val is moved from, basic_json move constructor marks it null, so we do not call the destructor
22411|  54.3k|    }
_ZN8nlohmann16json_abi_v3_11_310basic_jsonINS0_11ordered_mapENSt3__16vectorENS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEblmdS8_NS0_14adl_serializerENS4_IhNS8_IhEEEEvE10json_valueC2ENS0_6detail7value_tE:
19756|   164k|        {
19757|   164k|            switch (t)
19758|   164k|            {
19759|  54.8k|                case value_t::object:
  ------------------
  |  Branch (19759:17): [True: 54.8k, False: 109k]
  ------------------
19760|  54.8k|                {
19761|  54.8k|                    object = create<object_t>();
19762|  54.8k|                    break;
19763|      0|                }
19764|       |
19765|      0|                case value_t::array:
  ------------------
  |  Branch (19765:17): [True: 0, False: 164k]
  ------------------
19766|      0|                {
19767|      0|                    array = create<array_t>();
19768|      0|                    break;
19769|      0|                }
19770|       |
19771|      0|                case value_t::string:
  ------------------
  |  Branch (19771:17): [True: 0, False: 164k]
  ------------------
19772|      0|                {
19773|      0|                    string = create<string_t>("");
19774|      0|                    break;
19775|      0|                }
19776|       |
19777|      0|                case value_t::binary:
  ------------------
  |  Branch (19777:17): [True: 0, False: 164k]
  ------------------
19778|      0|                {
19779|      0|                    binary = create<binary_t>();
19780|      0|                    break;
19781|      0|                }
19782|       |
19783|      0|                case value_t::boolean:
  ------------------
  |  Branch (19783:17): [True: 0, False: 164k]
  ------------------
19784|      0|                {
19785|      0|                    boolean = static_cast<boolean_t>(false);
19786|      0|                    break;
19787|      0|                }
19788|       |
19789|      0|                case value_t::number_integer:
  ------------------
  |  Branch (19789:17): [True: 0, False: 164k]
  ------------------
19790|      0|                {
19791|      0|                    number_integer = static_cast<number_integer_t>(0);
19792|      0|                    break;
19793|      0|                }
19794|       |
19795|      0|                case value_t::number_unsigned:
  ------------------
  |  Branch (19795:17): [True: 0, False: 164k]
  ------------------
19796|      0|                {
19797|      0|                    number_unsigned = static_cast<number_unsigned_t>(0);
19798|      0|                    break;
19799|      0|                }
19800|       |
19801|      0|                case value_t::number_float:
  ------------------
  |  Branch (19801:17): [True: 0, False: 164k]
  ------------------
19802|      0|                {
19803|      0|                    number_float = static_cast<number_float_t>(0.0);
19804|      0|                    break;
19805|      0|                }
19806|       |
19807|   109k|                case value_t::null:
  ------------------
  |  Branch (19807:17): [True: 109k, False: 54.8k]
  ------------------
19808|   109k|                {
19809|   109k|                    object = nullptr;  // silence warning, see #821
19810|   109k|                    break;
19811|      0|                }
19812|       |
19813|      0|                case value_t::discarded:
  ------------------
  |  Branch (19813:17): [True: 0, False: 164k]
  ------------------
19814|      0|                default:
  ------------------
  |  Branch (19814:17): [True: 0, False: 164k]
  ------------------
19815|      0|                {
19816|      0|                    object = nullptr;  // silence warning, see #821
19817|      0|                    if (JSON_HEDLEY_UNLIKELY(t == value_t::null))
  ------------------
  |  | 1677|      0|#  define JSON_HEDLEY_UNLIKELY(expr)                    __builtin_expect                 (!!(expr),    0                  )
  |  |  ------------------
  |  |  |  Branch (1677:57): [True: 0, False: 0]
  |  |  ------------------
  ------------------
19818|      0|                    {
19819|      0|                        JSON_THROW(other_error::create(500, "961c151d2e87f2686a955a9be24d316f1362bf21 3.11.3", nullptr)); // LCOV_EXCL_LINE
  ------------------
  |  | 2517|      0|    #define JSON_THROW(exception) throw exception
  ------------------
19820|      0|                    }
19821|      0|                    break;
19822|      0|                }
19823|   164k|            }
19824|   164k|        }
_ZN8nlohmann16json_abi_v3_11_310basic_jsonINS0_11ordered_mapENSt3__16vectorENS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEblmdS8_NS0_14adl_serializerENS4_IhNS8_IhEEEEvE6createINS2_ISA_SE_NS3_4lessIvEENS8_INS3_4pairIKSA_SE_EEEEEEJEEEPT_DpOT0_:
19681|  54.8k|    {
19682|  54.8k|        AllocatorType<T> alloc;
19683|  54.8k|        using AllocatorTraits = std::allocator_traits<AllocatorType<T>>;
19684|       |
19685|  54.8k|        auto deleter = [&](T * obj)
19686|  54.8k|        {
19687|  54.8k|            AllocatorTraits::deallocate(alloc, obj, 1);
19688|  54.8k|        };
19689|  54.8k|        std::unique_ptr<T, decltype(deleter)> obj(AllocatorTraits::allocate(alloc, 1), deleter);
19690|  54.8k|        AllocatorTraits::construct(alloc, obj.get(), std::forward<Args>(args)...);
19691|       |        JSON_ASSERT(obj != nullptr);
  ------------------
  |  | 2552|  54.8k|    #define JSON_ASSERT(x) assert(x)
  ------------------
19692|  54.8k|        return obj.release();
19693|  54.8k|    }
_ZN8nlohmann16json_abi_v3_11_311ordered_mapINSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEENS0_10basic_jsonIS1_NS2_6vectorES8_blmdS6_NS0_14adl_serializerENSA_IhNS6_IhEEEEvEENS2_4lessIvEENS6_INS2_4pairIKS8_SE_EEEEEC2Ev:
19050|  54.8k|    ordered_map() noexcept(noexcept(Container())) : Container{} {}
_ZNK8nlohmann16json_abi_v3_11_310basic_jsonINS0_11ordered_mapENSt3__16vectorENS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEblmdS8_NS0_14adl_serializerENS4_IhNS8_IhEEEEvE16assert_invariantEb:
19985|  4.18M|    {
19986|  4.18M|        JSON_ASSERT(m_data.m_type != value_t::object || m_data.m_value.object != nullptr);
  ------------------
  |  | 2552|  4.18M|    #define JSON_ASSERT(x) assert(x)
  ------------------
19987|  4.18M|        JSON_ASSERT(m_data.m_type != value_t::array || m_data.m_value.array != nullptr);
  ------------------
  |  | 2552|  4.18M|    #define JSON_ASSERT(x) assert(x)
  ------------------
19988|  4.18M|        JSON_ASSERT(m_data.m_type != value_t::string || m_data.m_value.string != nullptr);
  ------------------
  |  | 2552|  4.18M|    #define JSON_ASSERT(x) assert(x)
  ------------------
19989|  4.18M|        JSON_ASSERT(m_data.m_type != value_t::binary || m_data.m_value.binary != nullptr);
  ------------------
  |  | 2552|  4.18M|    #define JSON_ASSERT(x) assert(x)
  ------------------
19990|       |
19991|       |#if JSON_DIAGNOSTICS
19992|       |        JSON_TRY
19993|       |        {
19994|       |            // cppcheck-suppress assertWithSideEffect
19995|       |            JSON_ASSERT(!check_parents || !is_structured() || std::all_of(begin(), end(), [this](const basic_json & j)
19996|       |            {
19997|       |                return j.m_parent == this;
19998|       |            }));
19999|       |        }
20000|       |        JSON_CATCH(...) {} // LCOV_EXCL_LINE
20001|       |#endif
20002|  4.18M|        static_cast<void>(check_parents);
20003|  4.18M|    }
_ZN8nlohmann16json_abi_v3_11_310basic_jsonINS0_11ordered_mapENSt3__16vectorENS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEblmdS8_NS0_14adl_serializerENS4_IhNS8_IhEEEEvE10set_parentERSE_m:
20056|   164k|    {
20057|       |#if JSON_DIAGNOSTICS
20058|       |        if (old_capacity != static_cast<std::size_t>(-1))
20059|       |        {
20060|       |            // see https://github.com/nlohmann/json/issues/2838
20061|       |            JSON_ASSERT(type() == value_t::array);
20062|       |            if (JSON_HEDLEY_UNLIKELY(m_data.m_value.array->capacity() != old_capacity))
20063|       |            {
20064|       |                // capacity has changed: update all parents
20065|       |                set_parents();
20066|       |                return j;
20067|       |            }
20068|       |        }
20069|       |
20070|       |        // ordered_json uses a vector internally, so pointers could have
20071|       |        // been invalidated; see https://github.com/nlohmann/json/issues/2962
20072|       |#ifdef JSON_HEDLEY_MSVC_VERSION
20073|       |#pragma warning(push )
20074|       |#pragma warning(disable : 4127) // ignore warning to replace if with if constexpr
20075|       |#endif
20076|       |        if (detail::is_ordered_map<object_t>::value)
20077|       |        {
20078|       |            set_parents();
20079|       |            return j;
20080|       |        }
20081|       |#ifdef JSON_HEDLEY_MSVC_VERSION
20082|       |#pragma warning( pop )
20083|       |#endif
20084|       |
20085|       |        j.m_parent = this;
20086|       |#else
20087|   164k|        static_cast<void>(j);
20088|   164k|        static_cast<void>(old_capacity);
20089|   164k|#endif
20090|   164k|        return j;
20091|   164k|    }
_ZN8nlohmann16json_abi_v3_11_310basic_jsonINS0_11ordered_mapENSt3__16vectorENS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEblmdS8_NS0_14adl_serializerENS4_IhNS8_IhEEEEvE4dataC2Ev:
23510|   381k|        data() noexcept = default;
_ZN8nlohmann16json_abi_v3_11_310basic_jsonINS0_11ordered_mapENSt3__16vectorENS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEblmdS8_NS0_14adl_serializerENS4_IhNS8_IhEEEEvE10json_value7destroyENS0_6detail7value_tE:
19857|  1.45M|        {
19858|  1.45M|            if (
19859|  1.45M|                (t == value_t::object && object == nullptr) ||
  ------------------
  |  Branch (19859:18): [True: 109k, False: 1.34M]
  |  Branch (19859:42): [True: 0, False: 109k]
  ------------------
19860|  1.45M|                (t == value_t::array && array == nullptr) ||
  ------------------
  |  Branch (19860:18): [True: 418, False: 1.45M]
  |  Branch (19860:41): [True: 0, False: 418]
  ------------------
19861|  1.45M|                (t == value_t::string && string == nullptr) ||
  ------------------
  |  Branch (19861:18): [True: 271k, False: 1.17M]
  |  Branch (19861:42): [True: 0, False: 271k]
  ------------------
19862|  1.45M|                (t == value_t::binary && binary == nullptr)
  ------------------
  |  Branch (19862:18): [True: 0, False: 1.45M]
  |  Branch (19862:42): [True: 0, False: 0]
  ------------------
19863|  1.45M|            )
19864|      0|            {
19865|       |                //not initialized (e.g. due to exception in the ctor)
19866|      0|                return;
19867|      0|            }
19868|  1.45M|            if (t == value_t::array || t == value_t::object)
  ------------------
  |  Branch (19868:17): [True: 418, False: 1.45M]
  |  Branch (19868:40): [True: 109k, False: 1.34M]
  ------------------
19869|   109k|            {
19870|       |                // flatten the current json_value to a heap-allocated stack
19871|   109k|                std::vector<basic_json> stack;
19872|       |
19873|       |                // move the top-level items to stack
19874|   109k|                if (t == value_t::array)
  ------------------
  |  Branch (19874:21): [True: 418, False: 109k]
  ------------------
19875|    418|                {
19876|    418|                    stack.reserve(array->size());
19877|    418|                    std::move(array->begin(), array->end(), std::back_inserter(stack));
19878|    418|                }
19879|   109k|                else
19880|   109k|                {
19881|   109k|                    stack.reserve(object->size());
19882|   109k|                    for (auto&& it : *object)
  ------------------
  |  Branch (19882:36): [True: 109k, False: 109k]
  ------------------
19883|   109k|                    {
19884|   109k|                        stack.push_back(std::move(it.second));
19885|   109k|                    }
19886|   109k|                }
19887|       |
19888|   381k|                while (!stack.empty())
  ------------------
  |  Branch (19888:24): [True: 272k, False: 109k]
  ------------------
19889|   272k|                {
19890|       |                    // move the last item to local variable to be processed
19891|   272k|                    basic_json current_item(std::move(stack.back()));
19892|   272k|                    stack.pop_back();
19893|       |
19894|       |                    // if current_item is array/object, move
19895|       |                    // its children to the stack to be processed later
19896|   272k|                    if (current_item.is_array())
  ------------------
  |  Branch (19896:25): [True: 418, False: 271k]
  ------------------
19897|    418|                    {
19898|    418|                        std::move(current_item.m_data.m_value.array->begin(), current_item.m_data.m_value.array->end(), std::back_inserter(stack));
19899|       |
19900|    418|                        current_item.m_data.m_value.array->clear();
19901|    418|                    }
19902|   271k|                    else if (current_item.is_object())
  ------------------
  |  Branch (19902:30): [True: 54.3k, False: 217k]
  ------------------
19903|  54.3k|                    {
19904|  54.3k|                        for (auto&& it : *current_item.m_data.m_value.object)
  ------------------
  |  Branch (19904:40): [True: 108k, False: 54.3k]
  ------------------
19905|   108k|                        {
19906|   108k|                            stack.push_back(std::move(it.second));
19907|   108k|                        }
19908|       |
19909|  54.3k|                        current_item.m_data.m_value.object->clear();
19910|  54.3k|                    }
19911|       |
19912|       |                    // it's now safe that current_item get destructed
19913|       |                    // since it doesn't have any children
19914|   272k|                }
19915|   109k|            }
19916|       |
19917|  1.45M|            switch (t)
19918|  1.45M|            {
19919|   109k|                case value_t::object:
  ------------------
  |  Branch (19919:17): [True: 109k, False: 1.34M]
  ------------------
19920|   109k|                {
19921|   109k|                    AllocatorType<object_t> alloc;
19922|   109k|                    std::allocator_traits<decltype(alloc)>::destroy(alloc, object);
19923|   109k|                    std::allocator_traits<decltype(alloc)>::deallocate(alloc, object, 1);
19924|   109k|                    break;
19925|      0|                }
19926|       |
19927|    418|                case value_t::array:
  ------------------
  |  Branch (19927:17): [True: 418, False: 1.45M]
  ------------------
19928|    418|                {
19929|    418|                    AllocatorType<array_t> alloc;
19930|    418|                    std::allocator_traits<decltype(alloc)>::destroy(alloc, array);
19931|    418|                    std::allocator_traits<decltype(alloc)>::deallocate(alloc, array, 1);
19932|    418|                    break;
19933|      0|                }
19934|       |
19935|   271k|                case value_t::string:
  ------------------
  |  Branch (19935:17): [True: 271k, False: 1.17M]
  ------------------
19936|   271k|                {
19937|   271k|                    AllocatorType<string_t> alloc;
19938|   271k|                    std::allocator_traits<decltype(alloc)>::destroy(alloc, string);
19939|   271k|                    std::allocator_traits<decltype(alloc)>::deallocate(alloc, string, 1);
19940|   271k|                    break;
19941|      0|                }
19942|       |
19943|      0|                case value_t::binary:
  ------------------
  |  Branch (19943:17): [True: 0, False: 1.45M]
  ------------------
19944|      0|                {
19945|      0|                    AllocatorType<binary_t> alloc;
19946|      0|                    std::allocator_traits<decltype(alloc)>::destroy(alloc, binary);
19947|      0|                    std::allocator_traits<decltype(alloc)>::deallocate(alloc, binary, 1);
19948|      0|                    break;
19949|      0|                }
19950|       |
19951|  1.06M|                case value_t::null:
  ------------------
  |  Branch (19951:17): [True: 1.06M, False: 381k]
  ------------------
19952|  1.06M|                case value_t::boolean:
  ------------------
  |  Branch (19952:17): [True: 0, False: 1.45M]
  ------------------
19953|  1.06M|                case value_t::number_integer:
  ------------------
  |  Branch (19953:17): [True: 0, False: 1.45M]
  ------------------
19954|  1.06M|                case value_t::number_unsigned:
  ------------------
  |  Branch (19954:17): [True: 0, False: 1.45M]
  ------------------
19955|  1.06M|                case value_t::number_float:
  ------------------
  |  Branch (19955:17): [True: 0, False: 1.45M]
  ------------------
19956|  1.06M|                case value_t::discarded:
  ------------------
  |  Branch (19956:17): [True: 0, False: 1.45M]
  ------------------
19957|  1.06M|                default:
  ------------------
  |  Branch (19957:17): [True: 0, False: 1.45M]
  ------------------
19958|  1.06M|                {
19959|  1.06M|                    break;
19960|  1.06M|                }
19961|  1.45M|            }
19962|  1.45M|        }
_ZNK8nlohmann16json_abi_v3_11_310basic_jsonINS0_11ordered_mapENSt3__16vectorENS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEblmdS8_NS0_14adl_serializerENS4_IhNS8_IhEEEEvE9is_objectEv:
20660|   381k|    {
20661|   381k|        return m_data.m_type == value_t::object;
20662|   381k|    }
_ZN8nlohmann16json_abi_v3_11_310basic_jsonINS0_11ordered_mapENSt3__16vectorENS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEblmdS8_NS0_14adl_serializerENS4_IhNS8_IhEEEEvE11set_parentsEv:
20006|  1.34M|    {
20007|       |#if JSON_DIAGNOSTICS
20008|       |        switch (m_data.m_type)
20009|       |        {
20010|       |            case value_t::array:
20011|       |            {
20012|       |                for (auto& element : *m_data.m_value.array)
20013|       |                {
20014|       |                    element.m_parent = this;
20015|       |                }
20016|       |                break;
20017|       |            }
20018|       |
20019|       |            case value_t::object:
20020|       |            {
20021|       |                for (auto& element : *m_data.m_value.object)
20022|       |                {
20023|       |                    element.second.m_parent = this;
20024|       |                }
20025|       |                break;
20026|       |            }
20027|       |
20028|       |            case value_t::null:
20029|       |            case value_t::string:
20030|       |            case value_t::boolean:
20031|       |            case value_t::number_integer:
20032|       |            case value_t::number_unsigned:
20033|       |            case value_t::number_float:
20034|       |            case value_t::binary:
20035|       |            case value_t::discarded:
20036|       |            default:
20037|       |                break;
20038|       |        }
20039|       |#endif
20040|  1.34M|    }
_ZN8nlohmann16json_abi_v3_11_310basic_jsonINS0_11ordered_mapENSt3__16vectorENS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEblmdS8_NS0_14adl_serializerENS4_IhNS8_IhEEEEvEixESA_:
21422|   109k|    {
21423|       |        // implicitly convert null value to an empty object
21424|   109k|        if (is_null())
  ------------------
  |  Branch (21424:13): [True: 0, False: 109k]
  ------------------
21425|      0|        {
21426|      0|            m_data.m_type = value_t::object;
21427|      0|            m_data.m_value.object = create<object_t>();
21428|      0|            assert_invariant();
21429|      0|        }
21430|       |
21431|       |        // operator[] only works for objects
21432|   109k|        if (JSON_HEDLEY_LIKELY(is_object()))
  ------------------
  |  | 1676|   109k|#  define JSON_HEDLEY_LIKELY(expr)                      __builtin_expect                 (!!(expr),    1                  )
  |  |  ------------------
  |  |  |  Branch (1676:57): [True: 109k, False: 0]
  |  |  ------------------
  ------------------
21433|   109k|        {
21434|   109k|            auto result = m_data.m_value.object->emplace(std::move(key), nullptr);
21435|   109k|            return set_parent(result.first->second);
21436|   109k|        }
21437|       |
21438|      0|        JSON_THROW(type_error::create(305, detail::concat("cannot use operator[] with a string argument with ", type_name()), this));
  ------------------
  |  | 2517|      0|    #define JSON_THROW(exception) throw exception
  ------------------
21439|   109k|    }
_ZN8nlohmann16json_abi_v3_11_311ordered_mapINSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEENS0_10basic_jsonIS1_NS2_6vectorES8_blmdS6_NS0_14adl_serializerENSA_IhNS6_IhEEEEvEENS2_4lessIvEENS6_INS2_4pairIKS8_SE_EEEEE7emplaceERSI_OSE_:
19059|   109k|    {
19060|   164k|        for (auto it = this->begin(); it != this->end(); ++it)
  ------------------
  |  Branch (19060:39): [True: 54.8k, False: 109k]
  ------------------
19061|  54.8k|        {
19062|  54.8k|            if (m_compare(it->first, key))
  ------------------
  |  Branch (19062:17): [True: 418, False: 54.3k]
  ------------------
19063|    418|            {
19064|    418|                return {it, false};
19065|    418|            }
19066|  54.8k|        }
19067|   109k|        Container::emplace_back(key, std::forward<T>(t));
19068|   109k|        return {std::prev(this->end()), true};
19069|   109k|    }
_ZN8nlohmann16json_abi_v3_11_310basic_jsonINS0_11ordered_mapENSt3__16vectorENS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEblmdS8_NS0_14adl_serializerENS4_IhNS8_IhEEEEvEC2ERKSE_:
20448|   217k|        : json_base_class_t(other)
20449|   217k|    {
20450|   217k|        m_data.m_type = other.m_data.m_type;
20451|       |        // check of passed value is valid
20452|   217k|        other.assert_invariant();
20453|       |
20454|   217k|        switch (m_data.m_type)
20455|   217k|        {
20456|  54.3k|            case value_t::object:
  ------------------
  |  Branch (20456:13): [True: 54.3k, False: 163k]
  ------------------
20457|  54.3k|            {
20458|  54.3k|                m_data.m_value = *other.m_data.m_value.object;
20459|  54.3k|                break;
20460|      0|            }
20461|       |
20462|      0|            case value_t::array:
  ------------------
  |  Branch (20462:13): [True: 0, False: 217k]
  ------------------
20463|      0|            {
20464|      0|                m_data.m_value = *other.m_data.m_value.array;
20465|      0|                break;
20466|      0|            }
20467|       |
20468|   163k|            case value_t::string:
  ------------------
  |  Branch (20468:13): [True: 163k, False: 54.3k]
  ------------------
20469|   163k|            {
20470|   163k|                m_data.m_value = *other.m_data.m_value.string;
20471|   163k|                break;
20472|      0|            }
20473|       |
20474|      0|            case value_t::boolean:
  ------------------
  |  Branch (20474:13): [True: 0, False: 217k]
  ------------------
20475|      0|            {
20476|      0|                m_data.m_value = other.m_data.m_value.boolean;
20477|      0|                break;
20478|      0|            }
20479|       |
20480|      0|            case value_t::number_integer:
  ------------------
  |  Branch (20480:13): [True: 0, False: 217k]
  ------------------
20481|      0|            {
20482|      0|                m_data.m_value = other.m_data.m_value.number_integer;
20483|      0|                break;
20484|      0|            }
20485|       |
20486|      0|            case value_t::number_unsigned:
  ------------------
  |  Branch (20486:13): [True: 0, False: 217k]
  ------------------
20487|      0|            {
20488|      0|                m_data.m_value = other.m_data.m_value.number_unsigned;
20489|      0|                break;
20490|      0|            }
20491|       |
20492|      0|            case value_t::number_float:
  ------------------
  |  Branch (20492:13): [True: 0, False: 217k]
  ------------------
20493|      0|            {
20494|      0|                m_data.m_value = other.m_data.m_value.number_float;
20495|      0|                break;
20496|      0|            }
20497|       |
20498|      0|            case value_t::binary:
  ------------------
  |  Branch (20498:13): [True: 0, False: 217k]
  ------------------
20499|      0|            {
20500|      0|                m_data.m_value = *other.m_data.m_value.binary;
20501|      0|                break;
20502|      0|            }
20503|       |
20504|      0|            case value_t::null:
  ------------------
  |  Branch (20504:13): [True: 0, False: 217k]
  ------------------
20505|      0|            case value_t::discarded:
  ------------------
  |  Branch (20505:13): [True: 0, False: 217k]
  ------------------
20506|      0|            default:
  ------------------
  |  Branch (20506:13): [True: 0, False: 217k]
  ------------------
20507|      0|                break;
20508|   217k|        }
20509|       |
20510|   217k|        set_parents();
20511|   217k|        assert_invariant();
20512|   217k|    }
_ZN8nlohmann16json_abi_v3_11_310basic_jsonINS0_11ordered_mapENSt3__16vectorENS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEblmdS8_NS0_14adl_serializerENS4_IhNS8_IhEEEEvE10json_valueC2ERKNS2_ISA_SE_NS3_4lessIvEENS8_INS3_4pairIKSA_SE_EEEEEE:
19833|  54.3k|        json_value(const object_t& value) : object(create<object_t>(value)) {}
_ZN8nlohmann16json_abi_v3_11_310basic_jsonINS0_11ordered_mapENSt3__16vectorENS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEblmdS8_NS0_14adl_serializerENS4_IhNS8_IhEEEEvE6createINS2_ISA_SE_NS3_4lessIvEENS8_INS3_4pairIKSA_SE_EEEEEEJRKSM_EEEPT_DpOT0_:
19681|  54.3k|    {
19682|  54.3k|        AllocatorType<T> alloc;
19683|  54.3k|        using AllocatorTraits = std::allocator_traits<AllocatorType<T>>;
19684|       |
19685|  54.3k|        auto deleter = [&](T * obj)
19686|  54.3k|        {
19687|  54.3k|            AllocatorTraits::deallocate(alloc, obj, 1);
19688|  54.3k|        };
19689|  54.3k|        std::unique_ptr<T, decltype(deleter)> obj(AllocatorTraits::allocate(alloc, 1), deleter);
19690|  54.3k|        AllocatorTraits::construct(alloc, obj.get(), std::forward<Args>(args)...);
19691|       |        JSON_ASSERT(obj != nullptr);
  ------------------
  |  | 2552|  54.3k|    #define JSON_ASSERT(x) assert(x)
  ------------------
19692|  54.3k|        return obj.release();
19693|  54.3k|    }
_ZN8nlohmann16json_abi_v3_11_310basic_jsonINS0_11ordered_mapENSt3__16vectorENS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEblmdS8_NS0_14adl_serializerENS4_IhNS8_IhEEEEvE10json_valueC2ERKSA_:
19827|   163k|        json_value(const string_t& value) : string(create<string_t>(value)) {}
_ZN8nlohmann16json_abi_v3_11_310basic_jsonINS0_11ordered_mapENSt3__16vectorENS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEblmdS8_NS0_14adl_serializerENS4_IhNS8_IhEEEEvE6createISA_JRKSA_EEEPT_DpOT0_:
19681|   163k|    {
19682|   163k|        AllocatorType<T> alloc;
19683|   163k|        using AllocatorTraits = std::allocator_traits<AllocatorType<T>>;
19684|       |
19685|   163k|        auto deleter = [&](T * obj)
19686|   163k|        {
19687|   163k|            AllocatorTraits::deallocate(alloc, obj, 1);
19688|   163k|        };
19689|   163k|        std::unique_ptr<T, decltype(deleter)> obj(AllocatorTraits::allocate(alloc, 1), deleter);
19690|   163k|        AllocatorTraits::construct(alloc, obj.get(), std::forward<Args>(args)...);
19691|       |        JSON_ASSERT(obj != nullptr);
  ------------------
  |  | 2552|   163k|    #define JSON_ASSERT(x) assert(x)
  ------------------
19692|   163k|        return obj.release();
19693|   163k|    }
_ZN8nlohmann16json_abi_v3_11_310basic_jsonINS0_11ordered_mapENSt3__16vectorENS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEblmdS8_NS0_14adl_serializerENS4_IhNS8_IhEEEEvE4dataD2Ev:
23517|  1.34M|        {
23518|  1.34M|            m_value.destroy(m_type);
23519|  1.34M|        }
_ZNK8nlohmann16json_abi_v3_11_310basic_jsonINS0_11ordered_mapENSt3__16vectorENS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEblmdS8_NS0_14adl_serializerENS4_IhNS8_IhEEEEvE7is_nullEv:
20618|   218k|    {
20619|   218k|        return m_data.m_type == value_t::null;
20620|   218k|    }
_ZNK8nlohmann16json_abi_v3_11_310basic_jsonINS0_11ordered_mapENSt3__16vectorENS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEblmdS8_NS0_14adl_serializerENS4_IhNS8_IhEEEEvE8is_arrayEv:
20667|   326k|    {
20668|   326k|        return m_data.m_type == value_t::array;
20669|   326k|    }
_ZN8nlohmann16json_abi_v3_11_310basic_jsonINS0_11ordered_mapENSt3__16vectorENS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEblmdS8_NS0_14adl_serializerENS4_IhNS8_IhEEEEvEixIKcEERSE_PT_:
21460|   109k|    {
21461|   109k|        return operator[](typename object_t::key_type(key));
21462|   109k|    }
_ZN8nlohmann16json_abi_v3_11_310basic_jsonINS0_11ordered_mapENSt3__16vectorENS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEblmdS8_NS0_14adl_serializerENS4_IhNS8_IhEEEEvE5arrayESt16initializer_listINS0_6detail8json_refISE_EEE:
20308|    418|    {
20309|    418|        return basic_json(init, false, value_t::array);
20310|    418|    }
_ZN8nlohmann16json_abi_v3_11_310basic_jsonINS0_11ordered_mapENSt3__16vectorENS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEblmdS8_NS0_14adl_serializerENS4_IhNS8_IhEEEEvEC2ESt16initializer_listINS0_6detail8json_refISE_EEEbNSG_7value_tE:
20207|  55.2k|    {
20208|       |        // check if each element is an array with two elements whose first
20209|       |        // element is a string
20210|  55.2k|        bool is_an_object = std::all_of(init.begin(), init.end(),
20211|  55.2k|                                        [](const detail::json_ref<basic_json>& element_ref)
20212|  55.2k|        {
20213|       |            // The cast is to ensure op[size_type] is called, bearing in mind size_type may not be int;
20214|       |            // (many string types can be constructed from 0 via its null-pointer guise, so we get a
20215|       |            // broken call to op[key_type], the wrong semantics and a 4804 warning on Windows)
20216|  55.2k|            return element_ref->is_array() && element_ref->size() == 2 && (*element_ref)[static_cast<size_type>(0)].is_string();
20217|  55.2k|        });
20218|       |
20219|       |        // adjust type if type deduction is not wanted
20220|  55.2k|        if (!type_deduction)
  ------------------
  |  Branch (20220:13): [True: 55.2k, False: 0]
  ------------------
20221|  55.2k|        {
20222|       |            // if array is wanted, do not create an object though possible
20223|  55.2k|            if (manual_type == value_t::array)
  ------------------
  |  Branch (20223:17): [True: 418, False: 54.8k]
  ------------------
20224|    418|            {
20225|    418|                is_an_object = false;
20226|    418|            }
20227|       |
20228|       |            // if object is wanted but impossible, throw an exception
20229|  55.2k|            if (JSON_HEDLEY_UNLIKELY(manual_type == value_t::object && !is_an_object))
  ------------------
  |  | 1677|   110k|#  define JSON_HEDLEY_UNLIKELY(expr)                    __builtin_expect                 (!!(expr),    0                  )
  |  |  ------------------
  |  |  |  Branch (1677:57): [True: 0, False: 55.2k]
  |  |  |  Branch (1677:94): [True: 54.8k, False: 418]
  |  |  |  Branch (1677:94): [True: 0, False: 54.8k]
  |  |  ------------------
  ------------------
20230|      0|            {
20231|      0|                JSON_THROW(type_error::create(301, "cannot create object from initializer list", nullptr));
  ------------------
  |  | 2517|      0|    #define JSON_THROW(exception) throw exception
  ------------------
20232|      0|            }
20233|  55.2k|        }
20234|       |
20235|  55.2k|        if (is_an_object)
  ------------------
  |  Branch (20235:13): [True: 54.8k, False: 418]
  ------------------
20236|  54.8k|        {
20237|       |            // the initializer list is a list of pairs -> create object
20238|  54.8k|            m_data.m_type = value_t::object;
20239|  54.8k|            m_data.m_value = value_t::object;
20240|       |
20241|  54.8k|            for (auto& element_ref : init)
  ------------------
  |  Branch (20241:36): [True: 0, False: 54.8k]
  ------------------
20242|      0|            {
20243|      0|                auto element = element_ref.moved_or_copied();
20244|      0|                m_data.m_value.object->emplace(
20245|      0|                    std::move(*((*element.m_data.m_value.array)[0].m_data.m_value.string)),
20246|      0|                    std::move((*element.m_data.m_value.array)[1]));
20247|      0|            }
20248|  54.8k|        }
20249|    418|        else
20250|    418|        {
20251|       |            // the initializer list describes an array -> create array
20252|    418|            m_data.m_type = value_t::array;
20253|    418|            m_data.m_value.array = create<array_t>(init.begin(), init.end());
20254|    418|        }
20255|       |
20256|  55.2k|        set_parents();
20257|  55.2k|        assert_invariant();
20258|  55.2k|    }
_ZN8nlohmann16json_abi_v3_11_310basic_jsonINS0_11ordered_mapENSt3__16vectorENS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEblmdS8_NS0_14adl_serializerENS4_IhNS8_IhEEEEvE6createINS4_ISE_NS8_ISE_EEEEJPKNS0_6detail8json_refISE_EESM_EEEPT_DpOT0_:
19681|    418|    {
19682|    418|        AllocatorType<T> alloc;
19683|    418|        using AllocatorTraits = std::allocator_traits<AllocatorType<T>>;
19684|       |
19685|    418|        auto deleter = [&](T * obj)
19686|    418|        {
19687|    418|            AllocatorTraits::deallocate(alloc, obj, 1);
19688|    418|        };
19689|    418|        std::unique_ptr<T, decltype(deleter)> obj(AllocatorTraits::allocate(alloc, 1), deleter);
19690|    418|        AllocatorTraits::construct(alloc, obj.get(), std::forward<Args>(args)...);
19691|       |        JSON_ASSERT(obj != nullptr);
  ------------------
  |  | 2552|    418|    #define JSON_ASSERT(x) assert(x)
  ------------------
19692|    418|        return obj.release();
19693|    418|    }
_ZN8nlohmann16json_abi_v3_11_310basic_jsonINS0_11ordered_mapENSt3__16vectorENS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEblmdS8_NS0_14adl_serializerENS4_IhNS8_IhEEEEvEC2EOSE_:
20517|   850k|        : json_base_class_t(std::forward<json_base_class_t>(other)),
20518|   850k|          m_data(std::move(other.m_data))
20519|   850k|    {
20520|       |        // check that passed value is valid
20521|   850k|        other.assert_invariant(false);
20522|       |
20523|       |        // invalidate payload
20524|   850k|        other.m_data.m_type = value_t::null;
20525|   850k|        other.m_data.m_value = {};
20526|       |
20527|   850k|        set_parents();
20528|   850k|        assert_invariant();
20529|   850k|    }
_ZN8nlohmann16json_abi_v3_11_310basic_jsonINS0_11ordered_mapENSt3__16vectorENS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEblmdS8_NS0_14adl_serializerENS4_IhNS8_IhEEEEvED2Ev:
20557|  1.34M|    {
20558|  1.34M|        assert_invariant(false);
20559|  1.34M|    }
_ZN8nlohmann16json_abi_v3_11_310basic_jsonINS0_11ordered_mapENSt3__16vectorENS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEblmdS8_NS0_14adl_serializerENS4_IhNS8_IhEEEEvEaSESE_:
20540|   109k|    {
20541|       |        // check that passed value is valid
20542|   109k|        other.assert_invariant();
20543|       |
20544|   109k|        using std::swap;
20545|   109k|        swap(m_data.m_type, other.m_data.m_type);
20546|   109k|        swap(m_data.m_value, other.m_data.m_value);
20547|   109k|        json_base_class_t::operator=(std::move(other));
20548|       |
20549|   109k|        set_parents();
20550|   109k|        assert_invariant();
20551|   109k|        return *this;
20552|   109k|    }
_ZN8nlohmann16json_abi_v3_11_310basic_jsonINS0_11ordered_mapENSt3__16vectorENS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEblmdS8_NS0_14adl_serializerENS4_IhNS8_IhEEEEvE6objectESt16initializer_listINS0_6detail8json_refISE_EEE:
20316|  54.8k|    {
20317|  54.8k|        return basic_json(init, false, value_t::object);
20318|  54.8k|    }
_ZN8nlohmann16json_abi_v3_11_310basic_jsonINS0_11ordered_mapENSt3__16vectorENS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEblmdS8_NS0_14adl_serializerENS4_IhNS8_IhEEEEvEC2EDn:
20126|   109k|        : basic_json(value_t::null)
20127|   109k|    {
20128|   109k|        assert_invariant();
20129|   109k|    }
_ZN8nlohmann16json_abi_v3_11_310basic_jsonINS0_11ordered_mapENSt3__16vectorENS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEblmdS8_NS0_14adl_serializerENS4_IhNS8_IhEEEEvEC2ENS0_6detail7value_tE:
20118|   109k|        : m_data(v)
20119|   109k|    {
20120|   109k|        assert_invariant();
20121|   109k|    }
_ZN8nlohmann16json_abi_v3_11_310basic_jsonINS0_11ordered_mapENSt3__16vectorENS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEblmdS8_NS0_14adl_serializerENS4_IhNS8_IhEEEEvE4dataC2ENS0_6detail7value_tE:
23500|   109k|            : m_type(v), m_value(v)
23501|   109k|        {
23502|   109k|        }
_ZN8nlohmann16json_abi_v3_11_310basic_jsonINS0_11ordered_mapENSt3__16vectorENS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEblmdS8_NS0_14adl_serializerENS4_IhNS8_IhEEEEvEC2IRPKcSH_TnNS3_9enable_ifIXaantsr6detail13is_basic_jsonIT0_EE5valuesr6detail18is_compatible_typeISE_SK_EE5valueEiE4typeELi0EEEOT_:
20140|   108k|    {
20141|   108k|        JSONSerializer<U>::to_json(*this, std::forward<CompatibleType>(val));
20142|   108k|        set_parents();
20143|   108k|        assert_invariant();
20144|   108k|    }
_ZN8nlohmann16json_abi_v3_11_314adl_serializerIPKcvE7to_jsonINS0_10basic_jsonINS0_11ordered_mapENSt3__16vectorENS8_12basic_stringIcNS8_11char_traitsIcEENS8_9allocatorIcEEEEblmdSD_S1_NS9_IhNSD_IhEEEEvEERS3_EEDTcmclL_ZNS0_7to_jsonEEfp_clsr3stdE7forwardIT0_Efp0_EEcvv_EERT_OSK_:
 5860|   108k|    {
 5861|   108k|        ::nlohmann::to_json(j, std::forward<TargetType>(val));
 5862|   108k|    }
_ZNK8nlohmann16json_abi_v3_11_36detail10to_json_fnclINS0_10basic_jsonINS0_11ordered_mapENSt3__16vectorENS6_12basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEEblmdSB_NS0_14adl_serializerENS7_IhNSB_IhEEEEvEERPKcEEDTcmcl7to_jsonfp_clsr3stdE7forwardIT0_Efp0_EEcvv_EERT_OSL_:
 5804|   108k|    {
 5805|   108k|        return to_json(j, std::forward<T>(val));
 5806|   108k|    }
_ZN8nlohmann16json_abi_v3_11_36detail7to_jsonINS0_10basic_jsonINS0_11ordered_mapENSt3__16vectorENS5_12basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEEblmdSA_NS0_14adl_serializerENS6_IhNSA_IhEEEEvEEPKcTnNS5_9enable_ifIXsr3std16is_constructibleINT_8string_tET0_EE5valueEiE4typeELi0EEEvRSK_RKSM_:
 5663|   108k|{
 5664|   108k|    external_constructor<value_t::string>::construct(j, s);
 5665|   108k|}
_ZN8nlohmann16json_abi_v3_11_36detail20external_constructorILNS1_7value_tE3EE9constructINS0_10basic_jsonINS0_11ordered_mapENSt3__16vectorENS8_12basic_stringIcNS8_11char_traitsIcEENS8_9allocatorIcEEEEblmdSD_NS0_14adl_serializerENS9_IhNSD_IhEEEEvEEPKcTnNS8_9enable_ifIXntsr3std7is_sameIT0_NT_8string_tEEE5valueEiE4typeELi0EEEvRSO_RKSN_:
 5459|   108k|    {
 5460|   108k|        j.m_data.m_value.destroy(j.m_data.m_type);
 5461|   108k|        j.m_data.m_type = value_t::string;
 5462|   108k|        j.m_data.m_value.string = j.template create<typename BasicJsonType::string_t>(str);
 5463|   108k|        j.assert_invariant();
 5464|   108k|    }
_ZN8nlohmann16json_abi_v3_11_310basic_jsonINS0_11ordered_mapENSt3__16vectorENS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEblmdS8_NS0_14adl_serializerENS4_IhNS8_IhEEEEvE6createISA_JRKPKcEEEPT_DpOT0_:
19681|   108k|    {
19682|   108k|        AllocatorType<T> alloc;
19683|   108k|        using AllocatorTraits = std::allocator_traits<AllocatorType<T>>;
19684|       |
19685|   108k|        auto deleter = [&](T * obj)
19686|   108k|        {
19687|   108k|            AllocatorTraits::deallocate(alloc, obj, 1);
19688|   108k|        };
19689|   108k|        std::unique_ptr<T, decltype(deleter)> obj(AllocatorTraits::allocate(alloc, 1), deleter);
19690|   108k|        AllocatorTraits::construct(alloc, obj.get(), std::forward<Args>(args)...);
19691|       |        JSON_ASSERT(obj != nullptr);
  ------------------
  |  | 2552|   108k|    #define JSON_ASSERT(x) assert(x)
  ------------------
19692|   108k|        return obj.release();
19693|   108k|    }
_ZNK8nlohmann16json_abi_v3_11_310basic_jsonINS0_11ordered_mapENSt3__16vectorENS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEblmdS8_NS0_14adl_serializerENS4_IhNS8_IhEEEEvE4dumpEicbNS0_6detail15error_handler_tE:
20578|    418|    {
20579|    418|        string_t result;
20580|    418|        serializer s(detail::output_adapter<char, string_t>(result), indent_char, error_handler);
20581|       |
20582|    418|        if (indent >= 0)
  ------------------
  |  Branch (20582:13): [True: 418, False: 0]
  ------------------
20583|    418|        {
20584|    418|            s.dump(*this, true, ensure_ascii, static_cast<unsigned int>(indent));
20585|    418|        }
20586|      0|        else
20587|      0|        {
20588|      0|            s.dump(*this, false, ensure_ascii, 0);
20589|      0|        }
20590|       |
20591|    418|        return result;
20592|    418|    }
_ZN8nlohmann16json_abi_v3_11_36detail14output_adapterIcNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEEC2ERS9_:
15049|    418|        : oa(std::make_shared<output_string_adapter<CharType, StringType>>(s)) {}
_ZN8nlohmann16json_abi_v3_11_36detail21output_string_adapterIcNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEEC2ERS9_:
15017|    418|        : str(s)
15018|    418|    {}
_ZN8nlohmann16json_abi_v3_11_36detail23output_adapter_protocolIcEC2Ev:
14950|    418|    output_adapter_protocol() = default;
_ZN8nlohmann16json_abi_v3_11_36detail23output_adapter_protocolIcED2Ev:
14948|    418|    virtual ~output_adapter_protocol() = default;
_ZN8nlohmann16json_abi_v3_11_36detail21output_string_adapterIcNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEE15write_characterEc:
15021|   437k|    {
15022|   437k|        str.push_back(c);
15023|   437k|    }
_ZN8nlohmann16json_abi_v3_11_36detail21output_string_adapterIcNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEE16write_charactersEPKcm:
15027|   709k|    {
15028|   709k|        str.append(s, length);
15029|   709k|    }
_ZN8nlohmann16json_abi_v3_11_36detail14output_adapterIcNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEEcvNS3_10shared_ptrINS1_23output_adapter_protocolIcEEEEEv:
15052|    418|    {
15053|    418|        return oa;
15054|    418|    }
_ZN8nlohmann16json_abi_v3_11_36detail10serializerINS0_10basic_jsonINS0_11ordered_mapENSt3__16vectorENS5_12basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEEblmdSA_NS0_14adl_serializerENS6_IhNSA_IhEEEEvEEEC2ENS5_10shared_ptrINS1_23output_adapter_protocolIcEEEEcNS1_15error_handler_tE:
18077|    418|        : o(std::move(s))
18078|    418|        , loc(std::localeconv())
18079|    418|        , thousands_sep(loc->thousands_sep == nullptr ? '\0' : std::char_traits<char>::to_char_type(* (loc->thousands_sep)))
  ------------------
  |  Branch (18079:25): [True: 0, False: 418]
  ------------------
18080|    418|        , decimal_point(loc->decimal_point == nullptr ? '\0' : std::char_traits<char>::to_char_type(* (loc->decimal_point)))
  ------------------
  |  Branch (18080:25): [True: 0, False: 418]
  ------------------
18081|    418|        , indent_char(ichar)
18082|    418|        , indent_string(512, indent_char)
18083|    418|        , error_handler(error_handler_)
18084|    418|    {}
_ZN8nlohmann16json_abi_v3_11_36detail10serializerINS0_10basic_jsonINS0_11ordered_mapENSt3__16vectorENS5_12basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEEblmdSA_NS0_14adl_serializerENS6_IhNSA_IhEEEEvEEE4dumpERKSG_bbjj:
18120|   164k|    {
18121|   164k|        switch (val.m_data.m_type)
18122|   164k|        {
18123|  54.8k|            case value_t::object:
  ------------------
  |  Branch (18123:13): [True: 54.8k, False: 109k]
  ------------------
18124|  54.8k|            {
18125|  54.8k|                if (val.m_data.m_value.object->empty())
  ------------------
  |  Branch (18125:21): [True: 0, False: 54.8k]
  ------------------
18126|      0|                {
18127|      0|                    o->write_characters("{}", 2);
18128|      0|                    return;
18129|      0|                }
18130|       |
18131|  54.8k|                if (pretty_print)
  ------------------
  |  Branch (18131:21): [True: 54.8k, False: 0]
  ------------------
18132|  54.8k|                {
18133|  54.8k|                    o->write_characters("{\n", 2);
18134|       |
18135|       |                    // variable to hold indentation for recursive calls
18136|  54.8k|                    const auto new_indent = current_indent + indent_step;
18137|  54.8k|                    if (JSON_HEDLEY_UNLIKELY(indent_string.size() < new_indent))
  ------------------
  |  | 1677|  54.8k|#  define JSON_HEDLEY_UNLIKELY(expr)                    __builtin_expect                 (!!(expr),    0                  )
  |  |  ------------------
  |  |  |  Branch (1677:57): [True: 0, False: 54.8k]
  |  |  ------------------
  ------------------
18138|      0|                    {
18139|      0|                        indent_string.resize(indent_string.size() * 2, ' ');
18140|      0|                    }
18141|       |
18142|       |                    // first n-1 elements
18143|  54.8k|                    auto i = val.m_data.m_value.object->cbegin();
18144|   109k|                    for (std::size_t cnt = 0; cnt < val.m_data.m_value.object->size() - 1; ++cnt, ++i)
  ------------------
  |  Branch (18144:47): [True: 54.3k, False: 54.8k]
  ------------------
18145|  54.3k|                    {
18146|  54.3k|                        o->write_characters(indent_string.c_str(), new_indent);
18147|  54.3k|                        o->write_character('\"');
18148|  54.3k|                        dump_escaped(i->first, ensure_ascii);
18149|  54.3k|                        o->write_characters("\": ", 3);
18150|  54.3k|                        dump(i->second, true, ensure_ascii, indent_step, new_indent);
18151|  54.3k|                        o->write_characters(",\n", 2);
18152|  54.3k|                    }
18153|       |
18154|       |                    // last element
18155|  54.8k|                    JSON_ASSERT(i != val.m_data.m_value.object->cend());
  ------------------
  |  | 2552|  54.8k|    #define JSON_ASSERT(x) assert(x)
  ------------------
18156|  54.8k|                    JSON_ASSERT(std::next(i) == val.m_data.m_value.object->cend());
  ------------------
  |  | 2552|  54.8k|    #define JSON_ASSERT(x) assert(x)
  ------------------
18157|  54.8k|                    o->write_characters(indent_string.c_str(), new_indent);
18158|  54.8k|                    o->write_character('\"');
18159|  54.8k|                    dump_escaped(i->first, ensure_ascii);
18160|  54.8k|                    o->write_characters("\": ", 3);
18161|  54.8k|                    dump(i->second, true, ensure_ascii, indent_step, new_indent);
18162|       |
18163|  54.8k|                    o->write_character('\n');
18164|  54.8k|                    o->write_characters(indent_string.c_str(), current_indent);
18165|  54.8k|                    o->write_character('}');
18166|  54.8k|                }
18167|      0|                else
18168|      0|                {
18169|      0|                    o->write_character('{');
18170|       |
18171|       |                    // first n-1 elements
18172|      0|                    auto i = val.m_data.m_value.object->cbegin();
18173|      0|                    for (std::size_t cnt = 0; cnt < val.m_data.m_value.object->size() - 1; ++cnt, ++i)
  ------------------
  |  Branch (18173:47): [True: 0, False: 0]
  ------------------
18174|      0|                    {
18175|      0|                        o->write_character('\"');
18176|      0|                        dump_escaped(i->first, ensure_ascii);
18177|      0|                        o->write_characters("\":", 2);
18178|      0|                        dump(i->second, false, ensure_ascii, indent_step, current_indent);
18179|      0|                        o->write_character(',');
18180|      0|                    }
18181|       |
18182|       |                    // last element
18183|      0|                    JSON_ASSERT(i != val.m_data.m_value.object->cend());
  ------------------
  |  | 2552|      0|    #define JSON_ASSERT(x) assert(x)
  ------------------
18184|      0|                    JSON_ASSERT(std::next(i) == val.m_data.m_value.object->cend());
  ------------------
  |  | 2552|      0|    #define JSON_ASSERT(x) assert(x)
  ------------------
18185|      0|                    o->write_character('\"');
18186|      0|                    dump_escaped(i->first, ensure_ascii);
18187|      0|                    o->write_characters("\":", 2);
18188|      0|                    dump(i->second, false, ensure_ascii, indent_step, current_indent);
18189|       |
18190|      0|                    o->write_character('}');
18191|      0|                }
18192|       |
18193|  54.8k|                return;
18194|  54.8k|            }
18195|       |
18196|    418|            case value_t::array:
  ------------------
  |  Branch (18196:13): [True: 418, False: 163k]
  ------------------
18197|    418|            {
18198|    418|                if (val.m_data.m_value.array->empty())
  ------------------
  |  Branch (18198:21): [True: 19, False: 399]
  ------------------
18199|     19|                {
18200|     19|                    o->write_characters("[]", 2);
18201|     19|                    return;
18202|     19|                }
18203|       |
18204|    399|                if (pretty_print)
  ------------------
  |  Branch (18204:21): [True: 399, False: 0]
  ------------------
18205|    399|                {
18206|    399|                    o->write_characters("[\n", 2);
18207|       |
18208|       |                    // variable to hold indentation for recursive calls
18209|    399|                    const auto new_indent = current_indent + indent_step;
18210|    399|                    if (JSON_HEDLEY_UNLIKELY(indent_string.size() < new_indent))
  ------------------
  |  | 1677|    399|#  define JSON_HEDLEY_UNLIKELY(expr)                    __builtin_expect                 (!!(expr),    0                  )
  |  |  ------------------
  |  |  |  Branch (1677:57): [True: 0, False: 399]
  |  |  ------------------
  ------------------
18211|      0|                    {
18212|      0|                        indent_string.resize(indent_string.size() * 2, ' ');
18213|      0|                    }
18214|       |
18215|       |                    // first n-1 elements
18216|    399|                    for (auto i = val.m_data.m_value.array->cbegin();
18217|  54.3k|                            i != val.m_data.m_value.array->cend() - 1; ++i)
  ------------------
  |  Branch (18217:29): [True: 53.9k, False: 399]
  ------------------
18218|  53.9k|                    {
18219|  53.9k|                        o->write_characters(indent_string.c_str(), new_indent);
18220|  53.9k|                        dump(*i, true, ensure_ascii, indent_step, new_indent);
18221|  53.9k|                        o->write_characters(",\n", 2);
18222|  53.9k|                    }
18223|       |
18224|       |                    // last element
18225|    399|                    JSON_ASSERT(!val.m_data.m_value.array->empty());
  ------------------
  |  | 2552|    399|    #define JSON_ASSERT(x) assert(x)
  ------------------
18226|    399|                    o->write_characters(indent_string.c_str(), new_indent);
18227|    399|                    dump(val.m_data.m_value.array->back(), true, ensure_ascii, indent_step, new_indent);
18228|       |
18229|    399|                    o->write_character('\n');
18230|    399|                    o->write_characters(indent_string.c_str(), current_indent);
18231|    399|                    o->write_character(']');
18232|    399|                }
18233|      0|                else
18234|      0|                {
18235|      0|                    o->write_character('[');
18236|       |
18237|       |                    // first n-1 elements
18238|      0|                    for (auto i = val.m_data.m_value.array->cbegin();
18239|      0|                            i != val.m_data.m_value.array->cend() - 1; ++i)
  ------------------
  |  Branch (18239:29): [True: 0, False: 0]
  ------------------
18240|      0|                    {
18241|      0|                        dump(*i, false, ensure_ascii, indent_step, current_indent);
18242|      0|                        o->write_character(',');
18243|      0|                    }
18244|       |
18245|       |                    // last element
18246|      0|                    JSON_ASSERT(!val.m_data.m_value.array->empty());
  ------------------
  |  | 2552|      0|    #define JSON_ASSERT(x) assert(x)
  ------------------
18247|      0|                    dump(val.m_data.m_value.array->back(), false, ensure_ascii, indent_step, current_indent);
18248|       |
18249|      0|                    o->write_character(']');
18250|      0|                }
18251|       |
18252|    399|                return;
18253|    418|            }
18254|       |
18255|   108k|            case value_t::string:
  ------------------
  |  Branch (18255:13): [True: 108k, False: 55.2k]
  ------------------
18256|   108k|            {
18257|   108k|                o->write_character('\"');
18258|   108k|                dump_escaped(*val.m_data.m_value.string, ensure_ascii);
18259|   108k|                o->write_character('\"');
18260|   108k|                return;
18261|    418|            }
18262|       |
18263|      0|            case value_t::binary:
  ------------------
  |  Branch (18263:13): [True: 0, False: 164k]
  ------------------
18264|      0|            {
18265|      0|                if (pretty_print)
  ------------------
  |  Branch (18265:21): [True: 0, False: 0]
  ------------------
18266|      0|                {
18267|      0|                    o->write_characters("{\n", 2);
18268|       |
18269|       |                    // variable to hold indentation for recursive calls
18270|      0|                    const auto new_indent = current_indent + indent_step;
18271|      0|                    if (JSON_HEDLEY_UNLIKELY(indent_string.size() < new_indent))
  ------------------
  |  | 1677|      0|#  define JSON_HEDLEY_UNLIKELY(expr)                    __builtin_expect                 (!!(expr),    0                  )
  |  |  ------------------
  |  |  |  Branch (1677:57): [True: 0, False: 0]
  |  |  ------------------
  ------------------
18272|      0|                    {
18273|      0|                        indent_string.resize(indent_string.size() * 2, ' ');
18274|      0|                    }
18275|       |
18276|      0|                    o->write_characters(indent_string.c_str(), new_indent);
18277|       |
18278|      0|                    o->write_characters("\"bytes\": [", 10);
18279|       |
18280|      0|                    if (!val.m_data.m_value.binary->empty())
  ------------------
  |  Branch (18280:25): [True: 0, False: 0]
  ------------------
18281|      0|                    {
18282|      0|                        for (auto i = val.m_data.m_value.binary->cbegin();
18283|      0|                                i != val.m_data.m_value.binary->cend() - 1; ++i)
  ------------------
  |  Branch (18283:33): [True: 0, False: 0]
  ------------------
18284|      0|                        {
18285|      0|                            dump_integer(*i);
18286|      0|                            o->write_characters(", ", 2);
18287|      0|                        }
18288|      0|                        dump_integer(val.m_data.m_value.binary->back());
18289|      0|                    }
18290|       |
18291|      0|                    o->write_characters("],\n", 3);
18292|      0|                    o->write_characters(indent_string.c_str(), new_indent);
18293|       |
18294|      0|                    o->write_characters("\"subtype\": ", 11);
18295|      0|                    if (val.m_data.m_value.binary->has_subtype())
  ------------------
  |  Branch (18295:25): [True: 0, False: 0]
  ------------------
18296|      0|                    {
18297|      0|                        dump_integer(val.m_data.m_value.binary->subtype());
18298|      0|                    }
18299|      0|                    else
18300|      0|                    {
18301|      0|                        o->write_characters("null", 4);
18302|      0|                    }
18303|      0|                    o->write_character('\n');
18304|      0|                    o->write_characters(indent_string.c_str(), current_indent);
18305|      0|                    o->write_character('}');
18306|      0|                }
18307|      0|                else
18308|      0|                {
18309|      0|                    o->write_characters("{\"bytes\":[", 10);
18310|       |
18311|      0|                    if (!val.m_data.m_value.binary->empty())
  ------------------
  |  Branch (18311:25): [True: 0, False: 0]
  ------------------
18312|      0|                    {
18313|      0|                        for (auto i = val.m_data.m_value.binary->cbegin();
18314|      0|                                i != val.m_data.m_value.binary->cend() - 1; ++i)
  ------------------
  |  Branch (18314:33): [True: 0, False: 0]
  ------------------
18315|      0|                        {
18316|      0|                            dump_integer(*i);
18317|      0|                            o->write_character(',');
18318|      0|                        }
18319|      0|                        dump_integer(val.m_data.m_value.binary->back());
18320|      0|                    }
18321|       |
18322|      0|                    o->write_characters("],\"subtype\":", 12);
18323|      0|                    if (val.m_data.m_value.binary->has_subtype())
  ------------------
  |  Branch (18323:25): [True: 0, False: 0]
  ------------------
18324|      0|                    {
18325|      0|                        dump_integer(val.m_data.m_value.binary->subtype());
18326|      0|                        o->write_character('}');
18327|      0|                    }
18328|      0|                    else
18329|      0|                    {
18330|      0|                        o->write_characters("null}", 5);
18331|      0|                    }
18332|      0|                }
18333|      0|                return;
18334|    418|            }
18335|       |
18336|      0|            case value_t::boolean:
  ------------------
  |  Branch (18336:13): [True: 0, False: 164k]
  ------------------
18337|      0|            {
18338|      0|                if (val.m_data.m_value.boolean)
  ------------------
  |  Branch (18338:21): [True: 0, False: 0]
  ------------------
18339|      0|                {
18340|      0|                    o->write_characters("true", 4);
18341|      0|                }
18342|      0|                else
18343|      0|                {
18344|      0|                    o->write_characters("false", 5);
18345|      0|                }
18346|      0|                return;
18347|    418|            }
18348|       |
18349|      0|            case value_t::number_integer:
  ------------------
  |  Branch (18349:13): [True: 0, False: 164k]
  ------------------
18350|      0|            {
18351|      0|                dump_integer(val.m_data.m_value.number_integer);
18352|      0|                return;
18353|    418|            }
18354|       |
18355|      0|            case value_t::number_unsigned:
  ------------------
  |  Branch (18355:13): [True: 0, False: 164k]
  ------------------
18356|      0|            {
18357|      0|                dump_integer(val.m_data.m_value.number_unsigned);
18358|      0|                return;
18359|    418|            }
18360|       |
18361|      0|            case value_t::number_float:
  ------------------
  |  Branch (18361:13): [True: 0, False: 164k]
  ------------------
18362|      0|            {
18363|      0|                dump_float(val.m_data.m_value.number_float);
18364|      0|                return;
18365|    418|            }
18366|       |
18367|      0|            case value_t::discarded:
  ------------------
  |  Branch (18367:13): [True: 0, False: 164k]
  ------------------
18368|      0|            {
18369|      0|                o->write_characters("<discarded>", 11);
18370|      0|                return;
18371|    418|            }
18372|       |
18373|      0|            case value_t::null:
  ------------------
  |  Branch (18373:13): [True: 0, False: 164k]
  ------------------
18374|      0|            {
18375|      0|                o->write_characters("null", 4);
18376|      0|                return;
18377|    418|            }
18378|       |
18379|      0|            default:            // LCOV_EXCL_LINE
  ------------------
  |  Branch (18379:13): [True: 0, False: 164k]
  ------------------
18380|       |                JSON_ASSERT(false); // NOLINT(cert-dcl03-c,hicpp-static-assert,misc-static-assert) LCOV_EXCL_LINE
  ------------------
  |  | 2552|      0|    #define JSON_ASSERT(x) assert(x)
  ------------------
18381|   164k|        }
18382|   164k|    }
_ZN8nlohmann16json_abi_v3_11_36detail10serializerINS0_10basic_jsonINS0_11ordered_mapENSt3__16vectorENS5_12basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEEblmdSA_NS0_14adl_serializerENS6_IhNSA_IhEEEEvEEE12dump_escapedERKSC_b:
18400|   217k|    {
18401|   217k|        std::uint32_t codepoint{};
18402|   217k|        std::uint8_t state = UTF8_ACCEPT;
18403|   217k|        std::size_t bytes = 0;  // number of bytes written to string_buffer
18404|       |
18405|       |        // number of bytes written at the point of the last valid byte
18406|   217k|        std::size_t bytes_after_last_accept = 0;
18407|   217k|        std::size_t undumped_chars = 0;
18408|       |
18409|  1.94M|        for (std::size_t i = 0; i < s.size(); ++i)
  ------------------
  |  Branch (18409:33): [True: 1.72M, False: 217k]
  ------------------
18410|  1.72M|        {
18411|  1.72M|            const auto byte = static_cast<std::uint8_t>(s[i]);
18412|       |
18413|  1.72M|            switch (decode(state, codepoint, byte))
18414|  1.72M|            {
18415|  1.72M|                case UTF8_ACCEPT:  // decode found a new code point
  ------------------
  |  Branch (18415:17): [True: 1.72M, False: 0]
  ------------------
18416|  1.72M|                {
18417|  1.72M|                    switch (codepoint)
18418|  1.72M|                    {
18419|      0|                        case 0x08: // backspace
  ------------------
  |  Branch (18419:25): [True: 0, False: 1.72M]
  ------------------
18420|      0|                        {
18421|      0|                            string_buffer[bytes++] = '\\';
18422|      0|                            string_buffer[bytes++] = 'b';
18423|      0|                            break;
18424|      0|                        }
18425|       |
18426|      0|                        case 0x09: // horizontal tab
  ------------------
  |  Branch (18426:25): [True: 0, False: 1.72M]
  ------------------
18427|      0|                        {
18428|      0|                            string_buffer[bytes++] = '\\';
18429|      0|                            string_buffer[bytes++] = 't';
18430|      0|                            break;
18431|      0|                        }
18432|       |
18433|      0|                        case 0x0A: // newline
  ------------------
  |  Branch (18433:25): [True: 0, False: 1.72M]
  ------------------
18434|      0|                        {
18435|      0|                            string_buffer[bytes++] = '\\';
18436|      0|                            string_buffer[bytes++] = 'n';
18437|      0|                            break;
18438|      0|                        }
18439|       |
18440|      0|                        case 0x0C: // formfeed
  ------------------
  |  Branch (18440:25): [True: 0, False: 1.72M]
  ------------------
18441|      0|                        {
18442|      0|                            string_buffer[bytes++] = '\\';
18443|      0|                            string_buffer[bytes++] = 'f';
18444|      0|                            break;
18445|      0|                        }
18446|       |
18447|      0|                        case 0x0D: // carriage return
  ------------------
  |  Branch (18447:25): [True: 0, False: 1.72M]
  ------------------
18448|      0|                        {
18449|      0|                            string_buffer[bytes++] = '\\';
18450|      0|                            string_buffer[bytes++] = 'r';
18451|      0|                            break;
18452|      0|                        }
18453|       |
18454|      0|                        case 0x22: // quotation mark
  ------------------
  |  Branch (18454:25): [True: 0, False: 1.72M]
  ------------------
18455|      0|                        {
18456|      0|                            string_buffer[bytes++] = '\\';
18457|      0|                            string_buffer[bytes++] = '\"';
18458|      0|                            break;
18459|      0|                        }
18460|       |
18461|      0|                        case 0x5C: // reverse solidus
  ------------------
  |  Branch (18461:25): [True: 0, False: 1.72M]
  ------------------
18462|      0|                        {
18463|      0|                            string_buffer[bytes++] = '\\';
18464|      0|                            string_buffer[bytes++] = '\\';
18465|      0|                            break;
18466|      0|                        }
18467|       |
18468|  1.72M|                        default:
  ------------------
  |  Branch (18468:25): [True: 1.72M, False: 0]
  ------------------
18469|  1.72M|                        {
18470|       |                            // escape control characters (0x00..0x1F) or, if
18471|       |                            // ensure_ascii parameter is used, non-ASCII characters
18472|  1.72M|                            if ((codepoint <= 0x1F) || (ensure_ascii && (codepoint >= 0x7F)))
  ------------------
  |  Branch (18472:33): [True: 0, False: 1.72M]
  |  Branch (18472:57): [True: 0, False: 1.72M]
  |  Branch (18472:73): [True: 0, False: 0]
  ------------------
18473|      0|                            {
18474|      0|                                if (codepoint <= 0xFFFF)
  ------------------
  |  Branch (18474:37): [True: 0, False: 0]
  ------------------
18475|      0|                                {
18476|       |                                    // NOLINTNEXTLINE(cppcoreguidelines-pro-type-vararg,hicpp-vararg)
18477|      0|                                    static_cast<void>((std::snprintf)(string_buffer.data() + bytes, 7, "\\u%04x",
18478|      0|                                                                      static_cast<std::uint16_t>(codepoint)));
18479|      0|                                    bytes += 6;
18480|      0|                                }
18481|      0|                                else
18482|      0|                                {
18483|       |                                    // NOLINTNEXTLINE(cppcoreguidelines-pro-type-vararg,hicpp-vararg)
18484|      0|                                    static_cast<void>((std::snprintf)(string_buffer.data() + bytes, 13, "\\u%04x\\u%04x",
18485|      0|                                                                      static_cast<std::uint16_t>(0xD7C0u + (codepoint >> 10u)),
18486|      0|                                                                      static_cast<std::uint16_t>(0xDC00u + (codepoint & 0x3FFu))));
18487|      0|                                    bytes += 12;
18488|      0|                                }
18489|      0|                            }
18490|  1.72M|                            else
18491|  1.72M|                            {
18492|       |                                // copy byte to buffer (all previous bytes
18493|       |                                // been copied have in default case above)
18494|  1.72M|                                string_buffer[bytes++] = s[i];
18495|  1.72M|                            }
18496|  1.72M|                            break;
18497|      0|                        }
18498|  1.72M|                    }
18499|       |
18500|       |                    // write buffer and reset index; there must be 13 bytes
18501|       |                    // left, as this is the maximal number of bytes to be
18502|       |                    // written ("\uxxxx\uxxxx\0") for one code point
18503|  1.72M|                    if (string_buffer.size() - bytes < 13)
  ------------------
  |  Branch (18503:25): [True: 0, False: 1.72M]
  ------------------
18504|      0|                    {
18505|      0|                        o->write_characters(string_buffer.data(), bytes);
18506|      0|                        bytes = 0;
18507|      0|                    }
18508|       |
18509|       |                    // remember the byte position of this accept
18510|  1.72M|                    bytes_after_last_accept = bytes;
18511|  1.72M|                    undumped_chars = 0;
18512|  1.72M|                    break;
18513|  1.72M|                }
18514|       |
18515|      0|                case UTF8_REJECT:  // decode found invalid UTF-8 byte
  ------------------
  |  Branch (18515:17): [True: 0, False: 1.72M]
  ------------------
18516|      0|                {
18517|      0|                    switch (error_handler)
18518|      0|                    {
18519|      0|                        case error_handler_t::strict:
  ------------------
  |  Branch (18519:25): [True: 0, False: 0]
  ------------------
18520|      0|                        {
18521|      0|                            JSON_THROW(type_error::create(316, concat("invalid UTF-8 byte at index ", std::to_string(i), ": 0x", hex_bytes(byte | 0)), nullptr));
  ------------------
  |  | 2517|      0|    #define JSON_THROW(exception) throw exception
  ------------------
18522|      0|                        }
18523|       |
18524|      0|                        case error_handler_t::ignore:
  ------------------
  |  Branch (18524:25): [True: 0, False: 0]
  ------------------
18525|      0|                        case error_handler_t::replace:
  ------------------
  |  Branch (18525:25): [True: 0, False: 0]
  ------------------
18526|      0|                        {
18527|       |                            // in case we saw this character the first time, we
18528|       |                            // would like to read it again, because the byte
18529|       |                            // may be OK for itself, but just not OK for the
18530|       |                            // previous sequence
18531|      0|                            if (undumped_chars > 0)
  ------------------
  |  Branch (18531:33): [True: 0, False: 0]
  ------------------
18532|      0|                            {
18533|      0|                                --i;
18534|      0|                            }
18535|       |
18536|       |                            // reset length buffer to the last accepted index;
18537|       |                            // thus removing/ignoring the invalid characters
18538|      0|                            bytes = bytes_after_last_accept;
18539|       |
18540|      0|                            if (error_handler == error_handler_t::replace)
  ------------------
  |  Branch (18540:33): [True: 0, False: 0]
  ------------------
18541|      0|                            {
18542|       |                                // add a replacement character
18543|      0|                                if (ensure_ascii)
  ------------------
  |  Branch (18543:37): [True: 0, False: 0]
  ------------------
18544|      0|                                {
18545|      0|                                    string_buffer[bytes++] = '\\';
18546|      0|                                    string_buffer[bytes++] = 'u';
18547|      0|                                    string_buffer[bytes++] = 'f';
18548|      0|                                    string_buffer[bytes++] = 'f';
18549|      0|                                    string_buffer[bytes++] = 'f';
18550|      0|                                    string_buffer[bytes++] = 'd';
18551|      0|                                }
18552|      0|                                else
18553|      0|                                {
18554|      0|                                    string_buffer[bytes++] = detail::binary_writer<BasicJsonType, char>::to_char_type('\xEF');
18555|      0|                                    string_buffer[bytes++] = detail::binary_writer<BasicJsonType, char>::to_char_type('\xBF');
18556|      0|                                    string_buffer[bytes++] = detail::binary_writer<BasicJsonType, char>::to_char_type('\xBD');
18557|      0|                                }
18558|       |
18559|       |                                // write buffer and reset index; there must be 13 bytes
18560|       |                                // left, as this is the maximal number of bytes to be
18561|       |                                // written ("\uxxxx\uxxxx\0") for one code point
18562|      0|                                if (string_buffer.size() - bytes < 13)
  ------------------
  |  Branch (18562:37): [True: 0, False: 0]
  ------------------
18563|      0|                                {
18564|      0|                                    o->write_characters(string_buffer.data(), bytes);
18565|      0|                                    bytes = 0;
18566|      0|                                }
18567|       |
18568|      0|                                bytes_after_last_accept = bytes;
18569|      0|                            }
18570|       |
18571|      0|                            undumped_chars = 0;
18572|       |
18573|       |                            // continue processing the string
18574|      0|                            state = UTF8_ACCEPT;
18575|      0|                            break;
18576|      0|                        }
18577|       |
18578|      0|                        default:            // LCOV_EXCL_LINE
  ------------------
  |  Branch (18578:25): [True: 0, False: 0]
  ------------------
18579|      0|                            JSON_ASSERT(false); // NOLINT(cert-dcl03-c,hicpp-static-assert,misc-static-assert) LCOV_EXCL_LINE
  ------------------
  |  | 2552|      0|    #define JSON_ASSERT(x) assert(x)
  ------------------
18580|      0|                    }
18581|      0|                    break;
18582|      0|                }
18583|       |
18584|      0|                default:  // decode found yet incomplete multi-byte code point
  ------------------
  |  Branch (18584:17): [True: 0, False: 1.72M]
  ------------------
18585|      0|                {
18586|      0|                    if (!ensure_ascii)
  ------------------
  |  Branch (18586:25): [True: 0, False: 0]
  ------------------
18587|      0|                    {
18588|       |                        // code point will not be escaped - copy byte to buffer
18589|      0|                        string_buffer[bytes++] = s[i];
18590|      0|                    }
18591|      0|                    ++undumped_chars;
18592|      0|                    break;
18593|      0|                }
18594|  1.72M|            }
18595|  1.72M|        }
18596|       |
18597|       |        // we finished processing the string
18598|   217k|        if (JSON_HEDLEY_LIKELY(state == UTF8_ACCEPT))
  ------------------
  |  | 1676|   217k|#  define JSON_HEDLEY_LIKELY(expr)                      __builtin_expect                 (!!(expr),    1                  )
  |  |  ------------------
  |  |  |  Branch (1676:57): [True: 217k, False: 0]
  |  |  ------------------
  ------------------
18599|   217k|        {
18600|       |            // write buffer
18601|   217k|            if (bytes > 0)
  ------------------
  |  Branch (18601:17): [True: 217k, False: 0]
  ------------------
18602|   217k|            {
18603|   217k|                o->write_characters(string_buffer.data(), bytes);
18604|   217k|            }
18605|   217k|        }
18606|      0|        else
18607|      0|        {
18608|       |            // we finish reading, but do not accept: string was incomplete
18609|      0|            switch (error_handler)
18610|      0|            {
18611|      0|                case error_handler_t::strict:
  ------------------
  |  Branch (18611:17): [True: 0, False: 0]
  ------------------
18612|      0|                {
18613|      0|                    JSON_THROW(type_error::create(316, concat("incomplete UTF-8 string; last byte: 0x", hex_bytes(static_cast<std::uint8_t>(s.back() | 0))), nullptr));
  ------------------
  |  | 2517|      0|    #define JSON_THROW(exception) throw exception
  ------------------
18614|      0|                }
18615|       |
18616|      0|                case error_handler_t::ignore:
  ------------------
  |  Branch (18616:17): [True: 0, False: 0]
  ------------------
18617|      0|                {
18618|       |                    // write all accepted bytes
18619|      0|                    o->write_characters(string_buffer.data(), bytes_after_last_accept);
18620|      0|                    break;
18621|      0|                }
18622|       |
18623|      0|                case error_handler_t::replace:
  ------------------
  |  Branch (18623:17): [True: 0, False: 0]
  ------------------
18624|      0|                {
18625|       |                    // write all accepted bytes
18626|      0|                    o->write_characters(string_buffer.data(), bytes_after_last_accept);
18627|       |                    // add a replacement character
18628|      0|                    if (ensure_ascii)
  ------------------
  |  Branch (18628:25): [True: 0, False: 0]
  ------------------
18629|      0|                    {
18630|      0|                        o->write_characters("\\ufffd", 6);
18631|      0|                    }
18632|      0|                    else
18633|      0|                    {
18634|      0|                        o->write_characters("\xEF\xBF\xBD", 3);
18635|      0|                    }
18636|      0|                    break;
18637|      0|                }
18638|       |
18639|      0|                default:            // LCOV_EXCL_LINE
  ------------------
  |  Branch (18639:17): [True: 0, False: 0]
  ------------------
18640|       |                    JSON_ASSERT(false); // NOLINT(cert-dcl03-c,hicpp-static-assert,misc-static-assert) LCOV_EXCL_LINE
  ------------------
  |  | 2552|      0|    #define JSON_ASSERT(x) assert(x)
  ------------------
18641|      0|            }
18642|      0|        }
18643|   217k|    }
_ZN8nlohmann16json_abi_v3_11_36detail10serializerINS0_10basic_jsonINS0_11ordered_mapENSt3__16vectorENS5_12basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEEblmdSA_NS0_14adl_serializerENS6_IhNSA_IhEEEEvEEE6decodeERhRjh:
18909|  1.72M|    {
18910|  1.72M|        static const std::array<std::uint8_t, 400> utf8d =
18911|  1.72M|        {
18912|  1.72M|            {
18913|  1.72M|                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 00..1F
18914|  1.72M|                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 20..3F
18915|  1.72M|                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 40..5F
18916|  1.72M|                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 60..7F
18917|  1.72M|                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, // 80..9F
18918|  1.72M|                7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, // A0..BF
18919|  1.72M|                8, 8, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, // C0..DF
18920|  1.72M|                0xA, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x4, 0x3, 0x3, // E0..EF
18921|  1.72M|                0xB, 0x6, 0x6, 0x6, 0x5, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, // F0..FF
18922|  1.72M|                0x0, 0x1, 0x2, 0x3, 0x5, 0x8, 0x7, 0x1, 0x1, 0x1, 0x4, 0x6, 0x1, 0x1, 0x1, 0x1, // s0..s0
18923|  1.72M|                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, // s1..s2
18924|  1.72M|                1, 2, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, // s3..s4
18925|  1.72M|                1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 3, 1, 1, 1, 1, 1, 1, // s5..s6
18926|  1.72M|                1, 3, 1, 1, 1, 1, 1, 3, 1, 3, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 // s7..s8
18927|  1.72M|            }
18928|  1.72M|        };
18929|       |
18930|  1.72M|        JSON_ASSERT(byte < utf8d.size());
  ------------------
  |  | 2552|  1.72M|    #define JSON_ASSERT(x) assert(x)
  ------------------
18931|  1.72M|        const std::uint8_t type = utf8d[byte];
18932|       |
18933|  1.72M|        codep = (state != UTF8_ACCEPT)
  ------------------
  |  Branch (18933:17): [True: 0, False: 1.72M]
  ------------------
18934|  1.72M|                ? (byte & 0x3fu) | (codep << 6u)
18935|  1.72M|                : (0xFFu >> type) & (byte);
18936|       |
18937|  1.72M|        const std::size_t index = 256u + static_cast<size_t>(state) * 16u + static_cast<size_t>(type);
18938|       |        JSON_ASSERT(index < utf8d.size());
  ------------------
  |  | 2552|  1.72M|    #define JSON_ASSERT(x) assert(x)
  ------------------
18939|  1.72M|        state = utf8d[index];
18940|  1.72M|        return state;
18941|  1.72M|    }
_ZN8nlohmann16json_abi_v3_11_36detail10serializerINS0_10basic_jsonINS0_11ordered_mapENSt3__16vectorENS5_12basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEEblmdSA_NS0_14adl_serializerENS6_IhNSA_IhEEEEvEEED2Ev:
18091|    418|    ~serializer() = default;

_ZN23pgp_password_provider_tC2EPFbPK18pgp_password_ctx_tPcmPvES4_:
   52|  4.44k|        : callback(cb), userdata(ud){};

_ZN10rnp_ffi_stC2EN3rnp9KeyFormatES1_:
  622|  4.44k|{
  623|  4.44k|    errs = stderr;
  624|  4.44k|    pubring = new rnp::KeyStore("", context, pub_fmt);
  625|  4.44k|    secring = new rnp::KeyStore("", context, sec_fmt);
  626|  4.44k|    getkeycb = NULL;
  627|  4.44k|    getkeycb_ctx = NULL;
  628|  4.44k|    getpasscb = NULL;
  629|       |    getpasscb_ctx = NULL;
  630|  4.44k|    key_provider.callback = ffi_key_provider;
  631|  4.44k|    key_provider.userdata = this;
  632|  4.44k|    pass_provider.callback = rnp_password_cb_bounce;
  633|  4.44k|    pass_provider.userdata = this;
  634|  4.44k|}
rnp_ffi_create:
  650|  4.44k|try {
  651|       |    // checks
  652|  4.44k|    if (!ffi || !pub_format || !sec_format) {
  ------------------
  |  Branch (652:9): [True: 0, False: 4.44k]
  |  Branch (652:17): [True: 0, False: 4.44k]
  |  Branch (652:32): [True: 0, False: 4.44k]
  ------------------
  653|      0|        return RNP_ERROR_NULL_POINTER;
  654|      0|    }
  655|       |
  656|  4.44k|    auto pub_ks_format = rnp::KeyFormat::Unknown;
  657|  4.44k|    auto sec_ks_format = rnp::KeyFormat::Unknown;
  658|  4.44k|    if (!parse_ks_format(&pub_ks_format, pub_format) ||
  ------------------
  |  Branch (658:9): [True: 0, False: 4.44k]
  ------------------
  659|  4.44k|        !parse_ks_format(&sec_ks_format, sec_format)) {
  ------------------
  |  Branch (659:9): [True: 0, False: 4.44k]
  ------------------
  660|      0|        return RNP_ERROR_BAD_PARAMETERS;
  661|      0|    }
  662|       |
  663|  4.44k|    struct rnp_ffi_st *ob = new rnp_ffi_st(pub_ks_format, sec_ks_format);
  664|  4.44k|    *ffi = ob;
  665|  4.44k|    return RNP_SUCCESS;
  666|  4.44k|}
  667|  4.44k|FFI_GUARD
  ------------------
  |  |  619|  4.44k|#define FFI_GUARD FFI_GUARD_FP((stderr))
  |  |  ------------------
  |  |  |  |  602|  4.44k|    catch (rnp::rnp_exception & e)                                                  \
  |  |  |  |  603|  4.44k|    {                                                                               \
  |  |  |  |  604|      0|        return ffi_exception((fp), __func__, e.what(), e.code());                   \
  |  |  |  |  605|      0|    }                                                                               \
  |  |  |  |  606|  4.44k|    catch (std::bad_alloc &)                                                        \
  |  |  |  |  607|  4.44k|    {                                                                               \
  |  |  |  |  608|      0|        return ffi_exception((fp), __func__, "bad_alloc", RNP_ERROR_OUT_OF_MEMORY); \
  |  |  |  |  609|      0|    }                                                                               \
  |  |  |  |  610|  4.44k|    catch (std::exception & e)                                                      \
  |  |  |  |  611|  4.44k|    {                                                                               \
  |  |  |  |  612|      0|        return ffi_exception((fp), __func__, e.what());                             \
  |  |  |  |  613|      0|    }                                                                               \
  |  |  |  |  614|  4.44k|    catch (...)                                                                     \
  |  |  |  |  615|  4.44k|    {                                                                               \
  |  |  |  |  616|      0|        return ffi_exception((fp), __func__, "unknown exception");                  \
  |  |  |  |  617|      0|    }
  |  |  ------------------
  ------------------
_ZN10rnp_ffi_stD2Ev:
  685|  4.44k|{
  686|  4.44k|    close_io_file(&errs);
  687|  4.44k|    delete pubring;
  688|  4.44k|    delete secring;
  689|  4.44k|}
rnp_ffi_destroy:
  693|  4.44k|try {
  694|  4.44k|    if (ffi) {
  ------------------
  |  Branch (694:9): [True: 4.44k, False: 0]
  ------------------
  695|  4.44k|        delete ffi;
  696|  4.44k|    }
  697|  4.44k|    return RNP_SUCCESS;
  698|  4.44k|}
  699|  4.44k|FFI_GUARD
  ------------------
  |  |  619|  4.44k|#define FFI_GUARD FFI_GUARD_FP((stderr))
  |  |  ------------------
  |  |  |  |  602|  4.44k|    catch (rnp::rnp_exception & e)                                                  \
  |  |  |  |  603|  4.44k|    {                                                                               \
  |  |  |  |  604|      0|        return ffi_exception((fp), __func__, e.what(), e.code());                   \
  |  |  |  |  605|      0|    }                                                                               \
  |  |  |  |  606|  4.44k|    catch (std::bad_alloc &)                                                        \
  |  |  |  |  607|  4.44k|    {                                                                               \
  |  |  |  |  608|      0|        return ffi_exception((fp), __func__, "bad_alloc", RNP_ERROR_OUT_OF_MEMORY); \
  |  |  |  |  609|      0|    }                                                                               \
  |  |  |  |  610|  4.44k|    catch (std::exception & e)                                                      \
  |  |  |  |  611|  4.44k|    {                                                                               \
  |  |  |  |  612|      0|        return ffi_exception((fp), __func__, e.what());                             \
  |  |  |  |  613|      0|    }                                                                               \
  |  |  |  |  614|  4.44k|    catch (...)                                                                     \
  |  |  |  |  615|  4.44k|    {                                                                               \
  |  |  |  |  616|      0|        return ffi_exception((fp), __func__, "unknown exception");                  \
  |  |  |  |  617|      0|    }
  |  |  ------------------
  ------------------
rnp_import_signatures:
 2029|  4.44k|try {
 2030|  4.44k|    if (!ffi || !input) {
  ------------------
  |  Branch (2030:9): [True: 0, False: 4.44k]
  |  Branch (2030:17): [True: 0, False: 4.44k]
  ------------------
 2031|      0|        return RNP_ERROR_NULL_POINTER;
 2032|      0|    }
 2033|  4.44k|    if (flags) {
  ------------------
  |  Branch (2033:9): [True: 0, False: 4.44k]
  ------------------
 2034|      0|        FFI_LOG(ffi, "wrong flags: %d", (int) flags);
  ------------------
  |  |   68|      0|    do {                             \
  |  |   69|      0|        FILE *fp = stderr;           \
  |  |   70|      0|        if (ffi && ffi->errs) {      \
  |  |  ------------------
  |  |  |  Branch (70:13): [True: 0, False: 0]
  |  |  |  Branch (70:20): [True: 0, False: 0]
  |  |  ------------------
  |  |   71|      0|            fp = ffi->errs;          \
  |  |   72|      0|        }                            \
  |  |   73|      0|        RNP_LOG_FD(fp, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  |   76|      0|    do {                                                                                 \
  |  |  |  |   77|      0|        if (!rnp_log_switch())                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   78|      0|            break;                                                                       \
  |  |  |  |   79|      0|        (void) fprintf((fd), "[%s() %s:%d] ", __func__, __SOURCE_PATH_FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define __SOURCE_PATH_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        (void) fprintf((fd), __VA_ARGS__);                                               \
  |  |  |  |   81|      0|        (void) fprintf((fd), "\n");                                                      \
  |  |  |  |   82|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   74|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (74:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2035|      0|        return RNP_ERROR_BAD_PARAMETERS;
 2036|      0|    }
 2037|       |
 2038|  4.44k|    pgp::pkt::Signatures sigs;
 2039|  4.44k|    rnp_result_t         sigret = process_pgp_signatures(input->src, sigs);
 2040|  4.44k|    if (sigret) {
  ------------------
  |  Branch (2040:9): [True: 3.10k, False: 1.34k]
  ------------------
 2041|  3.10k|        FFI_LOG(ffi, "failed to parse signature(s)");
  ------------------
  |  |   68|  3.10k|    do {                             \
  |  |   69|  3.10k|        FILE *fp = stderr;           \
  |  |   70|  3.10k|        if (ffi && ffi->errs) {      \
  |  |  ------------------
  |  |  |  Branch (70:13): [True: 3.10k, False: 0]
  |  |  |  Branch (70:20): [True: 3.10k, False: 0]
  |  |  ------------------
  |  |   71|  3.10k|            fp = ffi->errs;          \
  |  |   72|  3.10k|        }                            \
  |  |   73|  3.10k|        RNP_LOG_FD(fp, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  |   76|  3.10k|    do {                                                                                 \
  |  |  |  |   77|  3.10k|        if (!rnp_log_switch())                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:13): [True: 3.10k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   78|  3.10k|            break;                                                                       \
  |  |  |  |   79|  3.10k|        (void) fprintf((fd), "[%s() %s:%d] ", __func__, __SOURCE_PATH_FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define __SOURCE_PATH_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        (void) fprintf((fd), __VA_ARGS__);                                               \
  |  |  |  |   81|      0|        (void) fprintf((fd), "\n");                                                      \
  |  |  |  |   82|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   74|  3.10k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (74:14): [Folded, False: 3.10k]
  |  |  ------------------
  ------------------
 2042|  3.10k|        return sigret;
 2043|  3.10k|    }
 2044|       |
 2045|  1.34k|    nlohmann::ordered_json jsores = nlohmann::ordered_json::object();
 2046|  1.34k|    jsores["sigs"] = nlohmann::ordered_json::array();
 2047|  1.34k|    nlohmann::ordered_json &jsosigs = jsores["sigs"];
 2048|       |
 2049|  54.3k|    for (auto &sig : sigs) {
  ------------------
  |  Branch (2049:20): [True: 54.3k, False: 1.34k]
  ------------------
 2050|  54.3k|        pgp_sig_import_status_t pub_status = PGP_SIG_IMPORT_STATUS_UNKNOWN;
 2051|  54.3k|        pgp_sig_import_status_t sec_status = PGP_SIG_IMPORT_STATUS_UNKNOWN;
 2052|  54.3k|        auto *                  pkey = ffi->pubring->import_signature(sig, &pub_status);
 2053|  54.3k|        auto *                  skey = ffi->secring->import_signature(sig, &sec_status);
 2054|  54.3k|        sigret = add_sig_status(jsosigs, pkey ? pkey : skey, pub_status, sec_status);
  ------------------
  |  Branch (2054:42): [True: 0, False: 54.3k]
  ------------------
 2055|  54.3k|        if (sigret) {
  ------------------
  |  Branch (2055:13): [True: 0, False: 54.3k]
  ------------------
 2056|      0|            return sigret; // LCOV_EXCL_LINE
 2057|      0|        }
 2058|  54.3k|    }
 2059|  1.34k|    if (!results) {
  ------------------
  |  Branch (2059:9): [True: 0, False: 1.34k]
  ------------------
 2060|      0|        return RNP_SUCCESS;
 2061|      0|    }
 2062|  1.34k|    return ret_str_value(rnp::json::dump_pretty(jsores).c_str(), results);
 2063|  1.34k|}
 2064|  4.44k|FFI_GUARD
  ------------------
  |  |  619|  4.44k|#define FFI_GUARD FFI_GUARD_FP((stderr))
  |  |  ------------------
  |  |  |  |  602|  4.44k|    catch (rnp::rnp_exception & e)                                                  \
  |  |  |  |  603|  4.44k|    {                                                                               \
  |  |  |  |  604|    923|        return ffi_exception((fp), __func__, e.what(), e.code());                   \
  |  |  |  |  605|    923|    }                                                                               \
  |  |  |  |  606|  4.44k|    catch (std::bad_alloc &)                                                        \
  |  |  |  |  607|  4.44k|    {                                                                               \
  |  |  |  |  608|      0|        return ffi_exception((fp), __func__, "bad_alloc", RNP_ERROR_OUT_OF_MEMORY); \
  |  |  |  |  609|      0|    }                                                                               \
  |  |  |  |  610|  4.44k|    catch (std::exception & e)                                                      \
  |  |  |  |  611|  4.44k|    {                                                                               \
  |  |  |  |  612|      0|        return ffi_exception((fp), __func__, e.what());                             \
  |  |  |  |  613|      0|    }                                                                               \
  |  |  |  |  614|  4.44k|    catch (...)                                                                     \
  |  |  |  |  615|  4.44k|    {                                                                               \
  |  |  |  |  616|      0|        return ffi_exception((fp), __func__, "unknown exception");                  \
  |  |  |  |  617|      0|    }
  |  |  ------------------
  ------------------
_ZN12rnp_input_stC2Ev:
 2240|  4.44k|rnp_input_st::rnp_input_st() : reader(NULL), closer(NULL), app_ctx(NULL)
 2241|  4.44k|{
 2242|  4.44k|    memset(&src, 0, sizeof(src));
 2243|  4.44k|}
_ZN12rnp_input_stD2Ev:
 2262|  4.44k|{
 2263|  4.44k|    bool armored = src.type == PGP_STREAM_ARMORED;
 2264|  4.44k|    src.close();
 2265|  4.44k|    if (armored) {
  ------------------
  |  Branch (2265:9): [True: 0, False: 4.44k]
  ------------------
 2266|      0|        rnp_input_t armored = (rnp_input_t) app_ctx;
 2267|      0|        delete armored;
 2268|       |        app_ctx = NULL;
 2269|      0|    }
 2270|  4.44k|}
rnp_input_from_memory:
 2319|  4.44k|try {
 2320|  4.44k|    if (!input) {
  ------------------
  |  Branch (2320:9): [True: 0, False: 4.44k]
  ------------------
 2321|      0|        return RNP_ERROR_NULL_POINTER;
 2322|      0|    }
 2323|  4.44k|    if (!buf && buf_len) {
  ------------------
  |  Branch (2323:9): [True: 0, False: 4.44k]
  |  Branch (2323:17): [True: 0, False: 0]
  ------------------
 2324|      0|        return RNP_ERROR_NULL_POINTER;
 2325|      0|    }
 2326|  4.44k|    if (!buf_len) {
  ------------------
  |  Branch (2326:9): [True: 0, False: 4.44k]
  ------------------
 2327|       |        // prevent malloc(0)
 2328|      0|        do_copy = false;
 2329|      0|    }
 2330|  4.44k|    *input = new rnp_input_st();
 2331|  4.44k|    uint8_t *data = (uint8_t *) buf;
 2332|  4.44k|    if (do_copy) {
  ------------------
  |  Branch (2332:9): [True: 0, False: 4.44k]
  ------------------
 2333|      0|        data = (uint8_t *) malloc(buf_len);
 2334|      0|        if (!data) {
  ------------------
  |  Branch (2334:13): [True: 0, False: 0]
  ------------------
 2335|       |            /* LCOV_EXCL_START */
 2336|      0|            delete *input;
 2337|      0|            *input = NULL;
 2338|      0|            return RNP_ERROR_OUT_OF_MEMORY;
 2339|       |            /* LCOV_EXCL_END */
 2340|      0|        }
 2341|      0|        memcpy(data, buf, buf_len);
 2342|      0|    }
 2343|  4.44k|    rnp_result_t ret = init_mem_src(&(*input)->src, data, buf_len, do_copy);
 2344|  4.44k|    if (ret) {
  ------------------
  |  Branch (2344:9): [True: 0, False: 4.44k]
  ------------------
 2345|       |        /* LCOV_EXCL_START */
 2346|      0|        if (do_copy) {
  ------------------
  |  Branch (2346:13): [True: 0, False: 0]
  ------------------
 2347|      0|            free(data);
 2348|      0|        }
 2349|      0|        delete *input;
 2350|      0|        *input = NULL;
 2351|       |        /* LCOV_EXCL_END */
 2352|      0|    }
 2353|  4.44k|    return ret;
 2354|  4.44k|}
 2355|  4.44k|FFI_GUARD
  ------------------
  |  |  619|  4.44k|#define FFI_GUARD FFI_GUARD_FP((stderr))
  |  |  ------------------
  |  |  |  |  602|  4.44k|    catch (rnp::rnp_exception & e)                                                  \
  |  |  |  |  603|  4.44k|    {                                                                               \
  |  |  |  |  604|      0|        return ffi_exception((fp), __func__, e.what(), e.code());                   \
  |  |  |  |  605|      0|    }                                                                               \
  |  |  |  |  606|  4.44k|    catch (std::bad_alloc &)                                                        \
  |  |  |  |  607|  4.44k|    {                                                                               \
  |  |  |  |  608|      0|        return ffi_exception((fp), __func__, "bad_alloc", RNP_ERROR_OUT_OF_MEMORY); \
  |  |  |  |  609|      0|    }                                                                               \
  |  |  |  |  610|  4.44k|    catch (std::exception & e)                                                      \
  |  |  |  |  611|  4.44k|    {                                                                               \
  |  |  |  |  612|      0|        return ffi_exception((fp), __func__, e.what());                             \
  |  |  |  |  613|      0|    }                                                                               \
  |  |  |  |  614|  4.44k|    catch (...)                                                                     \
  |  |  |  |  615|  4.44k|    {                                                                               \
  |  |  |  |  616|      0|        return ffi_exception((fp), __func__, "unknown exception");                  \
  |  |  |  |  617|      0|    }
  |  |  ------------------
  ------------------
rnp_input_destroy:
 2408|  4.44k|try {
 2409|  4.44k|    delete input;
 2410|  4.44k|    return RNP_SUCCESS;
 2411|  4.44k|}
 2412|  4.44k|FFI_GUARD
  ------------------
  |  |  619|  4.44k|#define FFI_GUARD FFI_GUARD_FP((stderr))
  |  |  ------------------
  |  |  |  |  602|  4.44k|    catch (rnp::rnp_exception & e)                                                  \
  |  |  |  |  603|  4.44k|    {                                                                               \
  |  |  |  |  604|      0|        return ffi_exception((fp), __func__, e.what(), e.code());                   \
  |  |  |  |  605|      0|    }                                                                               \
  |  |  |  |  606|  4.44k|    catch (std::bad_alloc &)                                                        \
  |  |  |  |  607|  4.44k|    {                                                                               \
  |  |  |  |  608|      0|        return ffi_exception((fp), __func__, "bad_alloc", RNP_ERROR_OUT_OF_MEMORY); \
  |  |  |  |  609|      0|    }                                                                               \
  |  |  |  |  610|  4.44k|    catch (std::exception & e)                                                      \
  |  |  |  |  611|  4.44k|    {                                                                               \
  |  |  |  |  612|      0|        return ffi_exception((fp), __func__, e.what());                             \
  |  |  |  |  613|      0|    }                                                                               \
  |  |  |  |  614|  4.44k|    catch (...)                                                                     \
  |  |  |  |  615|  4.44k|    {                                                                               \
  |  |  |  |  616|      0|        return ffi_exception((fp), __func__, "unknown exception");                  \
  |  |  |  |  617|      0|    }
  |  |  ------------------
  ------------------
rnp_buffer_destroy:
 5886|  4.44k|{
 5887|  4.44k|    free(ptr);
 5888|  4.44k|}
rnp.cpp:_ZL15parse_ks_formatPN3rnp9KeyFormatEPKc:
  509|  8.88k|{
  510|  8.88k|    if (!strcmp(format, RNP_KEYSTORE_GPG)) {
  ------------------
  |  | 4375|  8.88k|#define RNP_KEYSTORE_GPG ("GPG")
  ------------------
  |  Branch (510:9): [True: 8.88k, False: 0]
  ------------------
  511|  8.88k|        *key_store_format = rnp::KeyFormat::GPG;
  512|  8.88k|    } else if (!strcmp(format, RNP_KEYSTORE_KBX)) {
  ------------------
  |  | 4376|      0|#define RNP_KEYSTORE_KBX ("KBX")
  ------------------
  |  Branch (512:16): [True: 0, False: 0]
  ------------------
  513|      0|        *key_store_format = rnp::KeyFormat::KBX;
  514|      0|    } else if (!strcmp(format, RNP_KEYSTORE_G10)) {
  ------------------
  |  | 4377|      0|#define RNP_KEYSTORE_G10 ("G10")
  ------------------
  |  Branch (514:16): [True: 0, False: 0]
  ------------------
  515|      0|        *key_store_format = rnp::KeyFormat::G10;
  516|      0|    } else {
  517|      0|        return false;
  518|      0|    }
  519|  8.88k|    return true;
  520|  8.88k|}
rnp.cpp:_ZL13ffi_exceptionP8_IO_FILEPKcS2_j:
  593|    923|{
  594|    923|    if (rnp_log_switch()) {
  ------------------
  |  Branch (594:9): [True: 0, False: 923]
  ------------------
  595|      0|        fprintf(
  596|      0|          fp, "[%s()] Error 0x%08X (%s): %s\n", func, ret, rnp_result_to_string(ret), msg);
  597|      0|    }
  598|    923|    return ret;
  599|    923|}
rnp.cpp:_ZL13close_io_filePP8_IO_FILE:
  677|  4.44k|{
  678|  4.44k|    if (*fp && !is_std_file(*fp)) {
  ------------------
  |  Branch (678:9): [True: 4.44k, False: 0]
  |  Branch (678:16): [True: 0, False: 4.44k]
  ------------------
  679|      0|        fclose(*fp);
  680|      0|    }
  681|       |    *fp = NULL;
  682|  4.44k|}
rnp.cpp:_ZL11is_std_fileP8_IO_FILE:
  671|  4.44k|{
  672|  4.44k|    return fp == stdout || fp == stderr;
  ------------------
  |  Branch (672:12): [True: 0, False: 4.44k]
  |  Branch (672:28): [True: 4.44k, False: 0]
  ------------------
  673|  4.44k|}
rnp.cpp:_ZL13ret_str_valuePKcPPc:
  542|    418|{
  543|    418|    if (!str) {
  ------------------
  |  Branch (543:9): [True: 0, False: 418]
  ------------------
  544|      0|        return RNP_ERROR_BAD_PARAMETERS;
  545|      0|    }
  546|    418|    char *strcp = strdup(str);
  547|    418|    if (!strcp) {
  ------------------
  |  Branch (547:9): [True: 0, False: 418]
  ------------------
  548|      0|        *res = NULL;                    // LCOV_EXCL_LINE
  549|      0|        return RNP_ERROR_OUT_OF_MEMORY; // LCOV_EXCL_LINE
  550|      0|    }
  551|    418|    *res = strcp;
  552|    418|    return RNP_SUCCESS;
  553|    418|}
rnp.cpp:_ZL14add_sig_statusRN8nlohmann16json_abi_v3_11_310basic_jsonINS0_11ordered_mapENSt3__16vectorENS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEblmdS8_NS0_14adl_serializerENS4_IhNS8_IhEEEEvEEPKN3rnp3KeyE23pgp_sig_import_status_tSK_:
 2002|  54.3k|{
 2003|  54.3k|    nlohmann::ordered_json jsosig = nlohmann::ordered_json::object();
 2004|       |
 2005|  54.3k|    if (!rnp::json::add(jsosig, "public", sig_status_to_str(pub)) ||
  ------------------
  |  Branch (2005:9): [True: 0, False: 54.3k]
  ------------------
 2006|  54.3k|        !rnp::json::add(jsosig, "secret", sig_status_to_str(sec))) {
  ------------------
  |  Branch (2006:9): [True: 0, False: 54.3k]
  ------------------
 2007|       |        /* LCOV_EXCL_START */
 2008|      0|        return RNP_ERROR_OUT_OF_MEMORY;
 2009|       |        /* LCOV_EXCL_END */
 2010|      0|    }
 2011|       |
 2012|  54.3k|    if (signer && !rnp::json::add(jsosig, "signer fingerprint", signer->fp())) {
  ------------------
  |  Branch (2012:9): [True: 0, False: 54.3k]
  |  Branch (2012:19): [True: 0, False: 0]
  ------------------
 2013|       |        /* LCOV_EXCL_START */
 2014|      0|        return RNP_ERROR_OUT_OF_MEMORY;
 2015|       |        /* LCOV_EXCL_END */
 2016|      0|    }
 2017|       |
 2018|  54.3k|    if (!rnp::json::array_add(sigs, jsosig)) {
  ------------------
  |  Branch (2018:9): [True: 0, False: 54.3k]
  ------------------
 2019|       |        /* LCOV_EXCL_START */
 2020|      0|        return RNP_ERROR_OUT_OF_MEMORY;
 2021|       |        /* LCOV_EXCL_END */
 2022|      0|    }
 2023|       |
 2024|  54.3k|    return RNP_SUCCESS;
 2025|  54.3k|}
rnp.cpp:_ZL17sig_status_to_str23pgp_sig_import_status_t:
 1990|   108k|{
 1991|   108k|    if (status == PGP_SIG_IMPORT_STATUS_UNKNOWN) {
  ------------------
  |  Branch (1991:9): [True: 18.0k, False: 90.7k]
  ------------------
 1992|  18.0k|        return "none";
 1993|  18.0k|    }
 1994|  90.7k|    return id_str_pair::lookup(sig_import_status_map, status, "none");
 1995|   108k|}

_ZN3rnp15SecurityProfile8add_ruleEONS_12SecurityRuleE:
   75|  35.5k|{
   76|  35.5k|    rules_.emplace_back(rule);
   77|  35.5k|    return rules_.back();
   78|  35.5k|}
_ZN3rnp15SecurityContextC2Ev:
  185|  4.44k|SecurityContext::SecurityContext() : time_(0), prov_state_(NULL), rng(RNG::Type::DRBG)
  186|  4.44k|{
  187|       |    /* Initialize crypto provider if needed (currently only for OpenSSL 3.0) */
  188|  4.44k|    if (!rnp::backend_init(&prov_state_)) {
  ------------------
  |  Branch (188:9): [True: 0, False: 4.44k]
  ------------------
  189|      0|        throw rnp::rnp_exception(RNP_ERROR_BAD_STATE);
  190|      0|    }
  191|       |    /* Mark SHA-1 data signature insecure since 2019-01-19, as GnuPG does */
  192|  4.44k|    profile.add_rule({FeatureType::Hash,
  193|  4.44k|                      PGP_HASH_SHA1,
  194|  4.44k|                      SecurityLevel::Insecure,
  195|  4.44k|                      1547856000,
  196|  4.44k|                      SecurityAction::VerifyData});
  197|       |    /* Mark SHA-1 key signature insecure since 2024-01-19 by default */
  198|  4.44k|    profile.add_rule({FeatureType::Hash,
  199|  4.44k|                      PGP_HASH_SHA1,
  200|  4.44k|                      SecurityLevel::Insecure,
  201|  4.44k|                      1705629600,
  202|  4.44k|                      SecurityAction::VerifyKey});
  203|       |    /* Mark MD5 insecure since 2012-01-01 */
  204|  4.44k|    profile.add_rule({FeatureType::Hash, PGP_HASH_MD5, SecurityLevel::Insecure, 1325376000});
  205|       |    /* Mark CAST5, 3DES, IDEA, BLOWFISH insecure since 2024-10-01*/
  206|  4.44k|    profile.add_rule({FeatureType::Cipher, PGP_SA_CAST5, SecurityLevel::Insecure, 1727730000});
  207|  4.44k|    profile.add_rule(
  208|  4.44k|      {FeatureType::Cipher, PGP_SA_TRIPLEDES, SecurityLevel::Insecure, 1727730000});
  209|  4.44k|    profile.add_rule({FeatureType::Cipher, PGP_SA_IDEA, SecurityLevel::Insecure, 1727730000});
  210|  4.44k|    profile.add_rule(
  211|  4.44k|      {FeatureType::Cipher, PGP_SA_BLOWFISH, SecurityLevel::Insecure, 1727730000});
  212|  4.44k|#if defined(ENABLE_CRYPTO_REFRESH)
  213|       |    /* Mark RIPEMD insecure since 2024-01-19 by default */
  214|  4.44k|    profile.add_rule(
  215|  4.44k|      {FeatureType::Hash, PGP_HASH_RIPEMD, SecurityLevel::Insecure, 1705629600});
  216|  4.44k|#endif
  217|       |#if defined(RNP_FIPS_MODE)
  218|       |    /*
  219|       |     * FIPS-compliant defaults: mark non-FIPS-approved algorithms as Disabled
  220|       |     * (not merely Insecure) so they cannot be used at all. These rules have
  221|       |     * from = 0, so they apply to objects regardless of creation time. The
  222|       |     * caller may still relax individual rules via rnp_add_security_rule() with
  223|       |     * the RNP_SECURITY_OVERRIDE flag, but the defaults are intentionally
  224|       |     * strict. See docs/security.adoc for the certification boundary.
  225|       |     *
  226|       |     * Note: this enforces rnp's policy on top of OpenSSL's validated module.
  227|       |     * It does not by itself make rnp a FIPS-validated module.
  228|       |     */
  229|       |    /* Non-FIPS symmetric algorithms */
  230|       |    profile.add_rule({FeatureType::Cipher, PGP_SA_TWOFISH, SecurityLevel::Disabled, 0});
  231|       |    profile.add_rule({FeatureType::Cipher, PGP_SA_CAST5, SecurityLevel::Disabled, 0});
  232|       |    profile.add_rule({FeatureType::Cipher, PGP_SA_IDEA, SecurityLevel::Disabled, 0});
  233|       |    profile.add_rule({FeatureType::Cipher, PGP_SA_BLOWFISH, SecurityLevel::Disabled, 0});
  234|       |    profile.add_rule({FeatureType::Cipher, PGP_SA_SM4, SecurityLevel::Disabled, 0});
  235|       |    /* Non-FIPS hash algorithms */
  236|       |    profile.add_rule({FeatureType::Hash, PGP_HASH_MD5, SecurityLevel::Disabled, 0});
  237|       |    profile.add_rule({FeatureType::Hash, PGP_HASH_SHA1, SecurityLevel::Disabled, 0});
  238|       |    profile.add_rule({FeatureType::Hash, PGP_HASH_RIPEMD, SecurityLevel::Disabled, 0});
  239|       |    /* Non-FIPS public-key algorithms. DSA is FIPS-approved but only with
  240|       |     * approved key sizes; that size gating is enforced separately during key
  241|       |     * generation/use, not via a blanket rule here. */
  242|       |    profile.add_rule({FeatureType::PublicKey, PGP_PKA_EDDSA, SecurityLevel::Disabled, 0});
  243|       |    profile.add_rule({FeatureType::PublicKey, PGP_PKA_SM2, SecurityLevel::Disabled, 0});
  244|       |    profile.add_rule({FeatureType::PublicKey, PGP_PKA_ELGAMAL, SecurityLevel::Disabled, 0});
  245|       |    profile.add_rule(
  246|       |      {FeatureType::PublicKey, PGP_PKA_ELGAMAL_ENCRYPT_OR_SIGN, SecurityLevel::Disabled, 0});
  247|       |#endif
  248|  4.44k|}
_ZN3rnp15SecurityContextD2Ev:
  251|  4.44k|{
  252|  4.44k|    rnp::backend_finish(prov_state_);
  253|  4.44k|}

_ZN3rnp12SecurityRuleC2ENS_11FeatureTypeEiNS_13SecurityLevelEmNS_14SecurityActionE:
   54|  35.5k|        : type(ftype), feature(fval), level(flevel), from(ffrom), override(false),
   55|  35.5k|          action(faction){};

_ZN3pgp11SigMaterial6createE16pgp_pubkey_alg_t14pgp_hash_alg_t:
   35|   594k|{
   36|   594k|    switch (palg) {
   37|  26.9k|    case PGP_PKA_RSA:
  ------------------
  |  Branch (37:5): [True: 26.9k, False: 567k]
  ------------------
   38|   543k|    case PGP_PKA_RSA_SIGN_ONLY:
  ------------------
  |  Branch (38:5): [True: 516k, False: 77.7k]
  ------------------
   39|   543k|        return std::unique_ptr<SigMaterial>(new RSASigMaterial(halg));
   40|  1.51k|    case PGP_PKA_DSA:
  ------------------
  |  Branch (40:5): [True: 1.51k, False: 592k]
  ------------------
   41|  1.51k|        return std::unique_ptr<SigMaterial>(new DSASigMaterial(halg));
   42|  39.1k|    case PGP_PKA_EDDSA:
  ------------------
  |  Branch (42:5): [True: 39.1k, False: 555k]
  ------------------
   43|  41.9k|    case PGP_PKA_ECDSA:
  ------------------
  |  Branch (43:5): [True: 2.77k, False: 591k]
  ------------------
   44|  42.5k|    case PGP_PKA_SM2:
  ------------------
  |  Branch (44:5): [True: 588, False: 593k]
  ------------------
   45|  43.1k|    case PGP_PKA_ECDH:
  ------------------
  |  Branch (45:5): [True: 643, False: 593k]
  ------------------
   46|  43.1k|        return std::unique_ptr<SigMaterial>(new ECSigMaterial(halg));
   47|  1.44k|    case PGP_PKA_ELGAMAL: /* we support reading it but will not validate */
  ------------------
  |  Branch (47:5): [True: 1.44k, False: 592k]
  ------------------
   48|  2.16k|    case PGP_PKA_ELGAMAL_ENCRYPT_OR_SIGN:
  ------------------
  |  Branch (48:5): [True: 727, False: 593k]
  ------------------
   49|  2.16k|        return std::unique_ptr<SigMaterial>(new EGSigMaterial(halg));
   50|      0|#if defined(ENABLE_CRYPTO_REFRESH)
   51|  1.36k|    case PGP_PKA_ED25519: {
  ------------------
  |  Branch (51:5): [True: 1.36k, False: 592k]
  ------------------
   52|  1.36k|        return std::unique_ptr<SigMaterial>(new Ed25519SigMaterial(halg));
   53|  1.44k|    }
   54|    115|    case PGP_PKA_ED448: {
  ------------------
  |  Branch (54:5): [True: 115, False: 594k]
  ------------------
   55|    115|        return std::unique_ptr<SigMaterial>(new Ed448SigMaterial(halg));
   56|  1.44k|    }
   57|      0|#endif
   58|      0|#if defined(ENABLE_PQC) && defined(ENABLE_CRYPTO_REFRESH)
   59|     59|    case PGP_PKA_DILITHIUM3_ED25519:
  ------------------
  |  Branch (59:5): [True: 59, False: 594k]
  ------------------
   60|     59|        FALLTHROUGH_STATEMENT;
  ------------------
  |  |  109|     59|# define FALLTHROUGH_STATEMENT [[fallthrough]]
  ------------------
   61|     84|    case PGP_PKA_DILITHIUM5_ED448:
  ------------------
  |  Branch (61:5): [True: 25, False: 594k]
  ------------------
   62|     84|        FALLTHROUGH_STATEMENT;
  ------------------
  |  |  109|     84|# define FALLTHROUGH_STATEMENT [[fallthrough]]
  ------------------
   63|    119|    case PGP_PKA_DILITHIUM3_P384:
  ------------------
  |  Branch (63:5): [True: 35, False: 594k]
  ------------------
   64|    119|        FALLTHROUGH_STATEMENT;
  ------------------
  |  |  109|    119|# define FALLTHROUGH_STATEMENT [[fallthrough]]
  ------------------
   65|    285|    case PGP_PKA_DILITHIUM5_P521:
  ------------------
  |  Branch (65:5): [True: 166, False: 594k]
  ------------------
   66|    285|        FALLTHROUGH_STATEMENT;
  ------------------
  |  |  109|    285|# define FALLTHROUGH_STATEMENT [[fallthrough]]
  ------------------
   67|    341|    case PGP_PKA_DILITHIUM3_BP384:
  ------------------
  |  Branch (67:5): [True: 56, False: 594k]
  ------------------
   68|    341|        FALLTHROUGH_STATEMENT;
  ------------------
  |  |  109|    341|# define FALLTHROUGH_STATEMENT [[fallthrough]]
  ------------------
   69|    515|    case PGP_PKA_DILITHIUM5_BP512:
  ------------------
  |  Branch (69:5): [True: 174, False: 594k]
  ------------------
   70|    515|        return std::unique_ptr<SigMaterial>(new DilithiumSigMaterial(palg, halg));
   71|    111|    case PGP_PKA_SPHINCSPLUS_SHAKE_128f:
  ------------------
  |  Branch (71:5): [True: 111, False: 594k]
  ------------------
   72|    111|        FALLTHROUGH_STATEMENT;
  ------------------
  |  |  109|    111|# define FALLTHROUGH_STATEMENT [[fallthrough]]
  ------------------
   73|    274|    case PGP_PKA_SPHINCSPLUS_SHAKE_128s:
  ------------------
  |  Branch (73:5): [True: 163, False: 594k]
  ------------------
   74|    274|        FALLTHROUGH_STATEMENT;
  ------------------
  |  |  109|    274|# define FALLTHROUGH_STATEMENT [[fallthrough]]
  ------------------
   75|    381|    case PGP_PKA_SPHINCSPLUS_SHAKE_256s:
  ------------------
  |  Branch (75:5): [True: 107, False: 594k]
  ------------------
   76|    381|        return std::unique_ptr<SigMaterial>(new SlhdsaSigMaterial(palg, halg));
   77|      0|#endif
   78|  1.56k|    default:
  ------------------
  |  Branch (78:5): [True: 1.56k, False: 592k]
  ------------------
   79|  1.56k|        RNP_LOG("Unknown pk algorithm : %d", (int) palg);
  ------------------
  |  |   84|  1.56k|#define RNP_LOG(...) RNP_LOG_FD(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   76|  1.56k|    do {                                                                                 \
  |  |  |  |   77|  1.56k|        if (!rnp_log_switch())                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:13): [True: 1.56k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   78|  1.56k|            break;                                                                       \
  |  |  |  |   79|  1.56k|        (void) fprintf((fd), "[%s() %s:%d] ", __func__, __SOURCE_PATH_FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define __SOURCE_PATH_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        (void) fprintf((fd), __VA_ARGS__);                                               \
  |  |  |  |   81|      0|        (void) fprintf((fd), "\n");                                                      \
  |  |  |  |   82|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   80|  1.56k|        return nullptr;
   81|   594k|    }
   82|   594k|}
_ZN3pgp14RSASigMaterial5parseER17pgp_packet_body_t:
   86|   543k|{
   87|   543k|    return pkt.get(sig.s);
   88|   543k|}
_ZN3pgp14DSASigMaterial5parseER17pgp_packet_body_t:
   98|  1.51k|{
   99|  1.51k|    return pkt.get(sig.r) && pkt.get(sig.s);
  ------------------
  |  Branch (99:12): [True: 1.26k, False: 248]
  |  Branch (99:30): [True: 1.25k, False: 16]
  ------------------
  100|  1.51k|}
_ZN3pgp13EGSigMaterial5parseER17pgp_packet_body_t:
  111|  2.16k|{
  112|  2.16k|    return pkt.get(sig.r) && pkt.get(sig.s);
  ------------------
  |  Branch (112:12): [True: 1.70k, False: 463]
  |  Branch (112:30): [True: 1.68k, False: 23]
  ------------------
  113|  2.16k|}
_ZN3pgp13ECSigMaterial5parseER17pgp_packet_body_t:
  125|  43.1k|{
  126|  43.1k|    return pkt.get(sig.r) && pkt.get(sig.s);
  ------------------
  |  Branch (126:12): [True: 42.5k, False: 621]
  |  Branch (126:30): [True: 42.4k, False: 53]
  ------------------
  127|  43.1k|}
_ZN3pgp18Ed25519SigMaterial5parseER17pgp_packet_body_t:
  139|  1.36k|{
  140|  1.36k|    auto ec_desc = pgp::ec::Curve::get(PGP_CURVE_25519);
  141|  1.36k|    if (!pkt.get(sig.sig, 2 * ec_desc->bytes())) {
  ------------------
  |  Branch (141:9): [True: 1.05k, False: 310]
  ------------------
  142|  1.05k|        RNP_LOG("failed to parse ED25519 signature data");
  ------------------
  |  |   84|  1.05k|#define RNP_LOG(...) RNP_LOG_FD(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   76|  1.05k|    do {                                                                                 \
  |  |  |  |   77|  1.05k|        if (!rnp_log_switch())                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:13): [True: 1.05k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   78|  1.05k|            break;                                                                       \
  |  |  |  |   79|  1.05k|        (void) fprintf((fd), "[%s() %s:%d] ", __func__, __SOURCE_PATH_FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define __SOURCE_PATH_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        (void) fprintf((fd), __VA_ARGS__);                                               \
  |  |  |  |   81|      0|        (void) fprintf((fd), "\n");                                                      \
  |  |  |  |   82|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  143|  1.05k|        return false;
  144|  1.05k|    }
  145|    310|    return true;
  146|  1.36k|}
_ZN3pgp16Ed448SigMaterial5parseER17pgp_packet_body_t:
  156|    115|{
  157|    115|    auto ec_desc = pgp::ec::Curve::get(PGP_CURVE_448);
  158|    115|    if (!pkt.get(sig.sig, 2 * ec_desc->bytes())) {
  ------------------
  |  Branch (158:9): [True: 90, False: 25]
  ------------------
  159|     90|        RNP_LOG("failed to parse ED448 signature data");
  ------------------
  |  |   84|     90|#define RNP_LOG(...) RNP_LOG_FD(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   76|     90|    do {                                                                                 \
  |  |  |  |   77|     90|        if (!rnp_log_switch())                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:13): [True: 90, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   78|     90|            break;                                                                       \
  |  |  |  |   79|     90|        (void) fprintf((fd), "[%s() %s:%d] ", __func__, __SOURCE_PATH_FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define __SOURCE_PATH_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        (void) fprintf((fd), __VA_ARGS__);                                               \
  |  |  |  |   81|      0|        (void) fprintf((fd), "\n");                                                      \
  |  |  |  |   82|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  160|     90|        return false;
  161|     90|    }
  162|     25|    return true;
  163|    115|}
_ZN3pgp20DilithiumSigMaterial5parseER17pgp_packet_body_t:
  175|    515|{
  176|    515|    if (!pkt.get(sig.sig, pgp_dilithium_exdsa_signature_t::composite_signature_size(palg))) {
  ------------------
  |  Branch (176:9): [True: 444, False: 71]
  ------------------
  177|    444|        RNP_LOG("failed to get mldsa-ecdsa/eddsa signature");
  ------------------
  |  |   84|    444|#define RNP_LOG(...) RNP_LOG_FD(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   76|    444|    do {                                                                                 \
  |  |  |  |   77|    444|        if (!rnp_log_switch())                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:13): [True: 444, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   78|    444|            break;                                                                       \
  |  |  |  |   79|    444|        (void) fprintf((fd), "[%s() %s:%d] ", __func__, __SOURCE_PATH_FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define __SOURCE_PATH_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        (void) fprintf((fd), __VA_ARGS__);                                               \
  |  |  |  |   81|      0|        (void) fprintf((fd), "\n");                                                      \
  |  |  |  |   82|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  178|    444|        return false;
  179|    444|    }
  180|     71|    return true;
  181|    515|}
_ZN3pgp17SlhdsaSigMaterial5parseER17pgp_packet_body_t:
  191|    381|{
  192|    381|    auto sig_size = sphincsplus_signature_size(palg);
  193|    381|    if (!sig_size) {
  ------------------
  |  Branch (193:9): [True: 0, False: 381]
  ------------------
  194|      0|        RNP_LOG("invalid SLH-DSA algorithm value");
  ------------------
  |  |   84|      0|#define RNP_LOG(...) RNP_LOG_FD(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   76|      0|    do {                                                                                 \
  |  |  |  |   77|      0|        if (!rnp_log_switch())                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   78|      0|            break;                                                                       \
  |  |  |  |   79|      0|        (void) fprintf((fd), "[%s() %s:%d] ", __func__, __SOURCE_PATH_FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define __SOURCE_PATH_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        (void) fprintf((fd), __VA_ARGS__);                                               \
  |  |  |  |   81|      0|        (void) fprintf((fd), "\n");                                                      \
  |  |  |  |   82|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  195|      0|        return false;
  196|      0|    }
  197|    381|    if (!pkt.get(sig.sig, sig_size)) {
  ------------------
  |  Branch (197:9): [True: 315, False: 66]
  ------------------
  198|    315|        RNP_LOG("failed to parse SLH-DSA signature data");
  ------------------
  |  |   84|    315|#define RNP_LOG(...) RNP_LOG_FD(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   76|    315|    do {                                                                                 \
  |  |  |  |   77|    315|        if (!rnp_log_switch())                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:13): [True: 315, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   78|    315|            break;                                                                       \
  |  |  |  |   79|    315|        (void) fprintf((fd), "[%s() %s:%d] ", __func__, __SOURCE_PATH_FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define __SOURCE_PATH_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        (void) fprintf((fd), __VA_ARGS__);                                               \
  |  |  |  |   81|      0|        (void) fprintf((fd), "\n");                                                      \
  |  |  |  |   82|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  199|    315|        return false;
  200|    315|    }
  201|     66|    return true;
  202|    381|}

_ZN3pgp11SigMaterialC2E14pgp_hash_alg_t:
   40|   592k|    SigMaterial(pgp_hash_alg_t ahalg) : halg(ahalg){};
_ZN3pgp11SigMaterialD2Ev:
   41|   592k|    virtual ~SigMaterial(){};
_ZN3pgp14RSASigMaterialC2E14pgp_hash_alg_t:
   52|   543k|    RSASigMaterial(pgp_hash_alg_t ahalg) : SigMaterial(ahalg){};
_ZN3pgp14DSASigMaterialC2E14pgp_hash_alg_t:
   61|  1.51k|    DSASigMaterial(pgp_hash_alg_t ahalg) : SigMaterial(ahalg){};
_ZN3pgp13EGSigMaterialC2E14pgp_hash_alg_t:
   70|  2.16k|    EGSigMaterial(pgp_hash_alg_t ahalg) : SigMaterial(ahalg){};
_ZN3pgp13ECSigMaterialC2E14pgp_hash_alg_t:
   79|  43.1k|    ECSigMaterial(pgp_hash_alg_t ahalg) : SigMaterial(ahalg){};
_ZN3pgp18Ed25519SigMaterialC2E14pgp_hash_alg_t:
   89|  1.36k|    Ed25519SigMaterial(pgp_hash_alg_t ahalg) : SigMaterial(ahalg){};
_ZN3pgp16Ed448SigMaterialC2E14pgp_hash_alg_t:
   98|    115|    Ed448SigMaterial(pgp_hash_alg_t ahalg) : SigMaterial(ahalg){};
_ZN3pgp20DilithiumSigMaterialC2E16pgp_pubkey_alg_t14pgp_hash_alg_t:
  112|    515|        : SigMaterial(ahalg), palg(apalg){};
_ZN3pgp17SlhdsaSigMaterialC2E16pgp_pubkey_alg_t14pgp_hash_alg_t:
  123|    381|        : SigMaterial(ahalg), palg(apalg){};

_ZN3pgp3pkt6sigsub3RawC2Ehbb:
   43|  55.6k|    : hashed_(hashed), raw_type_(rawtype), critical_(critical), type_(Type::Unknown)
   44|  55.6k|{
   45|  55.6k|}
_ZN3pgp3pkt6sigsub3RawC2ENS1_4TypeEbb:
   48|   205k|    : hashed_(hashed), raw_type_(static_cast<uint8_t>(type)), critical_(critical), type_(type)
   49|   205k|{
   50|   205k|}
_ZN3pgp3pkt6sigsub3RawD2Ev:
   53|   539k|{
   54|   539k|}
_ZNK3pgp3pkt6sigsub3Raw10check_sizeEm:
   58|  64.7k|{
   59|  64.7k|    return true;
   60|  64.7k|};
_ZN3pgp3pkt6sigsub3Raw10parse_dataEPKhm:
   64|  55.6k|{
   65|  55.6k|    return true;
   66|  55.6k|};
_ZN3pgp3pkt6sigsub3Raw5parseEPKhmm:
   70|   261k|{
   71|   261k|    parse_depth_ = depth;
   72|   261k|    if (!check_size(size)) {
  ------------------
  |  Branch (72:9): [True: 18.8k, False: 242k]
  ------------------
   73|  18.8k|        RNP_LOG("wrong len %zu of subpacket type %" PRIu8, size, raw_type_);
  ------------------
  |  |   84|  18.8k|#define RNP_LOG(...) RNP_LOG_FD(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   76|  18.8k|    do {                                                                                 \
  |  |  |  |   77|  18.8k|        if (!rnp_log_switch())                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:13): [True: 18.8k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   78|  18.8k|            break;                                                                       \
  |  |  |  |   79|  18.8k|        (void) fprintf((fd), "[%s() %s:%d] ", __func__, __SOURCE_PATH_FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define __SOURCE_PATH_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        (void) fprintf((fd), __VA_ARGS__);                                               \
  |  |  |  |   81|      0|        (void) fprintf((fd), "\n");                                                      \
  |  |  |  |   82|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   74|  18.8k|        return false;
   75|  18.8k|    }
   76|   242k|    if (!parse_data(data, size)) {
  ------------------
  |  Branch (76:9): [True: 15.0k, False: 227k]
  ------------------
   77|  15.0k|        return false;
   78|  15.0k|    }
   79|   227k|    data_.assign(data, data + size);
   80|   227k|    return true;
   81|   242k|}
_ZN3pgp3pkt6sigsub3Raw6createEhbb:
  129|   261k|{
  130|   261k|    switch (type) {
  131|  42.9k|    case (uint8_t) Type::CreationTime:
  ------------------
  |  Branch (131:5): [True: 42.9k, False: 218k]
  ------------------
  132|  42.9k|        return RawPtr(new CreationTime(hashed, critical));
  133|  4.20k|    case (uint8_t) Type::ExpirationTime:
  ------------------
  |  Branch (133:5): [True: 4.20k, False: 256k]
  ------------------
  134|  4.20k|        return RawPtr(new ExpirationTime(hashed, critical));
  135|  1.49k|    case (uint8_t) Type::ExportableCert:
  ------------------
  |  Branch (135:5): [True: 1.49k, False: 259k]
  ------------------
  136|  1.49k|        return RawPtr(new ExportableCert(hashed, critical));
  137|  1.63k|    case (uint8_t) Type::Trust:
  ------------------
  |  Branch (137:5): [True: 1.63k, False: 259k]
  ------------------
  138|  1.63k|        return RawPtr(new Trust(hashed, critical));
  139|  2.32k|    case (uint8_t) Type::RegExp:
  ------------------
  |  Branch (139:5): [True: 2.32k, False: 258k]
  ------------------
  140|  2.32k|        return RawPtr(new RegExp(hashed, critical));
  141|  1.42k|    case (uint8_t) Type::Revocable:
  ------------------
  |  Branch (141:5): [True: 1.42k, False: 259k]
  ------------------
  142|  1.42k|        return RawPtr(new Revocable(hashed, critical));
  143|  1.81k|    case (uint8_t) Type::KeyExpirationTime:
  ------------------
  |  Branch (143:5): [True: 1.81k, False: 259k]
  ------------------
  144|  1.81k|        return RawPtr(new KeyExpirationTime(hashed, critical));
  145|  2.06k|    case (uint8_t) Type::PreferredSymmetric:
  ------------------
  |  Branch (145:5): [True: 2.06k, False: 258k]
  ------------------
  146|  2.06k|        return RawPtr(new PreferredSymmetric(hashed, critical));
  147|  1.92k|    case (uint8_t) Type::RevocationKey:
  ------------------
  |  Branch (147:5): [True: 1.92k, False: 259k]
  ------------------
  148|  1.92k|        return RawPtr(new RevocationKey(hashed, critical));
  149|  41.7k|    case (uint8_t) Type::IssuerKeyID:
  ------------------
  |  Branch (149:5): [True: 41.7k, False: 219k]
  ------------------
  150|  41.7k|        return RawPtr(new IssuerKeyID(hashed, critical));
  151|  1.01k|    case (uint8_t) Type::NotationData:
  ------------------
  |  Branch (151:5): [True: 1.01k, False: 259k]
  ------------------
  152|  1.01k|        return RawPtr(new NotationData(hashed, critical));
  153|  1.12k|    case (uint8_t) Type::PreferredHash:
  ------------------
  |  Branch (153:5): [True: 1.12k, False: 259k]
  ------------------
  154|  1.12k|        return RawPtr(new PreferredHash(hashed, critical));
  155|  1.66k|    case (uint8_t) Type::PreferredCompress:
  ------------------
  |  Branch (155:5): [True: 1.66k, False: 259k]
  ------------------
  156|  1.66k|        return RawPtr(new PreferredCompress(hashed, critical));
  157|  1.07k|    case (uint8_t) Type::KeyserverPrefs:
  ------------------
  |  Branch (157:5): [True: 1.07k, False: 259k]
  ------------------
  158|  1.07k|        return RawPtr(new KeyserverPrefs(hashed, critical));
  159|  2.20k|    case (uint8_t) Type::PreferredKeyserver:
  ------------------
  |  Branch (159:5): [True: 2.20k, False: 258k]
  ------------------
  160|  2.20k|        return RawPtr(new PreferredKeyserver(hashed, critical));
  161|  1.01k|    case (uint8_t) Type::PrimaryUserID:
  ------------------
  |  Branch (161:5): [True: 1.01k, False: 259k]
  ------------------
  162|  1.01k|        return RawPtr(new PrimaryUserID(hashed, critical));
  163|  2.08k|    case (uint8_t) Type::PolicyURI:
  ------------------
  |  Branch (163:5): [True: 2.08k, False: 258k]
  ------------------
  164|  2.08k|        return RawPtr(new PolicyURI(hashed, critical));
  165|  1.85k|    case (uint8_t) Type::KeyFlags:
  ------------------
  |  Branch (165:5): [True: 1.85k, False: 259k]
  ------------------
  166|  1.85k|        return RawPtr(new KeyFlags(hashed, critical));
  167|  2.50k|    case (uint8_t) Type::SignersUserID:
  ------------------
  |  Branch (167:5): [True: 2.50k, False: 258k]
  ------------------
  168|  2.50k|        return RawPtr(new SignersUserID(hashed, critical));
  169|  37.6k|    case (uint8_t) Type::RevocationReason:
  ------------------
  |  Branch (169:5): [True: 37.6k, False: 223k]
  ------------------
  170|  37.6k|        return RawPtr(new RevocationReason(hashed, critical));
  171|    939|    case (uint8_t) Type::Features:
  ------------------
  |  Branch (171:5): [True: 939, False: 260k]
  ------------------
  172|    939|        return RawPtr(new Features(hashed, critical));
  173|  15.6k|    case (uint8_t) Type::EmbeddedSignature:
  ------------------
  |  Branch (173:5): [True: 15.6k, False: 245k]
  ------------------
  174|  15.6k|        return RawPtr(new EmbeddedSignature(hashed, critical));
  175|  28.8k|    case (uint8_t) Type::IssuerFingerprint:
  ------------------
  |  Branch (175:5): [True: 28.8k, False: 232k]
  ------------------
  176|  28.8k|        return RawPtr(new IssuerFingerprint(hashed, critical));
  177|  2.38k|    case (uint8_t) Type::PreferredAEAD:
  ------------------
  |  Branch (177:5): [True: 2.38k, False: 258k]
  ------------------
  178|  2.38k|        return RawPtr(new PreferredAEAD(hashed, critical));
  179|      0|#if defined(ENABLE_CRYPTO_REFRESH)
  180|  1.05k|    case (uint8_t) Type::IntendedRecipientFingerprint:
  ------------------
  |  Branch (180:5): [True: 1.05k, False: 259k]
  ------------------
  181|  1.05k|        return RawPtr(new IntendedRecipientFingerprint(hashed, critical));
  182|  2.66k|    case (uint8_t) Type::PreferredAEADv6:
  ------------------
  |  Branch (182:5): [True: 2.66k, False: 258k]
  ------------------
  183|  2.66k|        return RawPtr(new PreferredAEADv6(hashed, critical));
  184|      0|#endif
  185|  55.6k|    default:
  ------------------
  |  Branch (185:5): [True: 55.6k, False: 205k]
  ------------------
  186|  55.6k|        report_unknown(type, critical);
  187|  55.6k|        return RawPtr(new Raw(type, hashed, critical));
  188|   261k|    }
  189|   261k|}
_ZN3pgp3pkt6sigsub3Raw6createEPKhmbm:
  199|   261k|{
  200|   261k|    if (!size) {
  ------------------
  |  Branch (200:9): [True: 0, False: 261k]
  ------------------
  201|      0|        RNP_LOG("got subpacket with 0 length");
  ------------------
  |  |   84|      0|#define RNP_LOG(...) RNP_LOG_FD(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   76|      0|    do {                                                                                 \
  |  |  |  |   77|      0|        if (!rnp_log_switch())                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   78|      0|            break;                                                                       \
  |  |  |  |   79|      0|        (void) fprintf((fd), "[%s() %s:%d] ", __func__, __SOURCE_PATH_FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define __SOURCE_PATH_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        (void) fprintf((fd), __VA_ARGS__);                                               \
  |  |  |  |   81|      0|        (void) fprintf((fd), "\n");                                                      \
  |  |  |  |   82|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  202|      0|        return nullptr;
  203|      0|    }
  204|   261k|    bool    critical = data[0] & 0x80;
  205|   261k|    uint8_t type = data[0] & 0x7f;
  206|   261k|    auto    sub = create(type, hashed, critical);
  207|       |    /* Unknown subpacket (including the critical one) is kept as unparsed Raw subpacket,
  208|       |     * so the signature can still be loaded. Signature with the unknown critical subpacket
  209|       |     * is marked as invalid during the validation, see RFC 9580: 5.2.3.16. */
  210|   261k|    if (!sub || !sub->parse(data + 1, size - 1, depth)) {
  ------------------
  |  Branch (210:9): [True: 0, False: 261k]
  |  Branch (210:17): [True: 33.8k, False: 227k]
  ------------------
  211|  33.8k|        return nullptr;
  212|  33.8k|    }
  213|   227k|    return sub;
  214|   261k|}
_ZNK3pgp3pkt6sigsub3Raw5cloneEv:
  218|  56.4k|{
  219|  56.4k|    return RawPtr(new Raw(*this));
  220|  56.4k|}
_ZNK3pgp3pkt6sigsub4Time10check_sizeEm:
  232|  48.9k|{
  233|  48.9k|    return size == 4;
  234|  48.9k|}
_ZN3pgp3pkt6sigsub4Time10parse_dataEPKhm:
  238|  36.3k|{
  239|  36.3k|    time_ = read_uint32(data);
  240|  36.3k|    return true;
  241|  36.3k|}
_ZNK3pgp3pkt6sigsub12CreationTime5cloneEv:
  246|  40.2k|{
  247|  40.2k|    return RawPtr(new CreationTime(*this));
  248|  40.2k|}
_ZNK3pgp3pkt6sigsub14ExpirationTime5cloneEv:
  253|  4.99k|{
  254|  4.99k|    return RawPtr(new ExpirationTime(*this));
  255|  4.99k|}
_ZNK3pgp3pkt6sigsub17KeyExpirationTime5cloneEv:
  260|  1.71k|{
  261|  1.71k|    return RawPtr(new KeyExpirationTime(*this));
  262|  1.71k|}
_ZNK3pgp3pkt6sigsub4Bool10check_sizeEm:
  274|  3.93k|{
  275|  3.93k|    return size == 1;
  276|  3.93k|}
_ZN3pgp3pkt6sigsub4Bool10parse_dataEPKhm:
  280|  2.77k|{
  281|  2.77k|    value_ = data[0];
  282|  2.77k|    return true;
  283|  2.77k|}
_ZNK3pgp3pkt6sigsub14ExportableCert5cloneEv:
  288|  1.09k|{
  289|  1.09k|    return RawPtr(new ExportableCert(*this));
  290|  1.09k|}
_ZNK3pgp3pkt6sigsub5Trust10check_sizeEm:
  303|  1.63k|{
  304|  1.63k|    return size == 2;
  305|  1.63k|}
_ZN3pgp3pkt6sigsub5Trust10parse_dataEPKhm:
  309|    604|{
  310|    604|    level_ = data[0];
  311|    604|    amount_ = data[1];
  312|    604|    return true;
  313|    604|}
_ZNK3pgp3pkt6sigsub5Trust5cloneEv:
  317|  1.06k|{
  318|  1.06k|    return RawPtr(new Trust(*this));
  319|  1.06k|}
_ZN3pgp3pkt6sigsub6String10parse_dataEPKhm:
  330|  9.11k|{
  331|  9.11k|    value_.assign(data, data + size);
  332|  9.11k|    return true;
  333|  9.11k|}
_ZNK3pgp3pkt6sigsub6RegExp5cloneEv:
  338|  2.92k|{
  339|  2.92k|    return RawPtr(new RegExp(*this));
  340|  2.92k|}
_ZNK3pgp3pkt6sigsub9Revocable5cloneEv:
  345|  1.76k|{
  346|  1.76k|    return RawPtr(new Revocable(*this));
  347|  1.76k|}
_ZNK3pgp3pkt6sigsub9Preferred10check_sizeEm:
  358|  9.54k|{
  359|       |    /* No reason to have more then 256 bytes */
  360|  9.54k|    return size < 256;
  361|  9.54k|}
_ZN3pgp3pkt6sigsub9Preferred10parse_dataEPKhm:
  365|  9.52k|{
  366|  9.52k|    algs_.assign(data, data + size);
  367|  9.52k|    return true;
  368|  9.52k|}
_ZNK3pgp3pkt6sigsub18PreferredSymmetric5cloneEv:
  373|  2.77k|{
  374|  2.77k|    return RawPtr(new PreferredSymmetric(*this));
  375|  2.77k|}
_ZNK3pgp3pkt6sigsub13PreferredHash5cloneEv:
  380|  1.71k|{
  381|  1.71k|    return RawPtr(new PreferredHash(*this));
  382|  1.71k|}
_ZNK3pgp3pkt6sigsub17PreferredCompress5cloneEv:
  387|  2.75k|{
  388|  2.75k|    return RawPtr(new PreferredCompress(*this));
  389|  2.75k|}
_ZNK3pgp3pkt6sigsub13PreferredAEAD5cloneEv:
  394|  3.39k|{
  395|  3.39k|    return RawPtr(new PreferredAEAD(*this));
  396|  3.39k|}
_ZNK3pgp3pkt6sigsub15PreferredAEADv610check_sizeEm:
  402|  2.66k|{
  403|  2.66k|    if (size % 2) {
  ------------------
  |  Branch (403:9): [True: 355, False: 2.30k]
  ------------------
  404|    355|        RNP_LOG("v6 AEAD Ciphersuite Preferences must contain an even number of bytes");
  ------------------
  |  |   84|    355|#define RNP_LOG(...) RNP_LOG_FD(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   76|    355|    do {                                                                                 \
  |  |  |  |   77|    355|        if (!rnp_log_switch())                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:13): [True: 355, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   78|    355|            break;                                                                       \
  |  |  |  |   79|    355|        (void) fprintf((fd), "[%s() %s:%d] ", __func__, __SOURCE_PATH_FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define __SOURCE_PATH_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        (void) fprintf((fd), __VA_ARGS__);                                               \
  |  |  |  |   81|      0|        (void) fprintf((fd), "\n");                                                      \
  |  |  |  |   82|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  405|    355|        return false;
  406|    355|    }
  407|  2.30k|    return Preferred::check_size(size);
  408|  2.66k|}
_ZNK3pgp3pkt6sigsub15PreferredAEADv65cloneEv:
  412|  2.86k|{
  413|  2.86k|    return RawPtr(new PreferredAEADv6(*this));
  414|  2.86k|}
_ZNK3pgp3pkt6sigsub13RevocationKey10check_sizeEm:
  429|  1.92k|{
  430|  1.92k|    return (size == 2 + PGP_FINGERPRINT_V4_SIZE) || (size == 2 + PGP_FINGERPRINT_V5_SIZE);
  ------------------
  |  |   43|  1.92k|#define PGP_FINGERPRINT_V4_SIZE 20
  ------------------
                  return (size == 2 + PGP_FINGERPRINT_V4_SIZE) || (size == 2 + PGP_FINGERPRINT_V5_SIZE);
  ------------------
  |  |   44|    942|#define PGP_FINGERPRINT_V5_SIZE 32
  ------------------
  |  Branch (430:12): [True: 978, False: 942]
  |  Branch (430:53): [True: 8, False: 934]
  ------------------
  431|  1.92k|}
_ZN3pgp3pkt6sigsub13RevocationKey10parse_dataEPKhm:
  435|    986|{
  436|    986|    rev_class_ = data[0];
  437|    986|    alg_ = static_cast<pgp_pubkey_alg_t>(data[1]);
  438|    986|    fp_ = pgp::Fingerprint(data + 2, size - 2);
  439|    986|    return true;
  440|    986|}
_ZNK3pgp3pkt6sigsub13RevocationKey5cloneEv:
  444|  1.41k|{
  445|  1.41k|    return RawPtr(new RevocationKey(*this));
  446|  1.41k|}
_ZNK3pgp3pkt6sigsub11IssuerKeyID10check_sizeEm:
  457|  41.7k|{
  458|  41.7k|    return size == PGP_KEY_ID_SIZE;
  ------------------
  |  |   39|  41.7k|#define PGP_KEY_ID_SIZE 8
  ------------------
  459|  41.7k|}
_ZN3pgp3pkt6sigsub11IssuerKeyID10parse_dataEPKhm:
  463|  41.2k|{
  464|  41.2k|    memcpy(keyid_.data(), data, keyid_.size());
  465|  41.2k|    return true;
  466|  41.2k|}
_ZNK3pgp3pkt6sigsub11IssuerKeyID5cloneEv:
  470|  51.5k|{
  471|  51.5k|    return RawPtr(new IssuerKeyID(*this));
  472|  51.5k|}
_ZNK3pgp3pkt6sigsub12NotationData10check_sizeEm:
  492|  1.01k|{
  493|  1.01k|    return size >= 8;
  494|  1.01k|}
_ZN3pgp3pkt6sigsub12NotationData10parse_dataEPKhm:
  498|    913|{
  499|    913|    size_t nlen = read_uint16(data + 4);
  500|    913|    size_t vlen = read_uint16(data + 6);
  501|    913|    if (size != nlen + vlen + 8) {
  ------------------
  |  Branch (501:9): [True: 277, False: 636]
  ------------------
  502|    277|        return false;
  503|    277|    }
  504|    636|    memcpy(flags_.data(), data, 4);
  505|    636|    name_.assign(data + 8, data + 8 + nlen);
  506|    636|    value_.assign(data + 8 + nlen, data + 8 + nlen + vlen);
  507|    636|    return true;
  508|    913|}
_ZNK3pgp3pkt6sigsub12NotationData5cloneEv:
  542|  1.09k|{
  543|  1.09k|    return RawPtr(new NotationData(*this));
  544|  1.09k|}
_ZNK3pgp3pkt6sigsub5Flags10check_sizeEm:
  556|  3.86k|{
  557|  3.86k|    return size >= 1;
  558|  3.86k|}
_ZN3pgp3pkt6sigsub5Flags10parse_dataEPKhm:
  562|  3.11k|{
  563|  3.11k|    flags_ = data[0];
  564|  3.11k|    return true;
  565|  3.11k|}
_ZNK3pgp3pkt6sigsub14KeyserverPrefs5cloneEv:
  570|  1.29k|{
  571|  1.29k|    return RawPtr(new KeyserverPrefs(*this));
  572|  1.29k|}
_ZNK3pgp3pkt6sigsub18PreferredKeyserver5cloneEv:
  577|  3.63k|{
  578|  3.63k|    return RawPtr(new PreferredKeyserver(*this));
  579|  3.63k|}
_ZNK3pgp3pkt6sigsub13PrimaryUserID5cloneEv:
  584|  1.65k|{
  585|  1.65k|    return RawPtr(new PrimaryUserID(*this));
  586|  1.65k|}
_ZNK3pgp3pkt6sigsub9PolicyURI5cloneEv:
  591|  3.02k|{
  592|  3.02k|    return RawPtr(new PolicyURI(*this));
  593|  3.02k|}
_ZNK3pgp3pkt6sigsub8KeyFlags5cloneEv:
  598|  2.09k|{
  599|  2.09k|    return RawPtr(new KeyFlags(*this));
  600|  2.09k|}
_ZNK3pgp3pkt6sigsub13SignersUserID5cloneEv:
  605|  4.00k|{
  606|  4.00k|    return RawPtr(new SignersUserID(*this));
  607|  4.00k|}
_ZNK3pgp3pkt6sigsub16RevocationReason10check_sizeEm:
  620|  37.6k|{
  621|  37.6k|    return size >= 1;
  622|  37.6k|}
_ZN3pgp3pkt6sigsub16RevocationReason10parse_dataEPKhm:
  626|  37.4k|{
  627|  37.4k|    code_ = static_cast<pgp_revocation_type_t>(data[0]);
  628|  37.4k|    reason_.assign(data + 1, data + size);
  629|  37.4k|    return true;
  630|  37.4k|}
_ZNK3pgp3pkt6sigsub16RevocationReason5cloneEv:
  634|  46.8k|{
  635|  46.8k|    return RawPtr(new RevocationReason(*this));
  636|  46.8k|}
_ZNK3pgp3pkt6sigsub8Features5cloneEv:
  641|    961|{
  642|    961|    return RawPtr(new Features(*this));
  643|    961|}
_ZN3pgp3pkt6sigsub17EmbeddedSignatureC2ERKS2_:
  646|  1.09k|EmbeddedSignature::EmbeddedSignature(const EmbeddedSignature &src) : Raw(src)
  647|  1.09k|{
  648|  1.09k|    signature_ = std::unique_ptr<Signature>(new Signature(*src.signature_));
  649|  1.09k|}
_ZN3pgp3pkt6sigsub17EmbeddedSignatureC2Ebb:
  652|  15.6k|    : Raw(Type::EmbeddedSignature, hashed, critical)
  653|  15.6k|{
  654|  15.6k|}
_ZNK3pgp3pkt6sigsub17EmbeddedSignature10check_sizeEm:
  671|  15.6k|{
  672|  15.6k|    return size > 6;
  673|  15.6k|}
_ZN3pgp3pkt6sigsub17EmbeddedSignature10parse_dataEPKhm:
  677|  15.4k|{
  678|  15.4k|    if (parse_depth_ >= MAX_EMBEDDED_SIGNATURE_DEPTH) {
  ------------------
  |  Branch (678:9): [True: 0, False: 15.4k]
  ------------------
  679|      0|        RNP_LOG("embedded signature nesting is too deep: %zu", parse_depth_);
  ------------------
  |  |   84|      0|#define RNP_LOG(...) RNP_LOG_FD(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   76|      0|    do {                                                                                 \
  |  |  |  |   77|      0|        if (!rnp_log_switch())                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   78|      0|            break;                                                                       \
  |  |  |  |   79|      0|        (void) fprintf((fd), "[%s() %s:%d] ", __func__, __SOURCE_PATH_FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define __SOURCE_PATH_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        (void) fprintf((fd), __VA_ARGS__);                                               \
  |  |  |  |   81|      0|        (void) fprintf((fd), "\n");                                                      \
  |  |  |  |   82|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  680|      0|        return false;
  681|      0|    }
  682|  15.4k|    pgp_packet_body_t pkt(data, size);
  683|  15.4k|    Signature         sig;
  684|  15.4k|    if (sig.parse(pkt, parse_depth_ + 1)) {
  ------------------
  |  Branch (684:9): [True: 14.7k, False: 679]
  ------------------
  685|  14.7k|        return false;
  686|  14.7k|    }
  687|    679|    signature_ = std::unique_ptr<Signature>(new Signature(std::move(sig)));
  688|    679|    return true;
  689|  15.4k|}
_ZNK3pgp3pkt6sigsub17EmbeddedSignature5cloneEv:
  712|  1.09k|{
  713|  1.09k|    return RawPtr(new EmbeddedSignature(*this));
  714|  1.09k|}
_ZNK3pgp3pkt6sigsub17IssuerFingerprint10check_sizeEm:
  727|  28.8k|{
  728|  28.8k|    return (size >= 21) && (size <= PGP_MAX_FINGERPRINT_SIZE + 1);
  ------------------
  |  |   45|  28.3k|#define PGP_MAX_FINGERPRINT_SIZE 32
  ------------------
  |  Branch (728:12): [True: 28.3k, False: 439]
  |  Branch (728:28): [True: 28.3k, False: 38]
  ------------------
  729|  28.8k|}
_ZN3pgp3pkt6sigsub17IssuerFingerprint10parse_dataEPKhm:
  733|  28.3k|{
  734|  28.3k|    version_ = data[0];
  735|  28.3k|    fp_ = pgp::Fingerprint(data + 1, size - 1);
  736|  28.3k|    return true;
  737|  28.3k|}
_ZNK3pgp3pkt6sigsub17IssuerFingerprint5cloneEv:
  741|  34.7k|{
  742|  34.7k|    return RawPtr(new IssuerFingerprint(*this));
  743|  34.7k|}
_ZNK3pgp3pkt6sigsub28IntendedRecipientFingerprint10check_sizeEm:
  757|  1.05k|{
  758|  1.05k|    return (size >= 21) && (size <= PGP_MAX_FINGERPRINT_SIZE + 1);
  ------------------
  |  |   45|    918|#define PGP_MAX_FINGERPRINT_SIZE 32
  ------------------
  |  Branch (758:12): [True: 918, False: 135]
  |  Branch (758:28): [True: 643, False: 275]
  ------------------
  759|  1.05k|}
_ZN3pgp3pkt6sigsub28IntendedRecipientFingerprint10parse_dataEPKhm:
  763|    643|{
  764|    643|    version_ = data[0];
  765|    643|    fp_ = pgp::Fingerprint(data + 1, size - 1);
  766|    643|    return true;
  767|    643|}
_ZNK3pgp3pkt6sigsub28IntendedRecipientFingerprint5cloneEv:
  771|    944|{
  772|    944|    return RawPtr(new IntendedRecipientFingerprint(*this));
  773|    944|}
_ZN3pgp3pkt6sigsub4ListC2ERKS2_:
  777|  1.04M|{
  778|  1.04M|    items.reserve(src.items.size());
  779|  1.04M|    for (auto &item : src.items) {
  ------------------
  |  Branch (779:21): [True: 278k, False: 1.04M]
  ------------------
  780|   278k|        items.push_back(item->clone());
  781|   278k|    }
  782|  1.04M|}
sig_subpacket.cpp:_ZN3pgp3pkt6sigsubL14report_unknownEhb:
   94|  55.6k|{
   95|  55.6k|    switch (type) {
   96|    415|    case (uint8_t) Type::Private_100:
  ------------------
  |  Branch (96:5): [True: 415, False: 55.2k]
  ------------------
   97|  1.90k|    case (uint8_t) Type::Private_101:
  ------------------
  |  Branch (97:5): [True: 1.48k, False: 54.1k]
  ------------------
   98|  3.11k|    case (uint8_t) Type::Private_102:
  ------------------
  |  Branch (98:5): [True: 1.20k, False: 54.4k]
  ------------------
   99|  3.78k|    case (uint8_t) Type::Private_103:
  ------------------
  |  Branch (99:5): [True: 676, False: 54.9k]
  ------------------
  100|  5.25k|    case (uint8_t) Type::Private_104:
  ------------------
  |  Branch (100:5): [True: 1.46k, False: 54.1k]
  ------------------
  101|  6.25k|    case (uint8_t) Type::Private_105:
  ------------------
  |  Branch (101:5): [True: 1.00k, False: 54.6k]
  ------------------
  102|  6.53k|    case (uint8_t) Type::Private_106:
  ------------------
  |  Branch (102:5): [True: 277, False: 55.3k]
  ------------------
  103|  7.38k|    case (uint8_t) Type::Private_107:
  ------------------
  |  Branch (103:5): [True: 846, False: 54.8k]
  ------------------
  104|  8.04k|    case (uint8_t) Type::Private_108:
  ------------------
  |  Branch (104:5): [True: 664, False: 54.9k]
  ------------------
  105|  8.74k|    case (uint8_t) Type::Private_109:
  ------------------
  |  Branch (105:5): [True: 700, False: 54.9k]
  ------------------
  106|  9.37k|    case (uint8_t) Type::Private_110:
  ------------------
  |  Branch (106:5): [True: 628, False: 55.0k]
  ------------------
  107|  9.37k|        if (critical) {
  ------------------
  |  Branch (107:13): [True: 967, False: 8.40k]
  ------------------
  108|    967|            RNP_LOG("unknown critical private subpacket %" PRIu8, type);
  ------------------
  |  |   84|    967|#define RNP_LOG(...) RNP_LOG_FD(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   76|    967|    do {                                                                                 \
  |  |  |  |   77|    967|        if (!rnp_log_switch())                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:13): [True: 967, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   78|    967|            break;                                                                       \
  |  |  |  |   79|    967|        (void) fprintf((fd), "[%s() %s:%d] ", __func__, __SOURCE_PATH_FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define __SOURCE_PATH_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        (void) fprintf((fd), __VA_ARGS__);                                               \
  |  |  |  |   81|      0|        (void) fprintf((fd), "\n");                                                      \
  |  |  |  |   82|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  109|    967|        }
  110|  9.37k|        return;
  111|  11.6k|    case (uint8_t) Type::Reserved_1:
  ------------------
  |  Branch (111:5): [True: 11.6k, False: 44.0k]
  ------------------
  112|  12.3k|    case (uint8_t) Type::Reserved_8:
  ------------------
  |  Branch (112:5): [True: 750, False: 54.8k]
  ------------------
  113|  12.7k|    case (uint8_t) Type::Placeholder:
  ------------------
  |  Branch (113:5): [True: 375, False: 55.2k]
  ------------------
  114|  13.5k|    case (uint8_t) Type::Reserved_13:
  ------------------
  |  Branch (114:5): [True: 767, False: 54.8k]
  ------------------
  115|  13.8k|    case (uint8_t) Type::Reserved_14:
  ------------------
  |  Branch (115:5): [True: 379, False: 55.2k]
  ------------------
  116|  14.4k|    case (uint8_t) Type::Reserved_15:
  ------------------
  |  Branch (116:5): [True: 549, False: 55.0k]
  ------------------
  117|  16.7k|    case (uint8_t) Type::Reserved_17:
  ------------------
  |  Branch (117:5): [True: 2.31k, False: 53.3k]
  ------------------
  118|  17.4k|    case (uint8_t) Type::Reserved_18:
  ------------------
  |  Branch (118:5): [True: 658, False: 54.9k]
  ------------------
  119|  18.1k|    case (uint8_t) Type::Reserved_19:
  ------------------
  |  Branch (119:5): [True: 743, False: 54.9k]
  ------------------
  120|       |        /* do not report reserved/placeholder subpacket */
  121|  18.1k|        return;
  122|  28.1k|    default:
  ------------------
  |  Branch (122:5): [True: 28.1k, False: 27.5k]
  ------------------
  123|  28.1k|        RNP_LOG("unknown subpacket : %" PRIu8, type);
  ------------------
  |  |   84|  28.1k|#define RNP_LOG(...) RNP_LOG_FD(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   76|  28.1k|    do {                                                                                 \
  |  |  |  |   77|  28.1k|        if (!rnp_log_switch())                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:13): [True: 28.1k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   78|  28.1k|            break;                                                                       \
  |  |  |  |   79|  28.1k|        (void) fprintf((fd), "[%s() %s:%d] ", __func__, __SOURCE_PATH_FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define __SOURCE_PATH_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        (void) fprintf((fd), __VA_ARGS__);                                               \
  |  |  |  |   81|      0|        (void) fprintf((fd), "\n");                                                      \
  |  |  |  |   82|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  124|  55.6k|    }
  125|  55.6k|}

_ZNK3pgp3pkt6sigsub3Raw8raw_typeEv:
  130|   137k|    {
  131|   137k|        return raw_type_;
  132|   137k|    }
_ZNK3pgp3pkt6sigsub3Raw6hashedEv:
  160|  90.2k|    {
  161|  90.2k|        return hashed_;
  162|  90.2k|    }
_ZN3pgp3pkt6sigsub4TimeC2ENS1_4TypeEbb:
  188|  48.9k|    Time(Type type, bool hashed, bool critical) : Raw(type, hashed, critical), time_(0)
  189|  48.9k|    {
  190|  48.9k|    }
_ZN3pgp3pkt6sigsub12CreationTimeC2Ebb:
  212|  42.9k|        : Time(Type::CreationTime, hashed, critical)
  213|  42.9k|    {
  214|  42.9k|    }
_ZN3pgp3pkt6sigsub14ExpirationTimeC2Ebb:
  223|  4.20k|        : Time(Type::ExpirationTime, hashed, critical)
  224|  4.20k|    {
  225|  4.20k|    }
_ZN3pgp3pkt6sigsub17KeyExpirationTimeC2Ebb:
  234|  1.81k|        : Time(Type::KeyExpirationTime, hashed, critical)
  235|  1.81k|    {
  236|  1.81k|    }
_ZN3pgp3pkt6sigsub4BoolC2ENS1_4TypeEbb:
  251|  3.93k|    Bool(Type type, bool hashed, bool critical) : Raw(type, hashed, critical), value_(false)
  252|  3.93k|    {
  253|  3.93k|    }
_ZN3pgp3pkt6sigsub14ExportableCertC2Ebb:
  262|  1.49k|        : Bool(Type::ExportableCert, hashed, critical)
  263|  1.49k|    {
  264|  1.49k|        value_ = true;
  265|  1.49k|    }
_ZN3pgp3pkt6sigsub5TrustC2Ebb:
  296|  1.63k|        : Raw(Type::Trust, hashed, critical), level_(0), amount_(0)
  297|  1.63k|    {
  298|  1.63k|    }
_ZN3pgp3pkt6sigsub6StringC2ENS1_4TypeEbb:
  339|  9.11k|    String(Type type, bool hashed, bool critical) : Raw(type, hashed, critical)
  340|  9.11k|    {
  341|  9.11k|    }
_ZN3pgp3pkt6sigsub6RegExpC2Ebb:
  349|  2.32k|    RegExp(bool hashed = true, bool critical = false) : String(Type::RegExp, hashed, critical)
  350|  2.32k|    {
  351|  2.32k|    }
_ZN3pgp3pkt6sigsub9RevocableC2Ebb:
  366|  1.42k|        : Bool(Type::Revocable, hashed, critical)
  367|  1.42k|    {
  368|  1.42k|        value_ = true;
  369|  1.42k|    }
_ZN3pgp3pkt6sigsub9PreferredC2ENS1_4TypeEbb:
  398|  9.90k|    Preferred(Type type, bool hashed, bool critical) : Raw(type, hashed, critical){};
_ZN3pgp3pkt6sigsub18PreferredSymmetricC2Ebb:
  420|  2.06k|        : Preferred(Type::PreferredSymmetric, hashed, critical){};
_ZN3pgp3pkt6sigsub13PreferredHashC2Ebb:
  429|  1.12k|        : Preferred(Type::PreferredHash, hashed, critical){};
_ZN3pgp3pkt6sigsub17PreferredCompressC2Ebb:
  438|  1.66k|        : Preferred(Type::PreferredCompress, hashed, critical){};
_ZN3pgp3pkt6sigsub13PreferredAEADC2Ebb:
  447|  2.38k|        : Preferred(Type::PreferredAEAD, hashed, critical){};
_ZN3pgp3pkt6sigsub15PreferredAEADv6C2Ebb:
  460|  2.66k|        : Preferred(Type::PreferredAEADv6, hashed, critical){};
_ZN3pgp3pkt6sigsub13RevocationKeyC2Ebb:
  480|  1.92k|        : Raw(Type::RevocationKey, hashed, critical), rev_class_(0),
  481|  1.92k|          alg_(PGP_PKA_NOTHING), fp_{} {};
_ZN3pgp3pkt6sigsub11IssuerKeyIDC2Ebb:
  537|  41.7k|        : Raw(Type::IssuerKeyID, hashed, critical)
  538|  41.7k|    {
  539|  41.7k|    }
_ZNK3pgp3pkt6sigsub11IssuerKeyID5keyidEv:
  543|    952|    {
  544|    952|        return keyid_;
  545|    952|    }
_ZN3pgp3pkt6sigsub12NotationDataC2Ebb:
  572|  1.01k|        : Raw(Type::NotationData, hashed, critical)
  573|  1.01k|    {
  574|  1.01k|    }
_ZN3pgp3pkt6sigsub5FlagsC2ENS1_4TypeEbb:
  614|  3.86k|        : Raw(type, hashed, critical), flags_(0)
  615|  3.86k|    {
  616|  3.86k|    }
_ZN3pgp3pkt6sigsub14KeyserverPrefsC2Ebb:
  625|  1.07k|        : Flags(Type::KeyserverPrefs, hashed, critical)
  626|  1.07k|    {
  627|  1.07k|    }
_ZN3pgp3pkt6sigsub18PreferredKeyserverC2Ebb:
  662|  2.20k|        : String(Type::PreferredKeyserver, hashed, critical)
  663|  2.20k|    {
  664|  2.20k|    }
_ZN3pgp3pkt6sigsub13PrimaryUserIDC2Ebb:
  686|  1.01k|        : Bool(Type::PrimaryUserID, hashed, critical)
  687|  1.01k|    {
  688|  1.01k|    }
_ZN3pgp3pkt6sigsub9PolicyURIC2Ebb:
  710|  2.08k|        : String(Type::PolicyURI, hashed, critical)
  711|  2.08k|    {
  712|  2.08k|    }
_ZN3pgp3pkt6sigsub8KeyFlagsC2Ebb:
  727|  1.85k|        : Flags(Type::KeyFlags, hashed, critical)
  728|  1.85k|    {
  729|  1.85k|    }
_ZN3pgp3pkt6sigsub13SignersUserIDC2Ebb:
  751|  2.50k|        : String(Type::SignersUserID, hashed, critical)
  752|  2.50k|    {
  753|  2.50k|    }
_ZN3pgp3pkt6sigsub16RevocationReasonC2Ebb:
  784|  37.6k|        : Raw(Type::RevocationReason, hashed, critical), code_(PGP_REVOCATION_NO_REASON)
  785|  37.6k|    {
  786|  37.6k|    }
_ZN3pgp3pkt6sigsub8FeaturesC2Ebb:
  821|    939|        : Flags(Type::Features, hashed, critical)
  822|    939|    {
  823|    939|    }
_ZN3pgp3pkt6sigsub17IssuerFingerprintC2Ebb:
  877|  28.8k|        : Raw(Type::IssuerFingerprint, hashed, critical), version_(0), fp_{}
  878|  28.8k|    {
  879|  28.8k|    }
_ZNK3pgp3pkt6sigsub17IssuerFingerprint2fpEv:
  896|  89.5k|    {
  897|  89.5k|        return fp_;
  898|  89.5k|    }
_ZN3pgp3pkt6sigsub28IntendedRecipientFingerprintC2Ebb:
  924|  1.05k|        : Raw(Type::IntendedRecipientFingerprint, hashed, critical), version_(0), fp_{}
  925|  1.05k|    {
  926|  1.05k|    }
_ZN3pgp3pkt6sigsub4ListC2Ev:
  963|   606k|    {
  964|   606k|    }
_ZNK3pgp3pkt6sigsub4List4sizeEv:
  994|   536k|    {
  995|   536k|        return items.size();
  996|   536k|    }
_ZNK3pgp3pkt6sigsub4ListixEm:
 1006|   318k|    {
 1007|   318k|        return items[idx];
 1008|   318k|    }

_ZN3rnp13rnp_exceptionC2Ej:
  101|    923|    rnp_exception(rnp_result_t code = RNP_ERROR_GENERIC) : code_(code){};
_ZNK3rnp13rnp_exception4whatEv:
  104|    923|    {
  105|    923|        return "rnp_exception";
  106|    923|    };
_ZNK3rnp13rnp_exception4codeEv:
  109|    923|    {
  110|    923|        return code_;
  111|    923|    };

_ZN11id_str_pair6lookupEPKS_iPKc:
   32|  90.7k|{
   33|   181k|    while (pair && pair->str) {
  ------------------
  |  Branch (33:12): [True: 181k, False: 0]
  |  Branch (33:20): [True: 181k, False: 0]
  ------------------
   34|   181k|        if (pair->id == id) {
  ------------------
  |  Branch (34:13): [True: 90.7k, False: 90.7k]
  ------------------
   35|  90.7k|            return pair->str;
   36|  90.7k|        }
   37|  90.7k|        pair++;
   38|  90.7k|    }
   39|      0|    return notfound;
   40|  90.7k|}

_Z11read_uint16PKh:
   61|  1.83M|{
   62|  1.83M|    return ((uint16_t) buf[0] << 8) | buf[1];
   63|  1.83M|}
_Z11read_uint32PKh:
   68|  48.0k|{
   69|  48.0k|    return ((uint32_t) buf[0] << 24) | ((uint32_t) buf[1] << 16) | ((uint32_t) buf[2] << 8) |
   70|  48.0k|           (uint32_t) buf[3];
   71|  48.0k|}

_ZN3rnp8KeyStore5clearEv:
  209|  8.88k|{
  210|  8.88k|    keybyfp.clear();
  211|  8.88k|    keys.clear();
  212|  8.88k|    blobs.clear();
  213|  8.88k|}
_ZN3rnp8KeyStore16import_signatureERKN3pgp3pkt9SignatureEP23pgp_sig_import_status_t:
  554|   108k|{
  555|   108k|    pgp_sig_import_status_t tmp_status = PGP_SIG_IMPORT_STATUS_UNKNOWN;
  556|   108k|    if (!status) {
  ------------------
  |  Branch (556:9): [True: 0, False: 108k]
  ------------------
  557|      0|        status = &tmp_status;
  558|      0|    }
  559|   108k|    *status = PGP_SIG_IMPORT_STATUS_UNKNOWN;
  560|       |
  561|       |    /* we support only direct-key and key revocation signatures here */
  562|   108k|    if ((sig.type() != PGP_SIG_DIRECT) && (sig.type() != PGP_SIG_REV_KEY)) {
  ------------------
  |  Branch (562:9): [True: 65.9k, False: 42.8k]
  |  Branch (562:43): [True: 18.0k, False: 47.8k]
  ------------------
  563|  18.0k|        return nullptr;
  564|  18.0k|    }
  565|       |
  566|  90.7k|    auto *res_key = get_signer(sig);
  567|  90.7k|    if (!res_key || !res_key->is_primary()) {
  ------------------
  |  Branch (567:9): [True: 90.7k, False: 0]
  |  Branch (567:21): [True: 0, False: 0]
  ------------------
  568|  90.7k|        *status = PGP_SIG_IMPORT_STATUS_UNKNOWN_KEY;
  569|  90.7k|        return nullptr;
  570|  90.7k|    }
  571|      0|    *status = import_signature(*res_key, sig);
  572|      0|    return res_key;
  573|  90.7k|}
_ZN3rnp8KeyStore7get_keyERKN3pgp11FingerprintE:
  623|  43.6k|{
  624|  43.6k|    auto it = keybyfp.find(fpr);
  625|  43.6k|    if (it == keybyfp.end()) {
  ------------------
  |  Branch (625:9): [True: 43.6k, False: 0]
  ------------------
  626|  43.6k|        return nullptr;
  627|  43.6k|    }
  628|      0|    return &*it->second;
  629|  43.6k|}
_ZN3rnp8KeyStore6searchERKNS_9KeySearchEPNS_3KeyE:
  674|  46.7k|{
  675|       |    // since keys are distinguished by fingerprint then just do map lookup
  676|  46.7k|    if (search.type() == KeySearch::Type::Fingerprint) {
  ------------------
  |  Branch (676:9): [True: 43.6k, False: 3.05k]
  ------------------
  677|  43.6k|        auto fpsearch = dynamic_cast<const KeyFingerprintSearch *>(&search);
  678|  43.6k|        assert(fpsearch != nullptr);
  679|  43.6k|        auto key = get_key(fpsearch->get_fp());
  680|  43.6k|        if (after && (after != key)) {
  ------------------
  |  Branch (680:13): [True: 0, False: 43.6k]
  |  Branch (680:22): [True: 0, False: 0]
  ------------------
  681|      0|            RNP_LOG("searching with invalid after param");
  ------------------
  |  |   84|      0|#define RNP_LOG(...) RNP_LOG_FD(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   76|      0|    do {                                                                                 \
  |  |  |  |   77|      0|        if (!rnp_log_switch())                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   78|      0|            break;                                                                       \
  |  |  |  |   79|      0|        (void) fprintf((fd), "[%s() %s:%d] ", __func__, __SOURCE_PATH_FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define __SOURCE_PATH_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        (void) fprintf((fd), __VA_ARGS__);                                               \
  |  |  |  |   81|      0|        (void) fprintf((fd), "\n");                                                      \
  |  |  |  |   82|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  682|      0|            return nullptr;
  683|      0|        }
  684|       |        // return NULL if after is specified
  685|  43.6k|        return after ? nullptr : key;
  ------------------
  |  Branch (685:16): [True: 0, False: 43.6k]
  ------------------
  686|  43.6k|    }
  687|       |
  688|       |    // if after is provided, make sure it is a member of the appropriate list
  689|  3.05k|    auto it = std::find_if(
  690|  3.05k|      keys.begin(), keys.end(), [after](const Key &key) { return !after || (after == &key); });
  691|  3.05k|    if (after && (it == keys.end())) {
  ------------------
  |  Branch (691:9): [True: 0, False: 3.05k]
  |  Branch (691:9): [True: 0, False: 3.05k]
  |  Branch (691:18): [True: 0, False: 0]
  ------------------
  692|      0|        RNP_LOG("searching with non-keyrings after param");
  ------------------
  |  |   84|      0|#define RNP_LOG(...) RNP_LOG_FD(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   76|      0|    do {                                                                                 \
  |  |  |  |   77|      0|        if (!rnp_log_switch())                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   78|      0|            break;                                                                       \
  |  |  |  |   79|      0|        (void) fprintf((fd), "[%s() %s:%d] ", __func__, __SOURCE_PATH_FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define __SOURCE_PATH_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        (void) fprintf((fd), __VA_ARGS__);                                               \
  |  |  |  |   81|      0|        (void) fprintf((fd), "\n");                                                      \
  |  |  |  |   82|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  693|      0|        return nullptr;
  694|      0|    }
  695|  3.05k|    if (after) {
  ------------------
  |  Branch (695:9): [True: 0, False: 3.05k]
  ------------------
  696|      0|        it = std::next(it);
  697|      0|    }
  698|  3.05k|    it =
  699|  3.05k|      std::find_if(it, keys.end(), [&search](const Key &key) { return search.matches(key); });
  700|  3.05k|    return (it == keys.end()) ? nullptr : &(*it);
  ------------------
  |  Branch (700:12): [True: 3.05k, False: 0]
  ------------------
  701|  3.05k|}
_ZN3rnp8KeyStore10get_signerERKN3pgp3pkt9SignatureEPKNS_11KeyProviderE:
  705|  90.7k|{
  706|       |    /* if we have fingerprint let's check it */
  707|  90.7k|    std::unique_ptr<KeySearch> ks;
  708|  90.7k|    if (sig.has_keyfp()) {
  ------------------
  |  Branch (708:9): [True: 43.6k, False: 47.0k]
  ------------------
  709|  43.6k|        ks = KeySearch::create(sig.keyfp());
  710|  47.0k|    } else if (sig.has_keyid()) {
  ------------------
  |  Branch (710:16): [True: 3.05k, False: 43.9k]
  ------------------
  711|  3.05k|        ks = KeySearch::create(sig.keyid());
  712|  43.9k|    } else {
  713|  43.9k|        RNP_LOG("No way to search for the signer.");
  ------------------
  |  |   84|  43.9k|#define RNP_LOG(...) RNP_LOG_FD(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   76|  43.9k|    do {                                                                                 \
  |  |  |  |   77|  43.9k|        if (!rnp_log_switch())                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:13): [True: 43.9k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   78|  43.9k|            break;                                                                       \
  |  |  |  |   79|  43.9k|        (void) fprintf((fd), "[%s() %s:%d] ", __func__, __SOURCE_PATH_FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define __SOURCE_PATH_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        (void) fprintf((fd), __VA_ARGS__);                                               \
  |  |  |  |   81|      0|        (void) fprintf((fd), "\n");                                                      \
  |  |  |  |   82|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  714|  43.9k|        return nullptr;
  715|  43.9k|    }
  716|       |
  717|  46.7k|    auto key = search(*ks);
  718|  46.7k|    if (key || !prov) {
  ------------------
  |  Branch (718:9): [True: 0, False: 46.7k]
  |  Branch (718:16): [True: 46.7k, False: 0]
  ------------------
  719|  46.7k|        return key;
  720|  46.7k|    }
  721|      0|    return prov->request_key(*ks, PGP_OP_VERIFY);
  722|  46.7k|}
_ZN3rnp8KeyStoreC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERNS_15SecurityContextENS_9KeyFormatE:
  725|  8.88k|    : secctx(ctx)
  726|  8.88k|{
  727|  8.88k|    if (_format == KeyFormat::Unknown) {
  ------------------
  |  Branch (727:9): [True: 0, False: 8.88k]
  ------------------
  728|      0|        RNP_LOG("Invalid key store format");
  ------------------
  |  |   84|      0|#define RNP_LOG(...) RNP_LOG_FD(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   76|      0|    do {                                                                                 \
  |  |  |  |   77|      0|        if (!rnp_log_switch())                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   78|      0|            break;                                                                       \
  |  |  |  |   79|      0|        (void) fprintf((fd), "[%s() %s:%d] ", __func__, __SOURCE_PATH_FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define __SOURCE_PATH_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        (void) fprintf((fd), __VA_ARGS__);                                               \
  |  |  |  |   81|      0|        (void) fprintf((fd), "\n");                                                      \
  |  |  |  |   82|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  729|      0|        throw std::invalid_argument("format");
  730|      0|    }
  731|  8.88k|    format = _format;
  732|  8.88k|    path = _path;
  733|  8.88k|}
_ZN3rnp8KeyStoreD2Ev:
  736|  8.88k|{
  737|  8.88k|    clear();
  738|  8.88k|}

_Z16init_armored_srcP12pgp_source_tS0_b:
  939|  43.9k|{
  940|  43.9k|    if (!init_src_common(src, 0)) {
  ------------------
  |  Branch (940:9): [True: 0, False: 43.9k]
  ------------------
  941|      0|        return RNP_ERROR_OUT_OF_MEMORY;
  942|      0|    }
  943|  43.9k|    pgp_source_armored_param_t *param = new (std::nothrow) pgp_source_armored_param_t();
  944|  43.9k|    if (!param) {
  ------------------
  |  Branch (944:9): [True: 0, False: 43.9k]
  ------------------
  945|      0|        RNP_LOG("allocation failed");
  ------------------
  |  |   84|      0|#define RNP_LOG(...) RNP_LOG_FD(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   76|      0|    do {                                                                                 \
  |  |  |  |   77|      0|        if (!rnp_log_switch())                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   78|      0|            break;                                                                       \
  |  |  |  |   79|      0|        (void) fprintf((fd), "[%s() %s:%d] ", __func__, __SOURCE_PATH_FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define __SOURCE_PATH_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        (void) fprintf((fd), __VA_ARGS__);                                               \
  |  |  |  |   81|      0|        (void) fprintf((fd), "\n");                                                      \
  |  |  |  |   82|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  946|      0|        return RNP_ERROR_OUT_OF_MEMORY;
  947|      0|    }
  948|       |
  949|  43.9k|    param->readsrc = readsrc;
  950|  43.9k|    param->noheaders = noheaders;
  951|  43.9k|    src->param = param;
  952|  43.9k|    src->raw_read = armored_src_read;
  953|  43.9k|    src->raw_close = armored_src_close;
  954|  43.9k|    src->type = PGP_STREAM_ARMORED;
  955|       |
  956|       |    /* base64 data only */
  957|  43.9k|    if (noheaders) {
  ------------------
  |  Branch (957:9): [True: 0, False: 43.9k]
  ------------------
  958|      0|        return RNP_SUCCESS;
  959|      0|    }
  960|       |
  961|       |    /* initialize crc context */
  962|  43.9k|    param->crc_ctx = rnp::CRC24::create();
  963|       |    /* parsing armored header */
  964|  43.9k|    rnp_result_t errcode = RNP_ERROR_GENERIC;
  965|  43.9k|    if (!armor_parse_header(param)) {
  ------------------
  |  Branch (965:9): [True: 442, False: 43.4k]
  ------------------
  966|    442|        errcode = RNP_ERROR_BAD_FORMAT;
  967|    442|        goto finish;
  968|    442|    }
  969|       |    /* eol */
  970|  43.4k|    if (!param->readsrc->skip_eol()) {
  ------------------
  |  Branch (970:9): [True: 89, False: 43.3k]
  ------------------
  971|     89|        RNP_LOG("no eol after the armor header");
  ------------------
  |  |   84|     89|#define RNP_LOG(...) RNP_LOG_FD(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   76|     89|    do {                                                                                 \
  |  |  |  |   77|     89|        if (!rnp_log_switch())                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:13): [True: 89, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   78|     89|            break;                                                                       \
  |  |  |  |   79|     89|        (void) fprintf((fd), "[%s() %s:%d] ", __func__, __SOURCE_PATH_FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define __SOURCE_PATH_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        (void) fprintf((fd), __VA_ARGS__);                                               \
  |  |  |  |   81|      0|        (void) fprintf((fd), "\n");                                                      \
  |  |  |  |   82|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  972|     89|        errcode = RNP_ERROR_BAD_FORMAT;
  973|     89|        goto finish;
  974|     89|    }
  975|       |    /* parsing headers */
  976|  43.3k|    if (!armor_parse_headers(param)) {
  ------------------
  |  Branch (976:9): [True: 392, False: 42.9k]
  ------------------
  977|    392|        RNP_LOG("failed to parse headers");
  ------------------
  |  |   84|    392|#define RNP_LOG(...) RNP_LOG_FD(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   76|    392|    do {                                                                                 \
  |  |  |  |   77|    392|        if (!rnp_log_switch())                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:13): [True: 392, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   78|    392|            break;                                                                       \
  |  |  |  |   79|    392|        (void) fprintf((fd), "[%s() %s:%d] ", __func__, __SOURCE_PATH_FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define __SOURCE_PATH_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        (void) fprintf((fd), __VA_ARGS__);                                               \
  |  |  |  |   81|      0|        (void) fprintf((fd), "\n");                                                      \
  |  |  |  |   82|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  978|    392|        errcode = RNP_ERROR_BAD_FORMAT;
  979|    392|        goto finish;
  980|    392|    }
  981|       |
  982|       |    /* now we are good to go with base64-encoded data */
  983|  42.9k|    errcode = RNP_SUCCESS;
  984|  43.9k|finish:
  985|  43.9k|    if (errcode) {
  ------------------
  |  Branch (985:9): [True: 923, False: 42.9k]
  ------------------
  986|    923|        src->close();
  987|    923|    }
  988|  43.9k|    return errcode;
  989|  42.9k|}
_ZN12pgp_source_t10is_armoredEv:
 1293|  4.44k|{
 1294|  4.44k|    char   buf[ARMORED_PEEK_BUF_SIZE] = {0};
 1295|  4.44k|    size_t read = 0;
 1296|       |
 1297|  4.44k|    if (!peek(buf, sizeof(buf) - 1, &read) || (read < strlen(ST_ARMOR_BEGIN) + 1)) {
  ------------------
  |  |   46|  4.44k|#define ST_ARMOR_BEGIN ("-----BEGIN PGP ")
  ------------------
  |  Branch (1297:9): [True: 0, False: 4.44k]
  |  Branch (1297:47): [True: 450, False: 3.99k]
  ------------------
 1298|    450|        return false;
 1299|    450|    }
 1300|  3.99k|    buf[read] = 0;
 1301|  3.99k|    if (!!strstr(buf, ST_CLEAR_BEGIN)) {
  ------------------
  |  |   48|  3.99k|#define ST_CLEAR_BEGIN ("-----BEGIN PGP SIGNED MESSAGE-----")
  ------------------
  |  Branch (1301:9): [True: 2, False: 3.99k]
  ------------------
 1302|      2|        return false;
 1303|      2|    }
 1304|  3.99k|    return !!strstr(buf, ST_ARMOR_BEGIN);
  ------------------
  |  |   46|  3.99k|#define ST_ARMOR_BEGIN ("-----BEGIN PGP ")
  ------------------
 1305|  3.99k|}
_ZN3rnp13ArmoredSourceC2ER12pgp_source_tj:
 1378|  4.44k|    : Source(), readsrc_(readsrc), multiple_(false)
 1379|  4.44k|{
 1380|       |    /* Do not dearmor already armored stream */
 1381|  4.44k|    bool already = readsrc_.type == PGP_STREAM_ARMORED;
 1382|       |    /* Check for base64 source: no multiple streams allowed */
 1383|  4.44k|    if (!already && (flags & AllowBase64) && (readsrc.is_base64())) {
  ------------------
  |  Branch (1383:9): [True: 4.44k, False: 0]
  |  Branch (1383:21): [True: 0, False: 4.44k]
  |  Branch (1383:46): [True: 0, False: 0]
  ------------------
 1384|      0|        auto res = init_armored_src(&src_, &readsrc_, true);
 1385|      0|        if (res) {
  ------------------
  |  Branch (1385:13): [True: 0, False: 0]
  ------------------
 1386|      0|            RNP_LOG("Failed to parse base64 data.");
  ------------------
  |  |   84|      0|#define RNP_LOG(...) RNP_LOG_FD(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   76|      0|    do {                                                                                 \
  |  |  |  |   77|      0|        if (!rnp_log_switch())                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   78|      0|            break;                                                                       \
  |  |  |  |   79|      0|        (void) fprintf((fd), "[%s() %s:%d] ", __func__, __SOURCE_PATH_FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define __SOURCE_PATH_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        (void) fprintf((fd), __VA_ARGS__);                                               \
  |  |  |  |   81|      0|        (void) fprintf((fd), "\n");                                                      \
  |  |  |  |   82|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1387|      0|            throw rnp::rnp_exception(res);
 1388|      0|        }
 1389|      0|        armored_ = true;
 1390|      0|        return;
 1391|      0|    }
 1392|       |    /* Check for armored source */
 1393|  4.44k|    if (!already && readsrc.is_armored()) {
  ------------------
  |  Branch (1393:9): [True: 4.44k, False: 0]
  |  Branch (1393:21): [True: 1.68k, False: 2.76k]
  ------------------
 1394|  1.68k|        auto res = init_armored_src(&src_, &readsrc_);
 1395|  1.68k|        if (res) {
  ------------------
  |  Branch (1395:13): [True: 728, False: 954]
  ------------------
 1396|    728|            RNP_LOG("Failed to parse armored data.");
  ------------------
  |  |   84|    728|#define RNP_LOG(...) RNP_LOG_FD(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   76|    728|    do {                                                                                 \
  |  |  |  |   77|    728|        if (!rnp_log_switch())                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:13): [True: 728, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   78|    728|            break;                                                                       \
  |  |  |  |   79|    728|        (void) fprintf((fd), "[%s() %s:%d] ", __func__, __SOURCE_PATH_FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define __SOURCE_PATH_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        (void) fprintf((fd), __VA_ARGS__);                                               \
  |  |  |  |   81|      0|        (void) fprintf((fd), "\n");                                                      \
  |  |  |  |   82|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1397|    728|            throw rnp::rnp_exception(res);
 1398|    728|        }
 1399|    954|        armored_ = true;
 1400|    954|        multiple_ = flags & AllowMultiple;
 1401|    954|        return;
 1402|  1.68k|    }
 1403|       |    /* Use binary source if allowed */
 1404|  2.76k|    if (!(flags & AllowBinary)) {
  ------------------
  |  Branch (1404:9): [True: 0, False: 2.76k]
  ------------------
 1405|      0|        RNP_LOG("Non-armored data is not allowed here.");
  ------------------
  |  |   84|      0|#define RNP_LOG(...) RNP_LOG_FD(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   76|      0|    do {                                                                                 \
  |  |  |  |   77|      0|        if (!rnp_log_switch())                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   78|      0|            break;                                                                       \
  |  |  |  |   79|      0|        (void) fprintf((fd), "[%s() %s:%d] ", __func__, __SOURCE_PATH_FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define __SOURCE_PATH_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        (void) fprintf((fd), __VA_ARGS__);                                               \
  |  |  |  |   81|      0|        (void) fprintf((fd), "\n");                                                      \
  |  |  |  |   82|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1406|      0|        throw rnp::rnp_exception(RNP_ERROR_BAD_PARAMETERS);
 1407|      0|    }
 1408|  2.76k|    armored_ = false;
 1409|  2.76k|}
_ZN3rnp13ArmoredSource7restartEv:
 1413|  42.2k|{
 1414|  42.2k|    if (!armored_ || readsrc_.eof() || readsrc_.error()) {
  ------------------
  |  Branch (1414:9): [True: 0, False: 42.2k]
  |  Branch (1414:22): [True: 41, False: 42.2k]
  |  Branch (1414:40): [True: 0, False: 42.2k]
  ------------------
 1415|     41|        return;
 1416|     41|    }
 1417|  42.2k|    src_.close();
 1418|  42.2k|    auto res = init_armored_src(&src_, &readsrc_);
 1419|  42.2k|    if (res) {
  ------------------
  |  Branch (1419:9): [True: 195, False: 42.0k]
  ------------------
 1420|    195|        throw rnp::rnp_exception(res);
 1421|    195|    }
 1422|  42.2k|}
_ZN3rnp13ArmoredSource3srcEv:
 1426|  2.95M|{
 1427|  2.95M|    return armored_ ? src_ : readsrc_;
  ------------------
  |  Branch (1427:12): [True: 219k, False: 2.73M]
  ------------------
 1428|  2.95M|}
stream-armor.cpp:_ZL22armor_str_to_data_typeRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE:
  715|  43.7k|{
  716|  43.7k|    if ((str == "MESSAGE") || (str == "ARMORED FILE")) {
  ------------------
  |  Branch (716:9): [True: 9.72k, False: 34.0k]
  |  Branch (716:31): [True: 369, False: 33.6k]
  ------------------
  717|  10.0k|        return PGP_ARMORED_MESSAGE;
  718|  10.0k|    }
  719|  33.6k|    if ((str == "PUBLIC KEY BLOCK") || (str == "PUBLIC KEY")) {
  ------------------
  |  Branch (719:9): [True: 374, False: 33.2k]
  |  Branch (719:40): [True: 265, False: 32.9k]
  ------------------
  720|    639|        return PGP_ARMORED_PUBLIC_KEY;
  721|    639|    }
  722|  32.9k|    if ((str == "SECRET KEY BLOCK") || (str == "SECRET KEY") || (str == "PRIVATE KEY BLOCK") ||
  ------------------
  |  Branch (722:9): [True: 456, False: 32.5k]
  |  Branch (722:40): [True: 224, False: 32.3k]
  |  Branch (722:65): [True: 803, False: 31.5k]
  ------------------
  723|  31.5k|        (str == "PRIVATE KEY")) {
  ------------------
  |  Branch (723:9): [True: 393, False: 31.1k]
  ------------------
  724|  1.87k|        return PGP_ARMORED_SECRET_KEY;
  725|  1.87k|    }
  726|  31.1k|    if (str == "SIGNATURE") {
  ------------------
  |  Branch (726:9): [True: 30.8k, False: 251]
  ------------------
  727|  30.8k|        return PGP_ARMORED_SIGNATURE;
  728|  30.8k|    }
  729|    251|    return PGP_ARMORED_UNKNOWN;
  730|  31.1k|}
stream-armor.cpp:_ZL17peek_armor_headerR12pgp_source_tPmb:
  797|  43.9k|{
  798|  43.9k|    std::string hdr(ARMORED_PEEK_BUF_SIZE, '\0');
  ------------------
  |  |   46|  43.9k|#define ARMORED_PEEK_BUF_SIZE 1024
  ------------------
  799|  43.9k|    size_t      read = 0;
  800|  43.9k|    if (skip) {
  ------------------
  |  Branch (800:9): [True: 43.9k, False: 0]
  ------------------
  801|  43.9k|        *skip = 0;
  802|  43.9k|    }
  803|  43.9k|    if (!src.peek(&hdr.front(), hdr.size(), &read) || (read < 20)) {
  ------------------
  |  Branch (803:9): [True: 0, False: 43.9k]
  |  Branch (803:55): [True: 32, False: 43.8k]
  ------------------
  804|     32|        return "";
  805|     32|    }
  806|  43.8k|    hdr.resize(read);
  807|       |
  808|  43.8k|    std::string type;
  809|  43.8k|    size_t      armhdrlen = 0;
  810|  43.8k|    size_t      pos = find_armor_header(hdr, armhdrlen, type);
  811|  43.8k|    if (pos == std::string::npos) {
  ------------------
  |  Branch (811:9): [True: 134, False: 43.7k]
  ------------------
  812|    134|        return "";
  813|    134|    }
  814|       |
  815|       |    /* if there are non-whitespaces before the armor header then issue warning */
  816|  46.6k|    for (size_t idx = 0; check && (idx < pos); idx++) {
  ------------------
  |  Branch (816:26): [True: 46.6k, False: 0]
  |  Branch (816:35): [True: 9.39k, False: 37.2k]
  ------------------
  817|  9.39k|        if (B64DEC[(uint8_t) hdr[idx]] != 0xfd) {
  ------------------
  |  Branch (817:13): [True: 6.51k, False: 2.88k]
  ------------------
  818|  6.51k|            RNP_LOG("extra data before the header line");
  ------------------
  |  |   84|  6.51k|#define RNP_LOG(...) RNP_LOG_FD(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   76|  6.51k|    do {                                                                                 \
  |  |  |  |   77|  6.51k|        if (!rnp_log_switch())                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:13): [True: 6.51k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   78|  6.51k|            break;                                                                       \
  |  |  |  |   79|  6.51k|        (void) fprintf((fd), "[%s() %s:%d] ", __func__, __SOURCE_PATH_FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define __SOURCE_PATH_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        (void) fprintf((fd), __VA_ARGS__);                                               \
  |  |  |  |   81|      0|        (void) fprintf((fd), "\n");                                                      \
  |  |  |  |   82|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  819|  6.51k|            break;
  820|  6.51k|        }
  821|  9.39k|    }
  822|       |
  823|  43.7k|    if (skip) {
  ------------------
  |  Branch (823:9): [True: 43.7k, False: 0]
  ------------------
  824|  43.7k|        *skip = armhdrlen;
  825|  43.7k|    }
  826|  43.7k|    return type;
  827|  43.8k|}
stream-armor.cpp:_ZL17find_armor_headerRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERmRS5_:
  698|  43.8k|{
  699|  43.8k|    size_t bg_len = strlen(ST_ARMOR_BEGIN);
  ------------------
  |  |   46|  43.8k|#define ST_ARMOR_BEGIN ("-----BEGIN PGP ")
  ------------------
  700|  43.8k|    size_t pos = str.find(ST_ARMOR_BEGIN);
  ------------------
  |  |   46|  43.8k|#define ST_ARMOR_BEGIN ("-----BEGIN PGP ")
  ------------------
  701|  43.8k|    if (pos == std::string::npos) {
  ------------------
  |  Branch (701:9): [True: 17, False: 43.8k]
  ------------------
  702|     17|        return pos;
  703|     17|    }
  704|  43.8k|    size_t end = str.find(ST_DASHES, pos + bg_len);
  ------------------
  |  |   45|  43.8k|#define ST_DASHES ("-----")
  ------------------
  705|  43.8k|    if (end == std::string::npos) {
  ------------------
  |  Branch (705:9): [True: 117, False: 43.7k]
  ------------------
  706|    117|        return end;
  707|    117|    }
  708|  43.7k|    hdrlen = end + 5;
  709|  43.7k|    type.assign(str.begin() + pos + bg_len, str.begin() + end);
  710|  43.7k|    return pos;
  711|  43.8k|}
stream-armor.cpp:_ZL16armored_src_readP12pgp_source_tPvmPm:
  476|  85.2k|{
  477|  85.2k|    pgp_source_armored_param_t *param = (pgp_source_armored_param_t *) src->param;
  478|  85.2k|    uint8_t  b64buf[ARMORED_BLOCK_SIZE];     /* input base64 data with spaces and so on */
  479|  85.2k|    uint8_t  decbuf[ARMORED_BLOCK_SIZE + 4]; /* decoded 6-bit values */
  480|  85.2k|    uint8_t *bufptr = (uint8_t *) buf;       /* for better readability below */
  481|  85.2k|    uint8_t *bptr, *bend;                    /* pointer to input data in b64buf */
  482|  85.2k|    uint8_t *dptr, *dend, *pend; /* pointers to decoded data in decbuf: working pointer, last
  483|       |                                    available byte, last byte to process */
  484|  85.2k|    uint8_t  bval;
  485|  85.2k|    uint32_t b24;
  486|  85.2k|    size_t   read = 0;
  487|  85.2k|    size_t   left = len;
  488|  85.2k|    size_t   eqcount = 0; /* number of '=' at the end of base64 stream */
  489|       |
  490|  85.2k|    if (!param) {
  ------------------
  |  Branch (490:9): [True: 0, False: 85.2k]
  ------------------
  491|      0|        return false;
  492|      0|    }
  493|       |
  494|       |    /* checking whether there are some decoded bytes */
  495|  85.2k|    if (param->restpos < param->restlen) {
  ------------------
  |  Branch (495:9): [True: 91, False: 85.1k]
  ------------------
  496|     91|        if (param->restlen - param->restpos >= len) {
  ------------------
  |  Branch (496:13): [True: 0, False: 91]
  ------------------
  497|      0|            memcpy(bufptr, &param->rest[param->restpos], len);
  498|      0|            param->restpos += len;
  499|      0|            try {
  500|      0|                param->crc_ctx->add(bufptr, len);
  501|      0|            } catch (const std::exception &e) {
  502|      0|                RNP_LOG("%s", e.what());
  ------------------
  |  |   84|      0|#define RNP_LOG(...) RNP_LOG_FD(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   76|      0|    do {                                                                                 \
  |  |  |  |   77|      0|        if (!rnp_log_switch())                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   78|      0|            break;                                                                       \
  |  |  |  |   79|      0|        (void) fprintf((fd), "[%s() %s:%d] ", __func__, __SOURCE_PATH_FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define __SOURCE_PATH_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        (void) fprintf((fd), __VA_ARGS__);                                               \
  |  |  |  |   81|      0|        (void) fprintf((fd), "\n");                                                      \
  |  |  |  |   82|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  503|      0|                return false;
  504|      0|            }
  505|      0|            *readres = len;
  506|      0|            return true;
  507|     91|        } else {
  508|     91|            left = len - (param->restlen - param->restpos);
  509|     91|            memcpy(bufptr, &param->rest[param->restpos], len - left);
  510|     91|            param->restpos = param->restlen = 0;
  511|     91|            bufptr += len - left;
  512|     91|        }
  513|     91|    }
  514|       |
  515|  85.2k|    if (param->eofb64) {
  ------------------
  |  Branch (515:9): [True: 42.1k, False: 43.0k]
  ------------------
  516|  42.1k|        *readres = len - left;
  517|  42.1k|        return true;
  518|  42.1k|    }
  519|       |
  520|  43.0k|    memcpy(decbuf, param->brest, param->brestlen);
  521|  43.0k|    dend = decbuf + param->brestlen;
  522|       |
  523|  45.7k|    do {
  524|  45.7k|        if (!param->readsrc->peek(b64buf, sizeof(b64buf), &read)) {
  ------------------
  |  Branch (524:13): [True: 0, False: 45.7k]
  ------------------
  525|      0|            return false;
  526|      0|        }
  527|  45.7k|        if (!read) {
  ------------------
  |  Branch (527:13): [True: 129, False: 45.6k]
  ------------------
  528|    129|            RNP_LOG("premature end of armored input");
  ------------------
  |  |   84|    129|#define RNP_LOG(...) RNP_LOG_FD(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   76|    129|    do {                                                                                 \
  |  |  |  |   77|    129|        if (!rnp_log_switch())                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:13): [True: 129, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   78|    129|            break;                                                                       \
  |  |  |  |   79|    129|        (void) fprintf((fd), "[%s() %s:%d] ", __func__, __SOURCE_PATH_FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define __SOURCE_PATH_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        (void) fprintf((fd), __VA_ARGS__);                                               \
  |  |  |  |   81|      0|        (void) fprintf((fd), "\n");                                                      \
  |  |  |  |   82|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  529|    129|            return false;
  530|    129|        }
  531|       |
  532|  45.6k|        dptr = dend;
  533|  45.6k|        bptr = b64buf;
  534|  45.6k|        bend = b64buf + read;
  535|       |        /* checking input data, stripping away whitespaces, checking for end of the b64 data */
  536|  18.7M|        while (bptr < bend) {
  ------------------
  |  Branch (536:16): [True: 18.7M, False: 2.75k]
  ------------------
  537|  18.7M|            if ((bval = B64DEC[*(bptr++)]) < 64) {
  ------------------
  |  Branch (537:17): [True: 17.2M, False: 1.55M]
  ------------------
  538|  17.2M|                *(dptr++) = bval;
  539|  17.2M|            } else if (bval == 0xfe) {
  ------------------
  |  Branch (539:24): [True: 42.1k, False: 1.51M]
  ------------------
  540|       |                /* '=' means the base64 padding or the beginning of checksum */
  541|  42.1k|                param->eofb64 = true;
  542|  42.1k|                break;
  543|  1.51M|            } else if (bval == 0xff) {
  ------------------
  |  Branch (543:24): [True: 713, False: 1.51M]
  ------------------
  544|    713|                auto ch = *(bptr - 1);
  545|       |                /* OpenPGP message headers without the crc and without trailing = */
  546|    713|                if ((ch == CH_DASH) && !param->noheaders) {
  ------------------
  |  |   34|    713|#define CH_DASH ('-')
  ------------------
  |  Branch (546:21): [True: 675, False: 38]
  |  Branch (546:40): [True: 675, False: 0]
  ------------------
  547|    675|                    param->eofb64 = true;
  548|    675|                    break;
  549|    675|                }
  550|     38|                RNP_LOG("wrong base64 character 0x%02hhX", ch);
  ------------------
  |  |   84|     38|#define RNP_LOG(...) RNP_LOG_FD(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   76|     38|    do {                                                                                 \
  |  |  |  |   77|     38|        if (!rnp_log_switch())                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:13): [True: 38, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   78|     38|            break;                                                                       \
  |  |  |  |   79|     38|        (void) fprintf((fd), "[%s() %s:%d] ", __func__, __SOURCE_PATH_FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define __SOURCE_PATH_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        (void) fprintf((fd), __VA_ARGS__);                                               \
  |  |  |  |   81|      0|        (void) fprintf((fd), "\n");                                                      \
  |  |  |  |   82|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  551|     38|                return false;
  552|    713|            }
  553|  18.7M|        }
  554|       |
  555|  45.5k|        dend = dptr;
  556|  45.5k|        dptr = decbuf;
  557|       |        /* Processing full 4s which will go directly to the buf.
  558|       |           After this left < 3 or decbuf has < 4 bytes */
  559|  45.5k|        if ((size_t)(dend - dptr) / 4 * 3 < left) {
  ------------------
  |  Branch (559:13): [True: 45.4k, False: 94]
  ------------------
  560|  45.4k|            pend = decbuf + (dend - dptr) / 4 * 4;
  561|  45.4k|            left -= (dend - dptr) / 4 * 3;
  562|  45.4k|        } else {
  563|     94|            pend = decbuf + (left / 3) * 4;
  564|     94|            left -= left / 3 * 3;
  565|     94|        }
  566|       |
  567|       |        /* this one would the most performance-consuming part for large chunks */
  568|  4.30M|        while (dptr < pend) {
  ------------------
  |  Branch (568:16): [True: 4.25M, False: 45.5k]
  ------------------
  569|  4.25M|            b24 = *dptr++ << 18;
  570|  4.25M|            b24 |= *dptr++ << 12;
  571|  4.25M|            b24 |= *dptr++ << 6;
  572|  4.25M|            b24 |= *dptr++;
  573|  4.25M|            *bufptr++ = b24 >> 16;
  574|  4.25M|            *bufptr++ = b24 >> 8;
  575|  4.25M|            *bufptr++ = b24 & 0xff;
  576|  4.25M|        }
  577|       |
  578|       |        /* moving rest to the beginning of decbuf */
  579|  45.5k|        memmove(decbuf, dptr, dend - dptr);
  580|  45.5k|        dend = decbuf + (dend - dptr);
  581|       |
  582|       |        /* skip already processed data */
  583|  45.5k|        if (!param->eofb64) {
  ------------------
  |  Branch (583:13): [True: 2.75k, False: 42.8k]
  ------------------
  584|       |            /* all input is base64 data or eol/spaces, so skipping it */
  585|  2.75k|            param->readsrc->skip(read);
  586|       |            /* check for eof for base64-encoded data without headers */
  587|  2.75k|            if (param->noheaders && param->readsrc->eof()) {
  ------------------
  |  Branch (587:17): [True: 0, False: 2.75k]
  |  Branch (587:37): [True: 0, False: 0]
  ------------------
  588|      0|                param->readsrc->skip(read);
  589|      0|                param->eofb64 = true;
  590|  2.75k|            } else {
  591|  2.75k|                continue;
  592|  2.75k|            }
  593|  42.8k|        } else {
  594|       |            /* '=' reached, bptr points on it */
  595|  42.8k|            param->readsrc->skip(bptr - b64buf - 1);
  596|  42.8k|        }
  597|       |
  598|       |        /* end of base64 data */
  599|  42.8k|        if (param->noheaders) {
  ------------------
  |  Branch (599:13): [True: 0, False: 42.8k]
  ------------------
  600|      0|            if (!base64_read_padding(*param->readsrc, &eqcount)) {
  ------------------
  |  Branch (600:17): [True: 0, False: 0]
  ------------------
  601|      0|                return false;
  602|      0|            }
  603|      0|            break;
  604|      0|        }
  605|       |        /* reading b64 padding if any */
  606|  42.8k|        if (!armor_read_padding(*param->readsrc, &eqcount)) {
  ------------------
  |  Branch (606:13): [True: 56, False: 42.7k]
  ------------------
  607|     56|            RNP_LOG("wrong padding");
  ------------------
  |  |   84|     56|#define RNP_LOG(...) RNP_LOG_FD(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   76|     56|    do {                                                                                 \
  |  |  |  |   77|     56|        if (!rnp_log_switch())                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:13): [True: 56, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   78|     56|            break;                                                                       \
  |  |  |  |   79|     56|        (void) fprintf((fd), "[%s() %s:%d] ", __func__, __SOURCE_PATH_FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define __SOURCE_PATH_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        (void) fprintf((fd), __VA_ARGS__);                                               \
  |  |  |  |   81|      0|        (void) fprintf((fd), "\n");                                                      \
  |  |  |  |   82|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  608|     56|            return false;
  609|     56|        }
  610|       |        /* reading crc */
  611|  42.7k|        if (!armor_read_crc(param)) {
  ------------------
  |  Branch (611:13): [True: 17.9k, False: 24.8k]
  ------------------
  612|  17.9k|            RNP_LOG("Warning: missing or malformed CRC line");
  ------------------
  |  |   84|  17.9k|#define RNP_LOG(...) RNP_LOG_FD(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   76|  17.9k|    do {                                                                                 \
  |  |  |  |   77|  17.9k|        if (!rnp_log_switch())                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:13): [True: 17.9k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   78|  17.9k|            break;                                                                       \
  |  |  |  |   79|  17.9k|        (void) fprintf((fd), "[%s() %s:%d] ", __func__, __SOURCE_PATH_FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define __SOURCE_PATH_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        (void) fprintf((fd), __VA_ARGS__);                                               \
  |  |  |  |   81|      0|        (void) fprintf((fd), "\n");                                                      \
  |  |  |  |   82|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  613|  17.9k|        }
  614|       |        /* reading armor trailing line */
  615|  42.7k|        if (!armor_read_trailer(param)) {
  ------------------
  |  Branch (615:13): [True: 204, False: 42.5k]
  ------------------
  616|    204|            RNP_LOG("wrong armor trailer");
  ------------------
  |  |   84|    204|#define RNP_LOG(...) RNP_LOG_FD(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   76|    204|    do {                                                                                 \
  |  |  |  |   77|    204|        if (!rnp_log_switch())                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:13): [True: 204, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   78|    204|            break;                                                                       \
  |  |  |  |   79|    204|        (void) fprintf((fd), "[%s() %s:%d] ", __func__, __SOURCE_PATH_FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define __SOURCE_PATH_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        (void) fprintf((fd), __VA_ARGS__);                                               \
  |  |  |  |   81|      0|        (void) fprintf((fd), "\n");                                                      \
  |  |  |  |   82|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  617|    204|            return false;
  618|    204|        }
  619|  42.5k|        break;
  620|  42.7k|    } while (left >= 3);
  ------------------
  |  Branch (620:14): [True: 2.66k, False: 91]
  ------------------
  621|       |
  622|       |    /* process bytes left in decbuf */
  623|       |
  624|  42.6k|    dptr = decbuf;
  625|  42.6k|    pend = decbuf + (dend - decbuf) / 4 * 4;
  626|  42.6k|    bptr = param->rest;
  627|  60.0k|    while (dptr < pend) {
  ------------------
  |  Branch (627:12): [True: 17.4k, False: 42.6k]
  ------------------
  628|  17.4k|        b24 = *dptr++ << 18;
  629|  17.4k|        b24 |= *dptr++ << 12;
  630|  17.4k|        b24 |= *dptr++ << 6;
  631|  17.4k|        b24 |= *dptr++;
  632|  17.4k|        *bptr++ = b24 >> 16;
  633|  17.4k|        *bptr++ = b24 >> 8;
  634|  17.4k|        *bptr++ = b24 & 0xff;
  635|  17.4k|    }
  636|       |
  637|  42.6k|    if (!armored_update_crc(param, buf, bufptr - (uint8_t *) buf)) {
  ------------------
  |  Branch (637:9): [True: 0, False: 42.6k]
  ------------------
  638|      0|        return false;
  639|      0|    }
  640|       |
  641|  42.6k|    if (param->eofb64) {
  ------------------
  |  Branch (641:9): [True: 42.5k, False: 91]
  ------------------
  642|  42.5k|        if ((dend - dptr + eqcount) % 4 != 0) {
  ------------------
  |  Branch (642:13): [True: 44, False: 42.5k]
  ------------------
  643|     44|            RNP_LOG("wrong b64 padding");
  ------------------
  |  |   84|     44|#define RNP_LOG(...) RNP_LOG_FD(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   76|     44|    do {                                                                                 \
  |  |  |  |   77|     44|        if (!rnp_log_switch())                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:13): [True: 44, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   78|     44|            break;                                                                       \
  |  |  |  |   79|     44|        (void) fprintf((fd), "[%s() %s:%d] ", __func__, __SOURCE_PATH_FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define __SOURCE_PATH_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        (void) fprintf((fd), __VA_ARGS__);                                               \
  |  |  |  |   81|      0|        (void) fprintf((fd), "\n");                                                      \
  |  |  |  |   82|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  644|     44|            return false;
  645|     44|        }
  646|       |
  647|  42.5k|        if (eqcount == 1) {
  ------------------
  |  Branch (647:13): [True: 39.5k, False: 2.99k]
  ------------------
  648|  39.5k|            b24 = (*dptr << 10) | (*(dptr + 1) << 4) | (*(dptr + 2) >> 2);
  649|  39.5k|            *bptr++ = b24 >> 8;
  650|  39.5k|            *bptr++ = b24 & 0xff;
  651|  39.5k|        } else if (eqcount == 2) {
  ------------------
  |  Branch (651:20): [True: 1.46k, False: 1.52k]
  ------------------
  652|  1.46k|            *bptr++ = (*dptr << 2) | (*(dptr + 1) >> 4);
  653|  1.46k|        }
  654|       |
  655|       |        /* Calculate CRC after reading whole input stream */
  656|  42.5k|        if (!armored_update_crc(param, param->rest, bptr - param->rest, true)) {
  ------------------
  |  Branch (656:13): [True: 0, False: 42.5k]
  ------------------
  657|      0|            return false;
  658|      0|        }
  659|  42.5k|    } else {
  660|       |        /* few bytes which do not fit to 4 boundary */
  661|    214|        for (int i = 0; i < dend - dptr; i++) {
  ------------------
  |  Branch (661:25): [True: 123, False: 91]
  ------------------
  662|    123|            param->brest[i] = *(dptr + i);
  663|    123|        }
  664|     91|        param->brestlen = dend - dptr;
  665|     91|    }
  666|       |
  667|  42.6k|    param->restlen = bptr - param->rest;
  668|       |
  669|       |    /* check whether we have some bytes to add */
  670|  42.6k|    if ((left > 0) && (param->restlen > 0)) {
  ------------------
  |  Branch (670:9): [True: 42.6k, False: 1]
  |  Branch (670:23): [True: 41.0k, False: 1.53k]
  ------------------
  671|  41.0k|        read = left > param->restlen ? param->restlen : left;
  ------------------
  |  Branch (671:16): [True: 40.9k, False: 92]
  ------------------
  672|  41.0k|        memcpy(bufptr, param->rest, read);
  673|  41.0k|        if (!param->eofb64 && !armored_update_crc(param, bufptr, read)) {
  ------------------
  |  Branch (673:13): [True: 74, False: 40.9k]
  |  Branch (673:31): [True: 0, False: 74]
  ------------------
  674|      0|            return false;
  675|      0|        }
  676|  41.0k|        left -= read;
  677|  41.0k|        param->restpos += read;
  678|  41.0k|    }
  679|       |
  680|  42.6k|    *readres = len - left;
  681|  42.6k|    return true;
  682|  42.6k|}
stream-armor.cpp:_ZL18armor_read_paddingR12pgp_source_tPm:
  340|  42.8k|{
  341|  42.8k|    char   st[64];
  342|  42.8k|    size_t stlen = 0;
  343|       |
  344|  42.8k|    if (!src.peek_line(st, 64, &stlen)) {
  ------------------
  |  Branch (344:9): [True: 18, False: 42.8k]
  ------------------
  345|     18|        return false;
  346|     18|    }
  347|       |
  348|  42.8k|    if ((stlen == 1) || (stlen == 2)) {
  ------------------
  |  Branch (348:9): [True: 39.6k, False: 3.13k]
  |  Branch (348:25): [True: 1.49k, False: 1.64k]
  ------------------
  349|  41.1k|        if ((st[0] != CH_EQ) || ((stlen == 2) && (st[1] != CH_EQ))) {
  ------------------
  |  |   33|  41.1k|#define CH_EQ ('=')
  ------------------
                      if ((st[0] != CH_EQ) || ((stlen == 2) && (st[1] != CH_EQ))) {
  ------------------
  |  |   33|  1.49k|#define CH_EQ ('=')
  ------------------
  |  Branch (349:13): [True: 3, False: 41.1k]
  |  Branch (349:34): [True: 1.49k, False: 39.6k]
  |  Branch (349:50): [True: 11, False: 1.48k]
  ------------------
  350|     14|            return false;
  351|     14|        }
  352|       |
  353|  41.1k|        *read = stlen;
  354|  41.1k|        src.skip(stlen);
  355|  41.1k|        return src.skip_eol();
  356|  41.1k|    } else if (stlen == 5) {
  ------------------
  |  Branch (356:16): [True: 978, False: 664]
  ------------------
  357|    978|        *read = 0;
  358|    978|        return true;
  359|    978|    } else if ((stlen > 5) && !memcmp(st, ST_DASHES, 5)) {
  ------------------
  |  |   45|    660|#define ST_DASHES ("-----")
  ------------------
  |  Branch (359:16): [True: 660, False: 4]
  |  Branch (359:31): [True: 640, False: 20]
  ------------------
  360|       |        /* case with absent crc and 3-byte last chunk */
  361|    640|        *read = 0;
  362|    640|        return true;
  363|    640|    }
  364|     24|    return false;
  365|  42.8k|}
stream-armor.cpp:_ZL14armor_read_crcP26pgp_source_armored_param_t:
  401|  42.7k|{
  402|  42.7k|    uint8_t dec[4] = {0};
  403|  42.7k|    char    crc[8] = {0};
  404|  42.7k|    size_t  clen = 0;
  405|       |
  406|  42.7k|    if (!param->readsrc->peek_line(crc, sizeof(crc), &clen)) {
  ------------------
  |  Branch (406:9): [True: 16.6k, False: 26.1k]
  ------------------
  407|  16.6k|        return false;
  408|  16.6k|    }
  409|       |
  410|  26.1k|    if ((clen != 5) || (crc[0] != CH_EQ)) {
  ------------------
  |  |   33|  25.1k|#define CH_EQ ('=')
  ------------------
  |  Branch (410:9): [True: 978, False: 25.1k]
  |  Branch (410:24): [True: 311, False: 24.8k]
  ------------------
  411|  1.28k|        return false;
  412|  1.28k|    }
  413|       |
  414|   124k|    for (int i = 0; i < 4; i++) {
  ------------------
  |  Branch (414:21): [True: 99.4k, False: 24.8k]
  ------------------
  415|  99.4k|        if ((dec[i] = B64DEC[(uint8_t) crc[i + 1]]) >= 64) {
  ------------------
  |  Branch (415:13): [True: 16, False: 99.4k]
  ------------------
  416|     16|            return false;
  417|     16|        }
  418|  99.4k|    }
  419|       |
  420|  24.8k|    param->readcrc[0] = (dec[0] << 2) | ((dec[1] >> 4) & 0x0F);
  421|  24.8k|    param->readcrc[1] = (dec[1] << 4) | ((dec[2] >> 2) & 0x0F);
  422|  24.8k|    param->readcrc[2] = (dec[2] << 6) | dec[3];
  423|       |
  424|  24.8k|    param->has_crc = true;
  425|       |
  426|  24.8k|    param->readsrc->skip(5);
  427|  24.8k|    return param->readsrc->skip_eol();
  428|  24.8k|}
stream-armor.cpp:_ZL18armor_read_trailerP26pgp_source_armored_param_t:
  432|  42.7k|{
  433|       |    /* Space or tab could get between armor and trailer, see issue #2199 */
  434|  42.7k|    if (!param->readsrc->skip_chars("\r\n \t")) {
  ------------------
  |  Branch (434:9): [True: 0, False: 42.7k]
  ------------------
  435|      0|        return false;
  436|      0|    }
  437|       |
  438|  42.7k|    std::string st = ST_ARMOR_END + param->armorhdr + ST_DASHES;
  ------------------
  |  |   47|   128k|#define ST_ARMOR_END ("-----END PGP ")
  ------------------
                  std::string st = ST_ARMOR_END + param->armorhdr + ST_DASHES;
  ------------------
  |  |   45|  42.7k|#define ST_DASHES ("-----")
  ------------------
  439|  42.7k|    std::string str(st.size(), 0);
  440|  42.7k|    if (!param->readsrc->peek_eq(&str.front(), str.size()) || (st != str)) {
  ------------------
  |  Branch (440:9): [True: 157, False: 42.6k]
  |  Branch (440:63): [True: 47, False: 42.5k]
  ------------------
  441|    204|        return false;
  442|    204|    }
  443|  42.5k|    param->readsrc->skip(st.size());
  444|  42.5k|    (void) param->readsrc->skip_chars("\t ");
  445|  42.5k|    (void) param->readsrc->skip_eol();
  446|  42.5k|    return true;
  447|  42.7k|}
stream-armor.cpp:_ZL18armored_update_crcP26pgp_source_armored_param_tPKvmb:
  454|  85.2k|{
  455|  85.2k|    if (param->noheaders) {
  ------------------
  |  Branch (455:9): [True: 0, False: 85.2k]
  ------------------
  456|      0|        return true;
  457|      0|    }
  458|  85.2k|    try {
  459|  85.2k|        param->crc_ctx->add(buf, len);
  460|  85.2k|        if (!finish) {
  ------------------
  |  Branch (460:13): [True: 42.7k, False: 42.5k]
  ------------------
  461|  42.7k|            return true;
  462|  42.7k|        }
  463|  42.5k|        auto crc = param->crc_ctx->finish();
  464|  42.5k|        if (param->has_crc && memcmp(param->readcrc, crc.data(), 3)) {
  ------------------
  |  Branch (464:13): [True: 24.8k, False: 17.6k]
  |  Branch (464:31): [True: 3.49k, False: 21.3k]
  ------------------
  465|  3.49k|            RNP_LOG("Warning: CRC mismatch");
  ------------------
  |  |   84|  3.49k|#define RNP_LOG(...) RNP_LOG_FD(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   76|  3.49k|    do {                                                                                 \
  |  |  |  |   77|  3.49k|        if (!rnp_log_switch())                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:13): [True: 3.49k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   78|  3.49k|            break;                                                                       \
  |  |  |  |   79|  3.49k|        (void) fprintf((fd), "[%s() %s:%d] ", __func__, __SOURCE_PATH_FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define __SOURCE_PATH_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        (void) fprintf((fd), __VA_ARGS__);                                               \
  |  |  |  |   81|      0|        (void) fprintf((fd), "\n");                                                      \
  |  |  |  |   82|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  466|  3.49k|        }
  467|  42.5k|        return true;
  468|  85.2k|    } catch (const std::exception &e) {
  469|      0|        RNP_LOG("%s", e.what());
  ------------------
  |  |   84|      0|#define RNP_LOG(...) RNP_LOG_FD(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   76|      0|    do {                                                                                 \
  |  |  |  |   77|      0|        if (!rnp_log_switch())                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   78|      0|            break;                                                                       \
  |  |  |  |   79|      0|        (void) fprintf((fd), "[%s() %s:%d] ", __func__, __SOURCE_PATH_FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define __SOURCE_PATH_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        (void) fprintf((fd), __VA_ARGS__);                                               \
  |  |  |  |   81|      0|        (void) fprintf((fd), "\n");                                                      \
  |  |  |  |   82|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  470|      0|        return false;
  471|      0|    }
  472|  85.2k|}
stream-armor.cpp:_ZL17armored_src_closeP12pgp_source_t:
  686|  44.8k|{
  687|  44.8k|    auto param = (pgp_source_armored_param_t *) src->param;
  688|  44.8k|    delete param;
  689|       |    src->param = NULL;
  690|  44.8k|}
stream-armor.cpp:_ZL18armor_parse_headerP26pgp_source_armored_param_t:
  841|  43.9k|{
  842|  43.9k|    size_t      skip = 0;
  843|  43.9k|    std::string hdr = peek_armor_header(*param->readsrc, &skip, true);
  844|  43.9k|    if (hdr.empty()) {
  ------------------
  |  Branch (844:9): [True: 191, False: 43.7k]
  ------------------
  845|    191|        RNP_LOG("no armor header");
  ------------------
  |  |   84|    191|#define RNP_LOG(...) RNP_LOG_FD(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   76|    191|    do {                                                                                 \
  |  |  |  |   77|    191|        if (!rnp_log_switch())                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:13): [True: 191, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   78|    191|            break;                                                                       \
  |  |  |  |   79|    191|        (void) fprintf((fd), "[%s() %s:%d] ", __func__, __SOURCE_PATH_FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define __SOURCE_PATH_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        (void) fprintf((fd), __VA_ARGS__);                                               \
  |  |  |  |   81|      0|        (void) fprintf((fd), "\n");                                                      \
  |  |  |  |   82|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  846|    191|        return false;
  847|    191|    }
  848|       |
  849|  43.7k|    param->type = armor_str_to_data_type(hdr);
  850|  43.7k|    if (param->type == PGP_ARMORED_UNKNOWN) {
  ------------------
  |  Branch (850:9): [True: 251, False: 43.4k]
  ------------------
  851|    251|        RNP_LOG("unknown armor header");
  ------------------
  |  |   84|    251|#define RNP_LOG(...) RNP_LOG_FD(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   76|    251|    do {                                                                                 \
  |  |  |  |   77|    251|        if (!rnp_log_switch())                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:13): [True: 251, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   78|    251|            break;                                                                       \
  |  |  |  |   79|    251|        (void) fprintf((fd), "[%s() %s:%d] ", __func__, __SOURCE_PATH_FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define __SOURCE_PATH_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        (void) fprintf((fd), __VA_ARGS__);                                               \
  |  |  |  |   81|      0|        (void) fprintf((fd), "\n");                                                      \
  |  |  |  |   82|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  852|    251|        return false;
  853|    251|    }
  854|       |
  855|  43.4k|    param->armorhdr = std::move(hdr);
  856|  43.4k|    param->readsrc->skip(skip);
  857|  43.4k|    param->readsrc->skip_chars("\t ");
  858|  43.4k|    return true;
  859|  43.7k|}
stream-armor.cpp:_ZL19armor_parse_headersP26pgp_source_armored_param_t:
  896|  43.3k|{
  897|  43.3k|    std::vector<char> header(ARMORED_PEEK_BUF_SIZE, '\0');
  ------------------
  |  |   46|  43.3k|#define ARMORED_PEEK_BUF_SIZE 1024
  ------------------
  898|       |
  899|   120k|    do {
  900|   120k|        size_t hdrlen = 0;
  901|   120k|        if (!param->readsrc->peek_line(header.data(), header.size(), &hdrlen)) {
  ------------------
  |  Branch (901:13): [True: 2.07k, False: 117k]
  ------------------
  902|       |            /* if line is too long let's cut it to the reasonable size */
  903|  2.07k|            param->readsrc->skip(hdrlen);
  904|  2.07k|            if ((hdrlen != header.size() - 1) || !armor_skip_line(*param->readsrc)) {
  ------------------
  |  Branch (904:17): [True: 354, False: 1.72k]
  |  Branch (904:50): [True: 38, False: 1.68k]
  ------------------
  905|    392|                RNP_LOG("failed to peek line: unexpected end of data");
  ------------------
  |  |   84|    392|#define RNP_LOG(...) RNP_LOG_FD(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   76|    392|    do {                                                                                 \
  |  |  |  |   77|    392|        if (!rnp_log_switch())                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:13): [True: 392, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   78|    392|            break;                                                                       \
  |  |  |  |   79|    392|        (void) fprintf((fd), "[%s() %s:%d] ", __func__, __SOURCE_PATH_FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define __SOURCE_PATH_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        (void) fprintf((fd), __VA_ARGS__);                                               \
  |  |  |  |   81|      0|        (void) fprintf((fd), "\n");                                                      \
  |  |  |  |   82|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  906|    392|                return false;
  907|    392|            }
  908|  1.68k|            RNP_LOG("Too long armor header - truncated.");
  ------------------
  |  |   84|  1.68k|#define RNP_LOG(...) RNP_LOG_FD(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   76|  1.68k|    do {                                                                                 \
  |  |  |  |   77|  1.68k|        if (!rnp_log_switch())                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:13): [True: 1.68k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   78|  1.68k|            break;                                                                       \
  |  |  |  |   79|  1.68k|        (void) fprintf((fd), "[%s() %s:%d] ", __func__, __SOURCE_PATH_FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define __SOURCE_PATH_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        (void) fprintf((fd), __VA_ARGS__);                                               \
  |  |  |  |   81|      0|        (void) fprintf((fd), "\n");                                                      \
  |  |  |  |   82|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  909|   117k|        } else if (hdrlen) {
  ------------------
  |  Branch (909:20): [True: 107k, False: 10.3k]
  ------------------
  910|   107k|            if (is_base64_line(header.data(), hdrlen)) {
  ------------------
  |  Branch (910:17): [True: 32.6k, False: 74.9k]
  ------------------
  911|  32.6k|                RNP_LOG("Warning: no empty line after the base64 headers");
  ------------------
  |  |   84|  32.6k|#define RNP_LOG(...) RNP_LOG_FD(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   76|  32.6k|    do {                                                                                 \
  |  |  |  |   77|  32.6k|        if (!rnp_log_switch())                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:13): [True: 32.6k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   78|  32.6k|            break;                                                                       \
  |  |  |  |   79|  32.6k|        (void) fprintf((fd), "[%s() %s:%d] ", __func__, __SOURCE_PATH_FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define __SOURCE_PATH_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        (void) fprintf((fd), __VA_ARGS__);                                               \
  |  |  |  |   81|      0|        (void) fprintf((fd), "\n");                                                      \
  |  |  |  |   82|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  912|  32.6k|                return true;
  913|  32.6k|            }
  914|  74.9k|            param->readsrc->skip(hdrlen);
  915|  74.9k|            if (rnp::is_blank_line(header.data(), hdrlen)) {
  ------------------
  |  Branch (915:17): [True: 0, False: 74.9k]
  ------------------
  916|      0|                return param->readsrc->skip_eol();
  917|      0|            }
  918|  74.9k|        } else {
  919|       |            /* empty line - end of the headers */
  920|  10.3k|            return param->readsrc->skip_eol();
  921|  10.3k|        }
  922|       |
  923|  76.6k|        std::string hdrst(header.begin(), header.begin() + hdrlen);
  924|  76.6k|        size_t      pos = hdrst.find(": ");
  925|  76.6k|        if ((pos != std::string::npos) && armor_header_known(hdrst.substr(0, pos + 2))) {
  ------------------
  |  Branch (925:13): [True: 12.7k, False: 63.8k]
  |  Branch (925:13): [True: 2.89k, False: 73.7k]
  |  Branch (925:43): [True: 2.89k, False: 9.86k]
  ------------------
  926|       |            // do nothing at the moment, just check whether header is known
  927|  73.7k|        } else {
  928|  73.7k|            RNP_LOG("unknown header '%s'", hdrst.c_str());
  ------------------
  |  |   84|  73.7k|#define RNP_LOG(...) RNP_LOG_FD(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   76|  73.7k|    do {                                                                                 \
  |  |  |  |   77|  73.7k|        if (!rnp_log_switch())                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:13): [True: 73.7k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   78|  73.7k|            break;                                                                       \
  |  |  |  |   79|  73.7k|        (void) fprintf((fd), "[%s() %s:%d] ", __func__, __SOURCE_PATH_FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define __SOURCE_PATH_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        (void) fprintf((fd), __VA_ARGS__);                                               \
  |  |  |  |   81|      0|        (void) fprintf((fd), "\n");                                                      \
  |  |  |  |   82|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  929|  73.7k|        }
  930|       |
  931|  76.6k|        if (!param->readsrc->skip_eol()) {
  ------------------
  |  Branch (931:13): [True: 0, False: 76.6k]
  ------------------
  932|      0|            return false;
  933|      0|        }
  934|  76.6k|    } while (1);
  ------------------
  |  Branch (934:14): [True: 76.6k, Folded]
  ------------------
  935|  43.3k|}
stream-armor.cpp:_ZL15armor_skip_lineR12pgp_source_t:
  863|  1.72k|{
  864|  1.72k|    char header[ARMORED_PEEK_BUF_SIZE] = {0};
  865|  3.79k|    do {
  866|  3.79k|        size_t hdrlen = 0;
  867|  3.79k|        bool   res = src.peek_line(header, sizeof(header), &hdrlen);
  868|  3.79k|        if (hdrlen) {
  ------------------
  |  Branch (868:13): [True: 3.04k, False: 752]
  ------------------
  869|  3.04k|            src.skip(hdrlen);
  870|  3.04k|        }
  871|  3.79k|        if (res || (hdrlen < sizeof(header) - 1)) {
  ------------------
  |  Branch (871:13): [True: 1.68k, False: 2.11k]
  |  Branch (871:20): [True: 38, False: 2.07k]
  ------------------
  872|  1.72k|            return res;
  873|  1.72k|        }
  874|  3.79k|    } while (1);
  ------------------
  |  Branch (874:14): [True: 2.07k, Folded]
  ------------------
  875|  1.72k|}
stream-armor.cpp:_ZL18armor_header_knownRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE:
  889|  12.7k|{
  890|  12.7k|    return (name == ST_HEADER_VERSION) || (name == ST_HEADER_COMMENT) ||
  ------------------
  |  |   50|  12.7k|#define ST_HEADER_VERSION ("Version: ")
  ------------------
                  return (name == ST_HEADER_VERSION) || (name == ST_HEADER_COMMENT) ||
  ------------------
  |  |   51|  12.1k|#define ST_HEADER_COMMENT ("Comment: ")
  ------------------
  |  Branch (890:12): [True: 596, False: 12.1k]
  |  Branch (890:43): [True: 895, False: 11.2k]
  ------------------
  891|  11.2k|           (name == ST_HEADER_CHARSET) || (name == ST_HEADER_HASH);
  ------------------
  |  |   53|  11.2k|#define ST_HEADER_CHARSET ("Charset: ")
  ------------------
                         (name == ST_HEADER_CHARSET) || (name == ST_HEADER_HASH);
  ------------------
  |  |   52|  10.2k|#define ST_HEADER_HASH ("Hash: ")
  ------------------
  |  Branch (891:12): [True: 972, False: 10.2k]
  |  Branch (891:43): [True: 435, False: 9.86k]
  ------------------
  892|  12.7k|}
stream-armor.cpp:_ZL14is_base64_linePKcm:
  879|   107k|{
  880|  6.10M|    for (size_t i = 0; i < len && line[i]; i++) {
  ------------------
  |  Branch (880:24): [True: 6.06M, False: 32.6k]
  |  Branch (880:35): [True: 6.06M, False: 24]
  ------------------
  881|  6.06M|        if (B64DEC[(uint8_t) line[i]] == 0xff)
  ------------------
  |  Branch (881:13): [True: 74.9k, False: 5.99M]
  ------------------
  882|  74.9k|            return false;
  883|  6.06M|    }
  884|  32.6k|    return true;
  885|   107k|}

_ZN3rnp13ArmoredSource8multipleEv:
  123|  42.6k|    {
  124|  42.6k|        return multiple_;
  125|  42.6k|    }

_ZN12pgp_source_t4readEPvmPm:
   57|  1.18M|{
   58|  1.18M|    size_t left = len;
   59|  1.18M|    size_t read;
   60|  1.18M|    bool   readahead = cache ? cache->readahead : false;
  ------------------
  |  Branch (60:24): [True: 1.18M, False: 0]
  ------------------
   61|       |
   62|  1.18M|    if (error_) {
  ------------------
  |  Branch (62:9): [True: 0, False: 1.18M]
  ------------------
   63|      0|        return false;
   64|      0|    }
   65|       |
   66|  1.18M|    if (eof_ || (len == 0)) {
  ------------------
  |  Branch (66:9): [True: 328, False: 1.18M]
  |  Branch (66:17): [True: 0, False: 1.18M]
  ------------------
   67|    328|        *readres = 0;
   68|    328|        return true;
   69|    328|    }
   70|       |
   71|       |    // Do not read more then available if source size is known
   72|  1.18M|    if (knownsize && (readb + len > size)) {
  ------------------
  |  Branch (72:9): [True: 1.09M, False: 86.6k]
  |  Branch (72:22): [True: 154, False: 1.09M]
  ------------------
   73|    154|        len = size - readb;
   74|    154|        left = len;
   75|    154|        readahead = false;
   76|    154|    }
   77|       |
   78|       |    // Check whether we have cache and there is data inside
   79|  1.18M|    if (cache && (cache->len > cache->pos)) {
  ------------------
  |  Branch (79:9): [True: 1.18M, False: 0]
  |  Branch (79:18): [True: 1.18M, False: 60]
  ------------------
   80|  1.18M|        read = cache->len - cache->pos;
   81|  1.18M|        if (read >= len) {
  ------------------
  |  Branch (81:13): [True: 1.18M, False: 514]
  ------------------
   82|  1.18M|            memcpy(buf, &cache->buf[cache->pos], len);
   83|  1.18M|            cache->pos += len;
   84|  1.18M|            goto finish;
   85|  1.18M|        } else {
   86|    514|            memcpy(buf, &cache->buf[cache->pos], read);
   87|    514|            cache->pos += read;
   88|    514|            buf = (uint8_t *) buf + read;
   89|    514|            left = len - read;
   90|    514|        }
   91|  1.18M|    }
   92|       |
   93|       |    // If we got here then we have empty cache or no cache at all
   94|    668|    while (left > 0) {
  ------------------
  |  Branch (94:12): [True: 620, False: 48]
  ------------------
   95|    620|        if (left > sizeof(cache->buf) || !readahead || !cache) {
  ------------------
  |  Branch (95:13): [True: 201, False: 419]
  |  Branch (95:42): [True: 15, False: 404]
  |  Branch (95:56): [True: 0, False: 404]
  ------------------
   96|       |            // If there is no cache or chunk is larger then read directly
   97|    216|            if (!raw_read(this, buf, left, &read)) {
  ------------------
  |  Branch (97:17): [True: 40, False: 176]
  ------------------
   98|     40|                error_ = 1;
   99|     40|                return false;
  100|     40|            }
  101|    176|            if (!read) {
  ------------------
  |  Branch (101:17): [True: 86, False: 90]
  ------------------
  102|     86|                eof_ = true;
  103|     86|                len = len - left;
  104|     86|                goto finish;
  105|     86|            }
  106|     90|            left -= read;
  107|     90|            buf = (uint8_t *) buf + read;
  108|    404|        } else {
  109|       |            // Try to fill the cache to avoid small reads
  110|    404|            if (!raw_read(this, &cache->buf[0], sizeof(cache->buf), &read)) {
  ------------------
  |  Branch (110:17): [True: 5, False: 399]
  ------------------
  111|      5|                error_ = true;
  112|      5|                return false;
  113|      5|            }
  114|    399|            if (!read) {
  ------------------
  |  Branch (114:17): [True: 69, False: 330]
  ------------------
  115|     69|                eof_ = true;
  116|     69|                len = len - left;
  117|     69|                goto finish;
  118|    330|            } else if (read < left) {
  ------------------
  |  Branch (118:24): [True: 4, False: 326]
  ------------------
  119|      4|                memcpy(buf, &cache->buf[0], read);
  120|      4|                left -= read;
  121|      4|                buf = (uint8_t *) buf + read;
  122|    326|            } else {
  123|    326|                memcpy(buf, &cache->buf[0], left);
  124|    326|                cache->pos = left;
  125|    326|                cache->len = read;
  126|    326|                goto finish;
  127|    326|            }
  128|    399|        }
  129|    620|    }
  130|       |
  131|  1.18M|finish:
  132|  1.18M|    readb += len;
  133|  1.18M|    if (knownsize && (readb == size)) {
  ------------------
  |  Branch (133:9): [True: 1.09M, False: 86.5k]
  |  Branch (133:22): [True: 2.48k, False: 1.09M]
  ------------------
  134|  2.48k|        eof_ = true;
  135|  2.48k|    }
  136|  1.18M|    *readres = len;
  137|  1.18M|    return true;
  138|    574|}
_ZN12pgp_source_t7read_eqEPvm:
  142|   590k|{
  143|   590k|    size_t res = 0;
  144|   590k|    return read(buf, len, &res) && (res == len);
  ------------------
  |  Branch (144:12): [True: 590k, False: 0]
  |  Branch (144:36): [True: 590k, False: 0]
  ------------------
  145|   590k|}
_ZN12pgp_source_t4peekEPvmPm:
  149|  6.28M|{
  150|  6.28M|    if (error_) {
  ------------------
  |  Branch (150:9): [True: 1.08k, False: 6.28M]
  ------------------
  151|  1.08k|        return false;
  152|  1.08k|    }
  153|  6.28M|    if (!cache || (len > sizeof(cache->buf))) {
  ------------------
  |  Branch (153:9): [True: 0, False: 6.28M]
  |  Branch (153:19): [True: 0, False: 6.28M]
  ------------------
  154|      0|        return false;
  155|      0|    }
  156|  6.28M|    if (eof_) {
  ------------------
  |  Branch (156:9): [True: 0, False: 6.28M]
  ------------------
  157|      0|        *peeked = 0;
  158|      0|        return true;
  159|      0|    }
  160|       |
  161|  6.28M|    size_t read = 0;
  162|  6.28M|    bool   readahead = cache->readahead;
  163|       |    // Do not read more then available if source size is known
  164|  6.28M|    if (knownsize && (readb + len > size)) {
  ------------------
  |  Branch (164:9): [True: 5.89M, False: 390k]
  |  Branch (164:22): [True: 13.7k, False: 5.88M]
  ------------------
  165|  13.7k|        len = size - readb;
  166|  13.7k|        readahead = false;
  167|  13.7k|    }
  168|       |
  169|  6.28M|    if (cache->len - cache->pos >= len) {
  ------------------
  |  Branch (169:9): [True: 6.19M, False: 90.4k]
  ------------------
  170|  6.19M|        if (buf) {
  ------------------
  |  Branch (170:13): [True: 6.19M, False: 0]
  ------------------
  171|  6.19M|            memcpy(buf, &cache->buf[cache->pos], len);
  172|  6.19M|        }
  173|  6.19M|        *peeked = len;
  174|  6.19M|        return true;
  175|  6.19M|    }
  176|       |
  177|  90.4k|    if (cache->pos > 0) {
  ------------------
  |  Branch (177:9): [True: 42.9k, False: 47.4k]
  ------------------
  178|  42.9k|        memmove(&cache->buf[0], &cache->buf[cache->pos], cache->len - cache->pos);
  179|  42.9k|        cache->len -= cache->pos;
  180|  42.9k|        cache->pos = 0;
  181|  42.9k|    }
  182|       |
  183|  90.4k|    while (cache->len < len) {
  ------------------
  |  Branch (183:12): [True: 90.4k, False: 0]
  ------------------
  184|  90.4k|        read = readahead ? sizeof(cache->buf) - cache->len : len - cache->len;
  ------------------
  |  Branch (184:16): [True: 87.1k, False: 3.33k]
  ------------------
  185|  90.4k|        if (knownsize && (readb + read > size)) {
  ------------------
  |  Branch (185:13): [True: 5.44k, False: 85.0k]
  |  Branch (185:26): [True: 909, False: 4.53k]
  ------------------
  186|    909|            read = size - readb;
  187|    909|        }
  188|  90.4k|        if (!raw_read(this, &cache->buf[cache->len], read, &read)) {
  ------------------
  |  Branch (188:13): [True: 426, False: 90.0k]
  ------------------
  189|    426|            error_ = true;
  190|    426|            return false;
  191|    426|        }
  192|  90.0k|        if (!read) {
  ------------------
  |  Branch (192:13): [True: 42.3k, False: 47.6k]
  ------------------
  193|  42.3k|            if (buf) {
  ------------------
  |  Branch (193:17): [True: 42.3k, False: 0]
  ------------------
  194|  42.3k|                memcpy(buf, &cache->buf[0], cache->len);
  195|  42.3k|            }
  196|  42.3k|            *peeked = cache->len;
  197|  42.3k|            return true;
  198|  42.3k|        }
  199|  47.6k|        cache->len += read;
  200|  47.6k|        if (cache->len >= len) {
  ------------------
  |  Branch (200:13): [True: 47.6k, False: 0]
  ------------------
  201|  47.6k|            if (buf) {
  ------------------
  |  Branch (201:17): [True: 47.6k, False: 0]
  ------------------
  202|  47.6k|                memcpy(buf, cache->buf, len);
  203|  47.6k|            }
  204|  47.6k|            *peeked = len;
  205|  47.6k|            return true;
  206|  47.6k|        }
  207|  47.6k|    }
  208|      0|    return false;
  209|  90.4k|}
_ZN12pgp_source_t7peek_eqEPvm:
  213|  3.58M|{
  214|  3.58M|    size_t res = 0;
  215|  3.58M|    return peek(buf, len, &res) && (res == len);
  ------------------
  |  Branch (215:12): [True: 3.58M, False: 426]
  |  Branch (215:36): [True: 3.58M, False: 198]
  ------------------
  216|  3.58M|}
_ZN12pgp_source_t4skipEm:
  220|   592k|{
  221|   592k|    if (cache && (cache->len - cache->pos >= len)) {
  ------------------
  |  Branch (221:9): [True: 592k, False: 0]
  |  Branch (221:18): [True: 592k, False: 0]
  ------------------
  222|   592k|        readb += len;
  223|   592k|        cache->pos += len;
  224|   592k|        return;
  225|   592k|    }
  226|       |
  227|      0|    size_t  res = 0;
  228|      0|    uint8_t sbuf[16];
  229|      0|    if (len < sizeof(sbuf)) {
  ------------------
  |  Branch (229:9): [True: 0, False: 0]
  ------------------
  230|      0|        (void) read(sbuf, len, &res);
  231|      0|        return;
  232|      0|    }
  233|      0|    if (eof()) {
  ------------------
  |  Branch (233:9): [True: 0, False: 0]
  ------------------
  234|      0|        return;
  235|      0|    }
  236|       |
  237|      0|    void *buf = calloc(1, std::min((size_t) PGP_INPUT_CACHE_SIZE, len));
  ------------------
  |  |   35|      0|#define PGP_INPUT_CACHE_SIZE 32768
  ------------------
  238|      0|    if (!buf) {
  ------------------
  |  Branch (238:9): [True: 0, False: 0]
  ------------------
  239|      0|        error_ = true;
  240|      0|        return;
  241|      0|    }
  242|       |
  243|      0|    while (len && !eof()) {
  ------------------
  |  Branch (243:12): [True: 0, False: 0]
  |  Branch (243:19): [True: 0, False: 0]
  ------------------
  244|      0|        if (!read(buf, std::min((size_t) PGP_INPUT_CACHE_SIZE, len), &res)) {
  ------------------
  |  |   35|      0|#define PGP_INPUT_CACHE_SIZE 32768
  ------------------
  |  Branch (244:13): [True: 0, False: 0]
  ------------------
  245|      0|            break;
  246|      0|        }
  247|      0|        len -= res;
  248|      0|    }
  249|      0|    free(buf);
  250|      0|}
_ZNK12pgp_source_t5errorEv:
  263|   634k|{
  264|   634k|    return error_;
  265|   634k|}
_ZN12pgp_source_t3eofEv:
  269|  1.81M|{
  270|  1.81M|    if (eof_) {
  ------------------
  |  Branch (270:9): [True: 672, False: 1.81M]
  ------------------
  271|    672|        return true;
  272|    672|    }
  273|       |    /* Error on stream read is NOT considered as eof. See error(). */
  274|  1.81M|    uint8_t check;
  275|  1.81M|    size_t  read = 0;
  276|  1.81M|    return peek(&check, 1, &read) && (read == 0);
  ------------------
  |  Branch (276:12): [True: 1.81M, False: 1.08k]
  |  Branch (276:38): [True: 42.4k, False: 1.77M]
  ------------------
  277|  1.81M|}
_ZN12pgp_source_t5closeEv:
  281|  52.0k|{
  282|  52.0k|    if (raw_close) {
  ------------------
  |  Branch (282:9): [True: 49.2k, False: 2.76k]
  ------------------
  283|  49.2k|        raw_close(this);
  284|  49.2k|    }
  285|       |
  286|  52.0k|    if (cache) {
  ------------------
  |  Branch (286:9): [True: 48.3k, False: 3.68k]
  ------------------
  287|  48.3k|        free(cache);
  288|       |        cache = NULL;
  289|  48.3k|    }
  290|  52.0k|}
_ZN12pgp_source_t8skip_eolEv:
  294|   239k|{
  295|   239k|    uint8_t eol[2];
  296|   239k|    size_t  read;
  297|       |
  298|   239k|    if (!peek(eol, 2, &read) || !read) {
  ------------------
  |  Branch (298:9): [True: 0, False: 239k]
  |  Branch (298:33): [True: 166, False: 238k]
  ------------------
  299|    166|        return false;
  300|    166|    }
  301|   238k|    if (eol[0] == '\n') {
  ------------------
  |  Branch (301:9): [True: 185k, False: 53.2k]
  ------------------
  302|   185k|        skip(1);
  303|   185k|        return true;
  304|   185k|    }
  305|  53.2k|    if ((read == 2) && (eol[0] == '\r') && (eol[1] == '\n')) {
  ------------------
  |  Branch (305:9): [True: 53.2k, False: 35]
  |  Branch (305:24): [True: 13.9k, False: 39.3k]
  |  Branch (305:44): [True: 12.2k, False: 1.70k]
  ------------------
  306|  12.2k|        skip(2);
  307|  12.2k|        return true;
  308|  12.2k|    }
  309|  41.0k|    return false;
  310|  53.2k|}
_ZN12pgp_source_t10skip_charsERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
  314|   128k|{
  315|   245k|    do {
  316|   245k|        char   ch = 0;
  317|   245k|        size_t read = 0;
  318|   245k|        if (!peek(&ch, 1, &read)) {
  ------------------
  |  Branch (318:13): [True: 0, False: 245k]
  ------------------
  319|      0|            return false;
  320|      0|        }
  321|   245k|        if (!read) {
  ------------------
  |  Branch (321:13): [True: 254, False: 245k]
  ------------------
  322|       |            /* return true only if there is no underlying read error */
  323|    254|            return true;
  324|    254|        }
  325|   245k|        if (chars.find(ch) == std::string::npos) {
  ------------------
  |  Branch (325:13): [True: 128k, False: 116k]
  ------------------
  326|   128k|            return true;
  327|   128k|        }
  328|   116k|        skip(1);
  329|   116k|    } while (1);
  ------------------
  |  Branch (329:14): [True: 116k, Folded]
  ------------------
  330|   128k|}
_ZN12pgp_source_t9peek_lineEPcmPm:
  334|   209k|{
  335|   209k|    size_t scan_pos = 0;
  336|   209k|    size_t inc = 64;
  337|   209k|    len = len - 1;
  338|       |
  339|   303k|    do {
  340|   303k|        size_t to_peek = scan_pos + inc;
  341|   303k|        to_peek = to_peek > len ? len : to_peek;
  ------------------
  |  Branch (341:19): [True: 89.5k, False: 214k]
  ------------------
  342|   303k|        inc = inc * 2;
  343|       |
  344|       |        /* inefficient, each time we again read from the beginning */
  345|   303k|        if (!peek(buf, to_peek, readres)) {
  ------------------
  |  Branch (345:13): [True: 0, False: 303k]
  ------------------
  346|      0|            return false;
  347|      0|        }
  348|       |
  349|       |        /* we continue scanning where we stopped previously */
  350|  18.9M|        for (; scan_pos < *readres; scan_pos++) {
  ------------------
  |  Branch (350:16): [True: 18.8M, False: 115k]
  ------------------
  351|  18.8M|            if (buf[scan_pos] == '\n') {
  ------------------
  |  Branch (351:17): [True: 188k, False: 18.6M]
  ------------------
  352|   188k|                if ((scan_pos > 0) && (buf[scan_pos - 1] == '\r')) {
  ------------------
  |  Branch (352:21): [True: 177k, False: 11.3k]
  |  Branch (352:39): [True: 9.01k, False: 168k]
  ------------------
  353|  9.01k|                    scan_pos--;
  354|  9.01k|                }
  355|   188k|                buf[scan_pos] = '\0';
  356|   188k|                *readres = scan_pos;
  357|   188k|                return true;
  358|   188k|            }
  359|  18.8M|        }
  360|   115k|        if (*readres < to_peek) {
  ------------------
  |  Branch (360:13): [True: 463, False: 114k]
  ------------------
  361|    463|            return false;
  362|    463|        }
  363|   115k|    } while (scan_pos < len);
  ------------------
  |  Branch (363:14): [True: 94.5k, False: 20.3k]
  ------------------
  364|  20.3k|    return false;
  365|   209k|}
_Z15init_src_commonP12pgp_source_tm:
  369|  48.3k|{
  370|  48.3k|    memset(src, 0, sizeof(*src));
  371|  48.3k|    src->cache = (pgp_source_cache_t *) calloc(1, sizeof(*src->cache));
  372|  48.3k|    if (!src->cache) {
  ------------------
  |  Branch (372:9): [True: 0, False: 48.3k]
  ------------------
  373|      0|        RNP_LOG("cache allocation failed");
  ------------------
  |  |   84|      0|#define RNP_LOG(...) RNP_LOG_FD(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   76|      0|    do {                                                                                 \
  |  |  |  |   77|      0|        if (!rnp_log_switch())                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   78|      0|            break;                                                                       \
  |  |  |  |   79|      0|        (void) fprintf((fd), "[%s() %s:%d] ", __func__, __SOURCE_PATH_FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define __SOURCE_PATH_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        (void) fprintf((fd), __VA_ARGS__);                                               \
  |  |  |  |   81|      0|        (void) fprintf((fd), "\n");                                                      \
  |  |  |  |   82|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  374|      0|        return false;
  375|      0|    }
  376|  48.3k|    src->cache->readahead = true;
  377|  48.3k|    if (!paramsize) {
  ------------------
  |  Branch (377:9): [True: 43.9k, False: 4.44k]
  ------------------
  378|  43.9k|        return true;
  379|  43.9k|    }
  380|  4.44k|    src->param = calloc(1, paramsize);
  381|  4.44k|    if (!src->param) {
  ------------------
  |  Branch (381:9): [True: 0, False: 4.44k]
  ------------------
  382|      0|        RNP_LOG("param allocation failed");
  ------------------
  |  |   84|      0|#define RNP_LOG(...) RNP_LOG_FD(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   76|      0|    do {                                                                                 \
  |  |  |  |   77|      0|        if (!rnp_log_switch())                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   78|      0|            break;                                                                       \
  |  |  |  |   79|      0|        (void) fprintf((fd), "[%s() %s:%d] ", __func__, __SOURCE_PATH_FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define __SOURCE_PATH_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        (void) fprintf((fd), __VA_ARGS__);                                               \
  |  |  |  |   81|      0|        (void) fprintf((fd), "\n");                                                      \
  |  |  |  |   82|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  383|      0|        free(src->cache);
  384|      0|        src->cache = NULL;
  385|      0|        return false;
  386|      0|    }
  387|  4.44k|    return true;
  388|  4.44k|}
_Z12init_mem_srcP12pgp_source_tPKvmb:
  546|  4.44k|{
  547|  4.44k|    if (!mem && len) {
  ------------------
  |  Branch (547:9): [True: 0, False: 4.44k]
  |  Branch (547:17): [True: 0, False: 0]
  ------------------
  548|      0|        return RNP_ERROR_NULL_POINTER;
  549|      0|    }
  550|       |    /* this is actually double buffering, but then src_peek will fail */
  551|  4.44k|    if (!init_src_common(src, sizeof(pgp_source_mem_param_t))) {
  ------------------
  |  Branch (551:9): [True: 0, False: 4.44k]
  ------------------
  552|      0|        return RNP_ERROR_OUT_OF_MEMORY;
  553|      0|    }
  554|       |
  555|  4.44k|    pgp_source_mem_param_t *param = (pgp_source_mem_param_t *) src->param;
  556|  4.44k|    param->memory = mem;
  557|  4.44k|    param->len = len;
  558|  4.44k|    param->pos = 0;
  559|  4.44k|    param->free = free;
  560|  4.44k|    src->raw_read = mem_src_read;
  561|  4.44k|    src->raw_close = mem_src_close;
  562|  4.44k|    src->raw_finish = NULL;
  563|  4.44k|    src->size = len;
  564|  4.44k|    src->knownsize = 1;
  565|  4.44k|    src->type = PGP_STREAM_MEMORY;
  566|       |
  567|  4.44k|    return RNP_SUCCESS;
  568|  4.44k|}
stream-common.cpp:_ZL12mem_src_readP12pgp_source_tPvmPm:
  516|  5.80k|{
  517|  5.80k|    pgp_source_mem_param_t *param = (pgp_source_mem_param_t *) src->param;
  518|  5.80k|    if (!param) {
  ------------------
  |  Branch (518:9): [True: 0, False: 5.80k]
  ------------------
  519|      0|        return false;
  520|      0|    }
  521|       |
  522|  5.80k|    if (len > param->len - param->pos) {
  ------------------
  |  Branch (522:9): [True: 294, False: 5.51k]
  ------------------
  523|    294|        len = param->len - param->pos;
  524|    294|    }
  525|  5.80k|    memcpy(buf, (uint8_t *) param->memory + param->pos, len);
  526|  5.80k|    param->pos += len;
  527|  5.80k|    *read = len;
  528|  5.80k|    return true;
  529|  5.80k|}
stream-common.cpp:_ZL13mem_src_closeP12pgp_source_t:
  533|  4.44k|{
  534|  4.44k|    pgp_source_mem_param_t *param = (pgp_source_mem_param_t *) src->param;
  535|  4.44k|    if (param) {
  ------------------
  |  Branch (535:9): [True: 4.44k, False: 0]
  ------------------
  536|  4.44k|        if (param->free) {
  ------------------
  |  Branch (536:13): [True: 0, False: 4.44k]
  ------------------
  537|      0|            free((void *) param->memory);
  538|      0|        }
  539|  4.44k|        free(src->param);
  540|       |        src->param = NULL;
  541|  4.44k|    }
  542|  4.44k|}

_ZN3rnp6SourceC2Ev:
  404|  4.44k|    Source() : src_({})
  405|  4.44k|    {
  406|  4.44k|    }
_ZN3rnp6SourceD2Ev:
  409|  4.44k|    {
  410|  4.44k|        src_.close();
  411|  4.44k|    }
_ZN3rnp6Source3eofEv:
  433|  1.18M|    {
  434|  1.18M|        return src().eof();
  435|  1.18M|    }
_ZN3rnp6Source5errorEv:
  439|   592k|    {
  440|   592k|        return src().error();
  441|   592k|    }

_Z15get_packet_typeh:
   67|  1.18M|{
   68|  1.18M|    if (!(ptag & PGP_PTAG_ALWAYS_SET)) {
  ------------------
  |  |   47|  1.18M|#define PGP_PTAG_ALWAYS_SET 0x80
  ------------------
  |  Branch (68:9): [True: 0, False: 1.18M]
  ------------------
   69|      0|        return -1;
   70|      0|    }
   71|       |
   72|  1.18M|    if (ptag & PGP_PTAG_NEW_FORMAT) {
  ------------------
  |  |   56|  1.18M|#define PGP_PTAG_NEW_FORMAT 0x40
  ------------------
  |  Branch (72:9): [True: 1.09M, False: 89.0k]
  ------------------
   73|  1.09M|        return (int) (ptag & PGP_PTAG_NF_CONTENT_TAG_MASK);
  ------------------
  |  |  137|  1.09M|#define PGP_PTAG_NF_CONTENT_TAG_MASK 0x3f
  ------------------
   74|  1.09M|    } else {
   75|  89.0k|        return (int) ((ptag & PGP_PTAG_OF_CONTENT_TAG_MASK) >> PGP_PTAG_OF_CONTENT_TAG_SHIFT);
  ------------------
  |  |   66|  89.0k|#define PGP_PTAG_OF_CONTENT_TAG_MASK 0x3c
  ------------------
                      return (int) ((ptag & PGP_PTAG_OF_CONTENT_TAG_MASK) >> PGP_PTAG_OF_CONTENT_TAG_SHIFT);
  ------------------
  |  |   74|  89.0k|#define PGP_PTAG_OF_CONTENT_TAG_SHIFT 2
  ------------------
   76|  89.0k|    }
   77|  1.18M|}
_Z15stream_pkt_typeR12pgp_source_t:
   81|   591k|{
   82|   591k|    if (src.eof()) {
  ------------------
  |  Branch (82:9): [True: 0, False: 591k]
  ------------------
   83|      0|        return 0;
   84|      0|    }
   85|   591k|    size_t hdrneed = 0;
   86|   591k|    if (!stream_pkt_hdr_len(src, hdrneed)) {
  ------------------
  |  Branch (86:9): [True: 467, False: 590k]
  ------------------
   87|    467|        return -1;
   88|    467|    }
   89|   590k|    uint8_t hdr[PGP_MAX_HEADER_SIZE];
   90|   590k|    if (!src.peek_eq(hdr, hdrneed)) {
  ------------------
  |  Branch (90:9): [True: 21, False: 590k]
  ------------------
   91|     21|        return -1;
   92|     21|    }
   93|   590k|    return get_packet_type(hdr[0]);
   94|   590k|}
_Z18stream_pkt_hdr_lenR12pgp_source_tRm:
   98|  1.77M|{
   99|  1.77M|    uint8_t buf[2];
  100|       |
  101|  1.77M|    if (!src.peek_eq(buf, 2) || !(buf[0] & PGP_PTAG_ALWAYS_SET)) {
  ------------------
  |  |   47|  1.77M|#define PGP_PTAG_ALWAYS_SET 0x80
  ------------------
  |  Branch (101:9): [True: 446, False: 1.77M]
  |  Branch (101:33): [True: 21, False: 1.77M]
  ------------------
  102|    467|        return false;
  103|    467|    }
  104|       |
  105|  1.77M|    if (buf[0] & PGP_PTAG_NEW_FORMAT) {
  ------------------
  |  |   56|  1.77M|#define PGP_PTAG_NEW_FORMAT 0x40
  ------------------
  |  Branch (105:9): [True: 1.63M, False: 133k]
  ------------------
  106|  1.63M|        if (buf[1] < 192) {
  ------------------
  |  Branch (106:13): [True: 1.63M, False: 3.02k]
  ------------------
  107|  1.63M|            hdrlen = 2;
  108|  1.63M|        } else if (buf[1] < 224) {
  ------------------
  |  Branch (108:20): [True: 1.39k, False: 1.62k]
  ------------------
  109|  1.39k|            hdrlen = 3;
  110|  1.62k|        } else if (buf[1] < 255) {
  ------------------
  |  Branch (110:20): [True: 68, False: 1.56k]
  ------------------
  111|     68|            hdrlen = 2;
  112|  1.56k|        } else {
  113|  1.56k|            hdrlen = 6;
  114|  1.56k|        }
  115|  1.63M|        return true;
  116|  1.63M|    }
  117|       |
  118|   133k|    switch (buf[0] & PGP_PTAG_OF_LENGTH_TYPE_MASK) {
  ------------------
  |  |   83|   133k|#define PGP_PTAG_OF_LENGTH_TYPE_MASK 0x03
  ------------------
  119|   122k|    case PGP_PTAG_OLD_LEN_1:
  ------------------
  |  Branch (119:5): [True: 122k, False: 11.0k]
  ------------------
  120|   122k|        hdrlen = 2;
  121|   122k|        return true;
  122|  8.91k|    case PGP_PTAG_OLD_LEN_2:
  ------------------
  |  Branch (122:5): [True: 8.91k, False: 124k]
  ------------------
  123|  8.91k|        hdrlen = 3;
  124|  8.91k|        return true;
  125|  2.07k|    case PGP_PTAG_OLD_LEN_4:
  ------------------
  |  Branch (125:5): [True: 2.07k, False: 131k]
  ------------------
  126|  2.07k|        hdrlen = 5;
  127|  2.07k|        return true;
  128|     18|    case PGP_PTAG_OLD_LEN_INDETERMINATE:
  ------------------
  |  Branch (128:5): [True: 18, False: 133k]
  ------------------
  129|     18|        hdrlen = 1;
  130|     18|        return true;
  131|      0|    default:
  ------------------
  |  Branch (131:5): [True: 0, False: 133k]
  ------------------
  132|      0|        return false;
  133|   133k|    }
  134|   133k|}
_Z19stream_read_pkt_lenR12pgp_source_tPm:
  176|   590k|{
  177|   590k|    uint8_t buf[6] = {};
  178|   590k|    size_t  read = 0;
  179|       |
  180|   590k|    if (!stream_pkt_hdr_len(src, read)) {
  ------------------
  |  Branch (180:9): [True: 0, False: 590k]
  ------------------
  181|      0|        return false;
  182|      0|    }
  183|       |
  184|   590k|    if (!src.read_eq(buf, read)) {
  ------------------
  |  Branch (184:9): [True: 0, False: 590k]
  ------------------
  185|      0|        return false;
  186|      0|    }
  187|       |
  188|   590k|    return get_pkt_len(buf, pktlen);
  189|   590k|}
_ZN17pgp_packet_body_tC2E14pgp_pkt_type_t:
  463|   590k|{
  464|   590k|    data_.reserve(16);
  465|   590k|    tag_ = tag;
  466|   590k|}
_ZN17pgp_packet_body_tC2EPKhm:
  469|   608k|{
  470|   608k|    data_.assign(data, data + len);
  471|   608k|    tag_ = PGP_PKT_RESERVED;
  472|   608k|}
_ZN17pgp_packet_body_tC2ERKNSt3__16vectorIhNS0_9allocatorIhEEEE:
  475|   592k|    : pgp_packet_body_t(data.data(), data.size())
  476|   592k|{
  477|   592k|}
_ZN17pgp_packet_body_t3curEv:
  487|  1.79M|{
  488|  1.79M|    return data_.data() + pos_;
  489|  1.79M|}
_ZNK17pgp_packet_body_t4leftEv:
  499|  2.97M|{
  500|  2.97M|    return data_.size() - pos_;
  501|  2.97M|}
_ZN17pgp_packet_body_t4skipEm:
  505|   593k|{
  506|   593k|    pos_ += bt;
  507|   593k|}
_ZN17pgp_packet_body_t9skip_backEm:
  511|   599k|{
  512|   599k|    pos_ = bt > pos_ ? 0 : pos_ - bt;
  ------------------
  |  Branch (512:12): [True: 0, False: 599k]
  ------------------
  513|   599k|}
_ZN17pgp_packet_body_t3getERh:
  517|   607k|{
  518|   607k|    if (pos_ >= data_.size()) {
  ------------------
  |  Branch (518:9): [True: 736, False: 606k]
  ------------------
  519|    736|        return false;
  520|    736|    }
  521|   606k|    val = data_[pos_++];
  522|   606k|    return true;
  523|   607k|}
_ZN17pgp_packet_body_t3getERt:
  527|  1.82M|{
  528|  1.82M|    if (pos_ + 2 > data_.size()) {
  ------------------
  |  Branch (528:9): [True: 152, False: 1.82M]
  ------------------
  529|    152|        return false;
  530|    152|    }
  531|  1.82M|    val = read_uint16(data_.data() + pos_);
  532|  1.82M|    pos_ += 2;
  533|  1.82M|    return true;
  534|  1.82M|}
_ZN17pgp_packet_body_t3getERj:
  538|  5.20k|{
  539|  5.20k|    if (pos_ + 4 > data_.size()) {
  ------------------
  |  Branch (539:9): [True: 297, False: 4.91k]
  ------------------
  540|    297|        return false;
  541|    297|    }
  542|  4.91k|    val = read_uint32(data_.data() + pos_);
  543|  4.91k|    pos_ += 4;
  544|  4.91k|    return true;
  545|  5.20k|}
_ZN17pgp_packet_body_t3getEPhm:
  549|  2.43M|{
  550|  2.43M|    if (!len) {
  ------------------
  |  Branch (550:9): [True: 0, False: 2.43M]
  ------------------
  551|       |        /* Do not memcpy with a null destination and zero length, which is
  552|       |         * undefined behavior - callers may pass data() of an empty vector. */
  553|      0|        return true;
  554|      0|    }
  555|  2.43M|    if (pos_ + len > data_.size()) {
  ------------------
  |  Branch (555:9): [True: 1.61k, False: 2.43M]
  ------------------
  556|  1.61k|        return false;
  557|  1.61k|    }
  558|  2.43M|    memcpy(val, data_.data() + pos_, len);
  559|  2.43M|    pos_ += len;
  560|  2.43M|    return true;
  561|  2.43M|}
_ZN17pgp_packet_body_t3getERNSt3__16vectorIhNS0_9allocatorIhEEEEm:
  565|   596k|{
  566|   596k|    if (pos_ + len > data_.size()) {
  ------------------
  |  Branch (566:9): [True: 1.90k, False: 594k]
  ------------------
  567|  1.90k|        return false;
  568|  1.90k|    }
  569|   594k|    val.assign(data_.data() + pos_, data_.data() + pos_ + len);
  570|   594k|    pos_ += len;
  571|   594k|    return true;
  572|   596k|}
_ZN17pgp_packet_body_t3getERN3pgp3mpiE:
  584|   635k|{
  585|   635k|    uint16_t bits = 0;
  586|   635k|    if (!get(bits)) {
  ------------------
  |  Branch (586:9): [True: 148, False: 635k]
  ------------------
  587|    148|        return false;
  588|    148|    }
  589|   635k|    size_t len = (bits + 7) >> 3;
  590|   635k|    if (len > PGP_MPINT_SIZE) {
  ------------------
  |  |   36|   635k|#define PGP_MPINT_SIZE (PGP_MPINT_BITS >> 3)
  |  |  ------------------
  |  |  |  |   35|   635k|#define PGP_MPINT_BITS (16384)
  |  |  ------------------
  ------------------
  |  Branch (590:9): [True: 373, False: 635k]
  ------------------
  591|    373|        RNP_LOG("too large mpi");
  ------------------
  |  |   84|    373|#define RNP_LOG(...) RNP_LOG_FD(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   76|    373|    do {                                                                                 \
  |  |  |  |   77|    373|        if (!rnp_log_switch())                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:13): [True: 373, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   78|    373|            break;                                                                       \
  |  |  |  |   79|    373|        (void) fprintf((fd), "[%s() %s:%d] ", __func__, __SOURCE_PATH_FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define __SOURCE_PATH_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        (void) fprintf((fd), __VA_ARGS__);                                               \
  |  |  |  |   81|      0|        (void) fprintf((fd), "\n");                                                      \
  |  |  |  |   82|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  592|    373|        return false;
  593|    373|    }
  594|   635k|    if (!len) {
  ------------------
  |  Branch (594:9): [True: 299, False: 634k]
  ------------------
  595|    299|        RNP_LOG("0 mpi");
  ------------------
  |  |   84|    299|#define RNP_LOG(...) RNP_LOG_FD(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   76|    299|    do {                                                                                 \
  |  |  |  |   77|    299|        if (!rnp_log_switch())                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:13): [True: 299, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   78|    299|            break;                                                                       \
  |  |  |  |   79|    299|        (void) fprintf((fd), "[%s() %s:%d] ", __func__, __SOURCE_PATH_FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define __SOURCE_PATH_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        (void) fprintf((fd), __VA_ARGS__);                                               \
  |  |  |  |   81|      0|        (void) fprintf((fd), "\n");                                                      \
  |  |  |  |   82|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  596|    299|        return false;
  597|    299|    }
  598|   634k|    val.resize(len);
  599|   634k|    if (!get(val.data(), len)) {
  ------------------
  |  Branch (599:9): [True: 776, False: 634k]
  ------------------
  600|    776|        RNP_LOG("failed to read mpi body");
  ------------------
  |  |   84|    776|#define RNP_LOG(...) RNP_LOG_FD(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   76|    776|    do {                                                                                 \
  |  |  |  |   77|    776|        if (!rnp_log_switch())                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:13): [True: 776, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   78|    776|            break;                                                                       \
  |  |  |  |   79|    776|        (void) fprintf((fd), "[%s() %s:%d] ", __func__, __SOURCE_PATH_FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define __SOURCE_PATH_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        (void) fprintf((fd), __VA_ARGS__);                                               \
  |  |  |  |   81|      0|        (void) fprintf((fd), "\n");                                                      \
  |  |  |  |   82|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  601|    776|        return false;
  602|    776|    }
  603|       |    /* check the mpi bit count */
  604|   634k|    size_t mbits = val.bits();
  605|   634k|    if (mbits != bits) {
  ------------------
  |  Branch (605:9): [True: 556k, False: 77.5k]
  ------------------
  606|   556k|        RNP_LOG(
  ------------------
  |  |   84|   556k|#define RNP_LOG(...) RNP_LOG_FD(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   76|   556k|    do {                                                                                 \
  |  |  |  |   77|   556k|        if (!rnp_log_switch())                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:13): [True: 556k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   78|   556k|            break;                                                                       \
  |  |  |  |   79|   556k|        (void) fprintf((fd), "[%s() %s:%d] ", __func__, __SOURCE_PATH_FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define __SOURCE_PATH_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        (void) fprintf((fd), __VA_ARGS__);                                               \
  |  |  |  |   81|      0|        (void) fprintf((fd), "\n");                                                      \
  |  |  |  |   82|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  607|   556k|          "Warning! Wrong mpi bit count: got %" PRIu16 ", but actual is %zu", bits, mbits);
  608|   556k|    }
  609|   634k|    return true;
  610|   634k|}
_ZN17pgp_packet_body_t4readER12pgp_source_t:
  907|   590k|{
  908|       |    /* Make sure we have enough data for packet header */
  909|   590k|    if (!src.peek_eq(hdr_, 2)) {
  ------------------
  |  Branch (909:9): [True: 0, False: 590k]
  ------------------
  910|      0|        return RNP_ERROR_READ;
  911|      0|    }
  912|       |
  913|       |    /* Read the packet header and length */
  914|   590k|    size_t len = 0;
  915|   590k|    if (!stream_pkt_hdr_len(src, len)) {
  ------------------
  |  Branch (915:9): [True: 0, False: 590k]
  ------------------
  916|      0|        return RNP_ERROR_BAD_FORMAT;
  917|      0|    }
  918|   590k|    if (!src.peek_eq(hdr_, len)) {
  ------------------
  |  Branch (918:9): [True: 0, False: 590k]
  ------------------
  919|      0|        return RNP_ERROR_READ;
  920|      0|    }
  921|   590k|    hdr_len_ = len;
  922|       |
  923|   590k|    int ptag = get_packet_type(hdr_[0]);
  924|   590k|    if ((ptag < 0) || ((tag_ != PGP_PKT_RESERVED) && (tag_ != ptag))) {
  ------------------
  |  Branch (924:9): [True: 0, False: 590k]
  |  Branch (924:24): [True: 590k, False: 0]
  |  Branch (924:54): [True: 0, False: 590k]
  ------------------
  925|      0|        RNP_LOG("tag mismatch: %d vs %d", (int) tag_, ptag);
  ------------------
  |  |   84|      0|#define RNP_LOG(...) RNP_LOG_FD(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   76|      0|    do {                                                                                 \
  |  |  |  |   77|      0|        if (!rnp_log_switch())                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   78|      0|            break;                                                                       \
  |  |  |  |   79|      0|        (void) fprintf((fd), "[%s() %s:%d] ", __func__, __SOURCE_PATH_FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define __SOURCE_PATH_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        (void) fprintf((fd), __VA_ARGS__);                                               \
  |  |  |  |   81|      0|        (void) fprintf((fd), "\n");                                                      \
  |  |  |  |   82|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  926|      0|        return RNP_ERROR_BAD_FORMAT;
  927|      0|    }
  928|   590k|    tag_ = (pgp_pkt_type_t) ptag;
  929|       |
  930|   590k|    if (!stream_read_pkt_len(src, &len)) {
  ------------------
  |  Branch (930:9): [True: 27, False: 590k]
  ------------------
  931|     27|        return RNP_ERROR_READ;
  932|     27|    }
  933|       |
  934|       |    /* early exit for the empty packet */
  935|   590k|    if (!len) {
  ------------------
  |  Branch (935:9): [True: 80, False: 590k]
  ------------------
  936|     80|        return RNP_SUCCESS;
  937|     80|    }
  938|       |
  939|   590k|    if (len > PGP_MAX_PKT_SIZE) {
  ------------------
  |  |   40|   590k|#define PGP_MAX_PKT_SIZE 0x100000
  ------------------
  |  Branch (939:9): [True: 25, False: 590k]
  ------------------
  940|     25|        RNP_LOG("too large packet");
  ------------------
  |  |   84|     25|#define RNP_LOG(...) RNP_LOG_FD(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   76|     25|    do {                                                                                 \
  |  |  |  |   77|     25|        if (!rnp_log_switch())                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:13): [True: 25, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   78|     25|            break;                                                                       \
  |  |  |  |   79|     25|        (void) fprintf((fd), "[%s() %s:%d] ", __func__, __SOURCE_PATH_FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define __SOURCE_PATH_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        (void) fprintf((fd), __VA_ARGS__);                                               \
  |  |  |  |   81|      0|        (void) fprintf((fd), "\n");                                                      \
  |  |  |  |   82|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  941|     25|        return RNP_ERROR_BAD_FORMAT;
  942|     25|    }
  943|       |
  944|       |    /* Read the packet contents */
  945|   590k|    try {
  946|   590k|        data_.resize(len);
  947|   590k|    } catch (const std::exception &e) {
  948|      0|        RNP_LOG("malloc of %d bytes failed, %s", (int) len, e.what());
  ------------------
  |  |   84|      0|#define RNP_LOG(...) RNP_LOG_FD(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   76|      0|    do {                                                                                 \
  |  |  |  |   77|      0|        if (!rnp_log_switch())                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   78|      0|            break;                                                                       \
  |  |  |  |   79|      0|        (void) fprintf((fd), "[%s() %s:%d] ", __func__, __SOURCE_PATH_FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define __SOURCE_PATH_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        (void) fprintf((fd), __VA_ARGS__);                                               \
  |  |  |  |   81|      0|        (void) fprintf((fd), "\n");                                                      \
  |  |  |  |   82|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  949|      0|        return RNP_ERROR_OUT_OF_MEMORY;
  950|      0|    }
  951|       |
  952|   590k|    size_t read = 0;
  953|   590k|    if (!src.read(data_.data(), len, &read) || (read != len)) {
  ------------------
  |  Branch (953:9): [True: 45, False: 590k]
  |  Branch (953:48): [True: 637, False: 589k]
  ------------------
  954|    682|        RNP_LOG("read %d instead of %d", (int) read, (int) len);
  ------------------
  |  |   84|    682|#define RNP_LOG(...) RNP_LOG_FD(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   76|    682|    do {                                                                                 \
  |  |  |  |   77|    682|        if (!rnp_log_switch())                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:13): [True: 682, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   78|    682|            break;                                                                       \
  |  |  |  |   79|    682|        (void) fprintf((fd), "[%s() %s:%d] ", __func__, __SOURCE_PATH_FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define __SOURCE_PATH_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        (void) fprintf((fd), __VA_ARGS__);                                               \
  |  |  |  |   81|      0|        (void) fprintf((fd), "\n");                                                      \
  |  |  |  |   82|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  955|    682|        return RNP_ERROR_READ;
  956|    682|    }
  957|   589k|    pos_ = 0;
  958|   589k|    return RNP_SUCCESS;
  959|   590k|}
stream-packet.cpp:_ZL11get_pkt_lenPhPm:
  138|   590k|{
  139|   590k|    if (hdr[0] & PGP_PTAG_NEW_FORMAT) {
  ------------------
  |  |   56|   590k|#define PGP_PTAG_NEW_FORMAT 0x40
  ------------------
  |  Branch (139:9): [True: 546k, False: 44.5k]
  ------------------
  140|       |        // 1-byte length
  141|   546k|        if (hdr[1] < 192) {
  ------------------
  |  Branch (141:13): [True: 545k, False: 1.00k]
  ------------------
  142|   545k|            *pktlen = hdr[1];
  143|   545k|            return true;
  144|   545k|        }
  145|       |        // 2-byte length
  146|  1.00k|        if (hdr[1] < 224) {
  ------------------
  |  Branch (146:13): [True: 461, False: 539]
  ------------------
  147|    461|            *pktlen = ((size_t)(hdr[1] - 192) << 8) + (size_t) hdr[2] + 192;
  148|    461|            return true;
  149|    461|        }
  150|       |        // partial length - we do not allow it here
  151|    539|        if (hdr[1] < 255) {
  ------------------
  |  Branch (151:13): [True: 21, False: 518]
  ------------------
  152|     21|            return false;
  153|     21|        }
  154|       |        // 4-byte length
  155|    518|        *pktlen = read_uint32(&hdr[2]);
  156|    518|        return true;
  157|    539|    }
  158|       |
  159|  44.5k|    switch (hdr[0] & PGP_PTAG_OF_LENGTH_TYPE_MASK) {
  ------------------
  |  |   83|  44.5k|#define PGP_PTAG_OF_LENGTH_TYPE_MASK 0x03
  ------------------
  160|  40.8k|    case PGP_PTAG_OLD_LEN_1:
  ------------------
  |  Branch (160:5): [True: 40.8k, False: 3.66k]
  ------------------
  161|  40.8k|        *pktlen = hdr[1];
  162|  40.8k|        return true;
  163|  2.97k|    case PGP_PTAG_OLD_LEN_2:
  ------------------
  |  Branch (163:5): [True: 2.97k, False: 41.5k]
  ------------------
  164|  2.97k|        *pktlen = read_uint16(&hdr[1]);
  165|  2.97k|        return true;
  166|    689|    case PGP_PTAG_OLD_LEN_4:
  ------------------
  |  Branch (166:5): [True: 689, False: 43.8k]
  ------------------
  167|    689|        *pktlen = read_uint32(&hdr[1]);
  168|    689|        return true;
  169|      6|    default:
  ------------------
  |  Branch (169:5): [True: 6, False: 44.5k]
  ------------------
  170|      6|        return false;
  171|  44.5k|    }
  172|  44.5k|}

_Z22process_pgp_signaturesR12pgp_source_tRNSt3__16vectorIN3pgp3pkt9SignatureENS1_9allocatorIS5_EEEE:
  167|  4.44k|{
  168|  4.44k|    sigs.clear();
  169|       |    /* Allow binary or armored input, including multiple armored messages */
  170|  4.44k|    rnp::ArmoredSource armor(
  171|  4.44k|      src, rnp::ArmoredSource::AllowBinary | rnp::ArmoredSource::AllowMultiple);
  172|       |    /* read sequence of OpenPGP signatures */
  173|   592k|    while (!armor.error()) {
  ------------------
  |  Branch (173:12): [True: 591k, False: 923]
  ------------------
  174|   591k|        if (armor.eof() && armor.multiple()) {
  ------------------
  |  Branch (174:13): [True: 42.6k, False: 549k]
  |  Branch (174:28): [True: 42.2k, False: 336]
  ------------------
  175|  42.2k|            armor.restart();
  176|  42.2k|        }
  177|   591k|        if (armor.eof()) {
  ------------------
  |  Branch (177:13): [True: 418, False: 591k]
  ------------------
  178|    418|            break;
  179|    418|        }
  180|   591k|        int ptag = stream_pkt_type(armor.src());
  181|   591k|        if (ptag != PGP_PKT_SIGNATURE) {
  ------------------
  |  Branch (181:13): [True: 506, False: 590k]
  ------------------
  182|    506|            RNP_LOG("wrong signature tag: %d", ptag);
  ------------------
  |  |   84|    506|#define RNP_LOG(...) RNP_LOG_FD(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   76|    506|    do {                                                                                 \
  |  |  |  |   77|    506|        if (!rnp_log_switch())                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:13): [True: 506, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   78|    506|            break;                                                                       \
  |  |  |  |   79|    506|        (void) fprintf((fd), "[%s() %s:%d] ", __func__, __SOURCE_PATH_FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define __SOURCE_PATH_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        (void) fprintf((fd), __VA_ARGS__);                                               \
  |  |  |  |   81|      0|        (void) fprintf((fd), "\n");                                                      \
  |  |  |  |   82|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  183|    506|            sigs.clear();
  184|    506|            return RNP_ERROR_BAD_FORMAT;
  185|    506|        }
  186|       |
  187|   590k|        sigs.emplace_back();
  188|   590k|        rnp_result_t ret = sigs.back().parse(armor.src());
  189|   590k|        if (ret) {
  ------------------
  |  Branch (189:13): [True: 2.59k, False: 588k]
  ------------------
  190|  2.59k|            sigs.clear();
  191|  2.59k|            return ret;
  192|  2.59k|        }
  193|   590k|    }
  194|  1.34k|    if (armor.error()) {
  ------------------
  |  Branch (194:9): [True: 0, False: 1.34k]
  ------------------
  195|      0|        sigs.clear();
  196|      0|        return RNP_ERROR_READ;
  197|      0|    }
  198|  1.34k|    return RNP_SUCCESS;
  199|  1.34k|}
_ZNK3pgp3pkt9Signature10get_subpktEhb:
  254|   180k|{
  255|   180k|    size_t idx = find_subpkt(stype, hashed);
  256|   180k|    return idx == SIZE_MAX ? nullptr : subpkts[idx].get();
  ------------------
  |  Branch (256:12): [True: 90.3k, False: 90.4k]
  ------------------
  257|   180k|}
_ZNK3pgp3pkt9Signature10get_subpktENS0_6sigsub4TypeEb:
  267|   180k|{
  268|   180k|    return get_subpkt(static_cast<uint8_t>(type), hashed);
  269|   180k|}
_ZNK3pgp3pkt9Signature10has_subpktEhb:
  273|  46.4k|{
  274|       |    return find_subpkt(stype, hashed) != SIZE_MAX;
  275|  46.4k|}
_ZNK3pgp3pkt9Signature9has_keyidEv:
  292|  47.0k|{
  293|  47.0k|    return (version < PGP_V4) || has_subpkt(PGP_SIG_SUBPKT_ISSUER_KEY_ID, false) ||
  ------------------
  |  Branch (293:12): [True: 578, False: 46.4k]
  |  Branch (293:34): [True: 2.47k, False: 43.9k]
  ------------------
  294|  43.9k|           has_keyfp();
  ------------------
  |  Branch (294:12): [True: 0, False: 43.9k]
  ------------------
  295|  47.0k|}
_ZNK3pgp3pkt9Signature5keyidEv:
  299|  3.05k|{
  300|       |    /* version 3 uses signature field */
  301|  3.05k|    if (version < PGP_V4) {
  ------------------
  |  Branch (301:9): [True: 578, False: 2.47k]
  ------------------
  302|    578|        return signer;
  303|    578|    }
  304|       |
  305|       |    /* version 4 and up use subpackets */
  306|  2.47k|    if (version == PGP_V4) {
  ------------------
  |  Branch (306:9): [True: 952, False: 1.52k]
  ------------------
  307|    952|        auto sub = dynamic_cast<const sigsub::IssuerKeyID *>(
  308|    952|          get_subpkt(sigsub::Type::IssuerKeyID, false));
  309|    952|        if (sub) {
  ------------------
  |  Branch (309:13): [True: 952, False: 0]
  ------------------
  310|    952|            return sub->keyid();
  311|    952|        }
  312|    952|    }
  313|       |    /* v5 and up must have fingerprint, from which keyid would be extracted */
  314|  1.52k|    return keyfp().keyid();
  315|  2.47k|}
_ZNK3pgp3pkt9Signature9has_keyfpEv:
  332|   134k|{
  333|   134k|    auto sub = dynamic_cast<const sigsub::IssuerFingerprint *>(
  334|   134k|      get_subpkt(sigsub::Type::IssuerFingerprint));
  335|   134k|    if (!sub) {
  ------------------
  |  Branch (335:9): [True: 89.2k, False: 45.4k]
  ------------------
  336|  89.2k|        return false;
  337|  89.2k|    }
  338|  45.4k|    switch (version) {
  339|  44.6k|    case PGP_V4:
  ------------------
  |  Branch (339:5): [True: 44.6k, False: 790]
  ------------------
  340|  44.6k|        return sub->fp().size() == PGP_FINGERPRINT_V4_SIZE;
  ------------------
  |  |   43|  44.6k|#define PGP_FINGERPRINT_V4_SIZE 20
  ------------------
  341|    790|    case PGP_V5:
  ------------------
  |  Branch (341:5): [True: 790, False: 44.6k]
  ------------------
  342|    790|#if defined(ENABLE_CRYPTO_REFRESH)
  343|    790|    case PGP_V6:
  ------------------
  |  Branch (343:5): [True: 0, False: 45.4k]
  ------------------
  344|    790|#endif
  345|    790|        return sub->fp().size() == PGP_FINGERPRINT_V5_SIZE;
  ------------------
  |  |   44|    790|#define PGP_FINGERPRINT_V5_SIZE 32
  ------------------
  346|      0|    default:
  ------------------
  |  Branch (346:5): [True: 0, False: 45.4k]
  ------------------
  347|      0|        return false;
  348|  45.4k|    }
  349|  45.4k|}
_ZNK3pgp3pkt9Signature5keyfpEv:
  353|  45.2k|{
  354|  45.2k|    auto sub = dynamic_cast<const sigsub::IssuerFingerprint *>(
  355|  45.2k|      get_subpkt(sigsub::Type::IssuerFingerprint));
  356|  45.2k|    return sub ? sub->fp() : Fingerprint{};
  ------------------
  |  Branch (356:12): [True: 44.0k, False: 1.13k]
  ------------------
  357|  45.2k|}
_ZN3pgp3pkt9Signature10parse_v2v3ER17pgp_packet_body_t:
  853|  2.78k|{
  854|       |    /* parse v2/v3-specific fields, not the whole signature */
  855|  2.78k|    uint8_t buf[16] = {};
  856|  2.78k|    if (!pkt.get(buf, 16)) {
  ------------------
  |  Branch (856:9): [True: 290, False: 2.49k]
  ------------------
  857|    290|        RNP_LOG("cannot get enough bytes");
  ------------------
  |  |   84|    290|#define RNP_LOG(...) RNP_LOG_FD(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   76|    290|    do {                                                                                 \
  |  |  |  |   77|    290|        if (!rnp_log_switch())                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:13): [True: 290, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   78|    290|            break;                                                                       \
  |  |  |  |   79|    290|        (void) fprintf((fd), "[%s() %s:%d] ", __func__, __SOURCE_PATH_FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define __SOURCE_PATH_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        (void) fprintf((fd), __VA_ARGS__);                                               \
  |  |  |  |   81|      0|        (void) fprintf((fd), "\n");                                                      \
  |  |  |  |   82|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  858|    290|        return RNP_ERROR_BAD_FORMAT;
  859|    290|    }
  860|       |    /* length of hashed data, 5 */
  861|  2.49k|    if (buf[0] != 5) {
  ------------------
  |  Branch (861:9): [True: 263, False: 2.22k]
  ------------------
  862|    263|        RNP_LOG("wrong length of hashed data");
  ------------------
  |  |   84|    263|#define RNP_LOG(...) RNP_LOG_FD(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   76|    263|    do {                                                                                 \
  |  |  |  |   77|    263|        if (!rnp_log_switch())                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:13): [True: 263, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   78|    263|            break;                                                                       \
  |  |  |  |   79|    263|        (void) fprintf((fd), "[%s() %s:%d] ", __func__, __SOURCE_PATH_FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define __SOURCE_PATH_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        (void) fprintf((fd), __VA_ARGS__);                                               \
  |  |  |  |   81|      0|        (void) fprintf((fd), "\n");                                                      \
  |  |  |  |   82|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  863|    263|        return RNP_ERROR_BAD_FORMAT;
  864|    263|    }
  865|       |    /* hashed data */
  866|  2.22k|    hashed_data.assign(buf + 1, buf + 6);
  867|       |    /* signature type */
  868|  2.22k|    type_ = (pgp_sig_type_t) buf[1];
  869|       |    /* creation time */
  870|  2.22k|    creation_time = read_uint32(&buf[2]);
  871|       |    /* signer's key id */
  872|  2.22k|    static_assert(std::tuple_size<decltype(signer)>::value == PGP_KEY_ID_SIZE,
  873|  2.22k|                  "v3 signer field size mismatch");
  874|  2.22k|    memcpy(signer.data(), &buf[6], PGP_KEY_ID_SIZE);
  ------------------
  |  |   39|  2.22k|#define PGP_KEY_ID_SIZE 8
  ------------------
  875|       |    /* public key algorithm */
  876|  2.22k|    palg = (pgp_pubkey_alg_t) buf[14];
  877|       |    /* hash algorithm */
  878|  2.22k|    halg = (pgp_hash_alg_t) buf[15];
  879|  2.22k|    return RNP_SUCCESS;
  880|  2.49k|}
_ZN3pgp3pkt9Signature16parse_subpacketsEPhmbm:
  886|  1.19M|{
  887|  1.19M|    bool res = true;
  888|       |
  889|  1.45M|    while (len) {
  ------------------
  |  Branch (889:12): [True: 265k, False: 1.19M]
  ------------------
  890|   265k|        if (subpkts.size() >= MAX_SUBPACKETS) {
  ------------------
  |  |  882|   265k|#define MAX_SUBPACKETS 64
  ------------------
  |  Branch (890:13): [True: 130, False: 265k]
  ------------------
  891|    130|            RNP_LOG("too many signature subpackets");
  ------------------
  |  |   84|    130|#define RNP_LOG(...) RNP_LOG_FD(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   76|    130|    do {                                                                                 \
  |  |  |  |   77|    130|        if (!rnp_log_switch())                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:13): [True: 130, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   78|    130|            break;                                                                       \
  |  |  |  |   79|    130|        (void) fprintf((fd), "[%s() %s:%d] ", __func__, __SOURCE_PATH_FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define __SOURCE_PATH_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        (void) fprintf((fd), __VA_ARGS__);                                               \
  |  |  |  |   81|      0|        (void) fprintf((fd), "\n");                                                      \
  |  |  |  |   82|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  892|    130|            return false;
  893|    130|        }
  894|   265k|        if (len < 2) {
  ------------------
  |  Branch (894:13): [True: 720, False: 264k]
  ------------------
  895|    720|            RNP_LOG("got single byte %" PRIu8, *buf);
  ------------------
  |  |   84|    720|#define RNP_LOG(...) RNP_LOG_FD(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   76|    720|    do {                                                                                 \
  |  |  |  |   77|    720|        if (!rnp_log_switch())                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:13): [True: 720, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   78|    720|            break;                                                                       \
  |  |  |  |   79|    720|        (void) fprintf((fd), "[%s() %s:%d] ", __func__, __SOURCE_PATH_FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define __SOURCE_PATH_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        (void) fprintf((fd), __VA_ARGS__);                                               \
  |  |  |  |   81|      0|        (void) fprintf((fd), "\n");                                                      \
  |  |  |  |   82|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  896|    720|            return false;
  897|    720|        }
  898|       |
  899|       |        /* subpacket length */
  900|   264k|        size_t splen = *buf++;
  901|   264k|        len--;
  902|   264k|        if ((splen >= 192) && (splen < 255)) {
  ------------------
  |  Branch (902:13): [True: 4.95k, False: 259k]
  |  Branch (902:31): [True: 1.21k, False: 3.74k]
  ------------------
  903|  1.21k|            splen = ((splen - 192) << 8) + *buf++ + 192;
  904|  1.21k|            len--;
  905|   263k|        } else if (splen == 255) {
  ------------------
  |  Branch (905:20): [True: 3.74k, False: 259k]
  ------------------
  906|  3.74k|            if (len < 4) {
  ------------------
  |  Branch (906:17): [True: 424, False: 3.32k]
  ------------------
  907|    424|                RNP_LOG("got 4-byte len but only %zu bytes in buffer", len);
  ------------------
  |  |   84|    424|#define RNP_LOG(...) RNP_LOG_FD(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   76|    424|    do {                                                                                 \
  |  |  |  |   77|    424|        if (!rnp_log_switch())                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:13): [True: 424, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   78|    424|            break;                                                                       \
  |  |  |  |   79|    424|        (void) fprintf((fd), "[%s() %s:%d] ", __func__, __SOURCE_PATH_FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define __SOURCE_PATH_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        (void) fprintf((fd), __VA_ARGS__);                                               \
  |  |  |  |   81|      0|        (void) fprintf((fd), "\n");                                                      \
  |  |  |  |   82|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  908|    424|                return false;
  909|    424|            }
  910|  3.32k|            splen = read_uint32(buf);
  911|  3.32k|            buf += 4;
  912|  3.32k|            len -= 4;
  913|  3.32k|        }
  914|       |
  915|   264k|        if (!splen) {
  ------------------
  |  Branch (915:13): [True: 615, False: 263k]
  ------------------
  916|    615|            RNP_LOG("got subpacket with 0 length");
  ------------------
  |  |   84|    615|#define RNP_LOG(...) RNP_LOG_FD(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   76|    615|    do {                                                                                 \
  |  |  |  |   77|    615|        if (!rnp_log_switch())                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:13): [True: 615, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   78|    615|            break;                                                                       \
  |  |  |  |   79|    615|        (void) fprintf((fd), "[%s() %s:%d] ", __func__, __SOURCE_PATH_FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define __SOURCE_PATH_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        (void) fprintf((fd), __VA_ARGS__);                                               \
  |  |  |  |   81|      0|        (void) fprintf((fd), "\n");                                                      \
  |  |  |  |   82|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  917|    615|            return false;
  918|    615|        }
  919|       |
  920|       |        /* subpacket data */
  921|   263k|        if (len < splen) {
  ------------------
  |  Branch (921:13): [True: 2.64k, False: 261k]
  ------------------
  922|  2.64k|            RNP_LOG("got subpacket len %zu, while only %zu bytes left", splen, len);
  ------------------
  |  |   84|  2.64k|#define RNP_LOG(...) RNP_LOG_FD(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   76|  2.64k|    do {                                                                                 \
  |  |  |  |   77|  2.64k|        if (!rnp_log_switch())                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:13): [True: 2.64k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   78|  2.64k|            break;                                                                       \
  |  |  |  |   79|  2.64k|        (void) fprintf((fd), "[%s() %s:%d] ", __func__, __SOURCE_PATH_FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define __SOURCE_PATH_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        (void) fprintf((fd), __VA_ARGS__);                                               \
  |  |  |  |   81|      0|        (void) fprintf((fd), "\n");                                                      \
  |  |  |  |   82|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  923|  2.64k|            return false;
  924|  2.64k|        }
  925|       |
  926|   261k|        auto subpkt = sigsub::Raw::create(buf, splen, hashed, depth);
  927|   261k|        if (!subpkt) {
  ------------------
  |  Branch (927:13): [True: 33.8k, False: 227k]
  ------------------
  928|  33.8k|            res = false;
  929|   227k|        } else {
  930|   227k|            subpkts.items.push_back(std::move(subpkt));
  931|   227k|        }
  932|   261k|        len -= splen;
  933|   261k|        buf += splen;
  934|   261k|    }
  935|  1.19M|    return res;
  936|  1.19M|}
_ZN3pgp3pkt9Signature14get_subpkt_lenER17pgp_packet_body_tRm:
  940|  1.19M|{
  941|  1.19M|    switch (version) {
  942|  1.17M|    case PGP_V4:
  ------------------
  |  Branch (942:5): [True: 1.17M, False: 24.0k]
  ------------------
  943|  1.19M|    case PGP_V5: {
  ------------------
  |  Branch (943:5): [True: 18.8k, False: 1.17M]
  ------------------
  944|  1.19M|        uint16_t len = 0;
  945|  1.19M|        if (!pkt.get(len)) {
  ------------------
  |  Branch (945:13): [True: 4, False: 1.19M]
  ------------------
  946|      4|            return false;
  947|      4|        }
  948|  1.19M|        splen = len;
  949|  1.19M|        return true;
  950|  1.19M|    }
  951|      0|#if defined(ENABLE_CRYPTO_REFRESH)
  952|  5.20k|    case PGP_V6: {
  ------------------
  |  Branch (952:5): [True: 5.20k, False: 1.19M]
  ------------------
  953|  5.20k|        uint32_t len = 0;
  954|  5.20k|        if (!pkt.get(len)) {
  ------------------
  |  Branch (954:13): [True: 297, False: 4.91k]
  ------------------
  955|    297|            return false;
  956|    297|        }
  957|  4.91k|        splen = len;
  958|  4.91k|        return true;
  959|  5.20k|    }
  960|      0|#endif
  961|      0|    default:
  ------------------
  |  Branch (961:5): [True: 0, False: 1.19M]
  ------------------
  962|      0|        RNP_LOG("unsupported signature version: %d", (int) version);
  ------------------
  |  |   84|      0|#define RNP_LOG(...) RNP_LOG_FD(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   76|      0|    do {                                                                                 \
  |  |  |  |   77|      0|        if (!rnp_log_switch())                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   78|      0|            break;                                                                       \
  |  |  |  |   79|      0|        (void) fprintf((fd), "[%s() %s:%d] ", __func__, __SOURCE_PATH_FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define __SOURCE_PATH_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        (void) fprintf((fd), __VA_ARGS__);                                               \
  |  |  |  |   81|      0|        (void) fprintf((fd), "\n");                                                      \
  |  |  |  |   82|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  963|      0|        return false;
  964|  1.19M|    }
  965|  1.19M|}
_ZNK3pgp3pkt9Signature11find_subpktEhbm:
  969|   227k|{
  970|   227k|    if (version < PGP_V4) {
  ------------------
  |  Branch (970:9): [True: 578, False: 226k]
  ------------------
  971|    578|        return SIZE_MAX;
  972|    578|    }
  973|   271k|    for (size_t idx = 0; idx < subpkts.size(); idx++) {
  ------------------
  |  Branch (973:26): [True: 137k, False: 133k]
  ------------------
  974|   137k|        if ((subpkts[idx]->raw_type() != stype) || (hashed && !subpkts[idx]->hashed())) {
  ------------------
  |  Branch (974:13): [True: 44.1k, False: 93.6k]
  |  Branch (974:53): [True: 90.2k, False: 3.42k]
  |  Branch (974:63): [True: 660, False: 89.5k]
  ------------------
  975|  44.7k|            continue;
  976|  44.7k|        }
  977|  92.9k|        if (!skip) {
  ------------------
  |  Branch (977:13): [True: 92.9k, False: 0]
  ------------------
  978|  92.9k|            return idx;
  979|  92.9k|        }
  980|      0|        skip--;
  981|      0|    }
  982|   133k|    return SIZE_MAX;
  983|   226k|}
_ZN3pgp3pkt9Signature10parse_v4upER17pgp_packet_body_tm:
  993|   600k|{
  994|       |    /* parse v4 (and up) specific fields, not the whole signature */
  995|   600k|    uint8_t buf[3];
  996|   600k|    if (!pkt.get(buf, 3)) {
  ------------------
  |  Branch (996:9): [True: 9, False: 600k]
  ------------------
  997|      9|        RNP_LOG("cannot get first 3 bytes");
  ------------------
  |  |   84|      9|#define RNP_LOG(...) RNP_LOG_FD(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   76|      9|    do {                                                                                 \
  |  |  |  |   77|      9|        if (!rnp_log_switch())                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:13): [True: 9, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   78|      9|            break;                                                                       \
  |  |  |  |   79|      9|        (void) fprintf((fd), "[%s() %s:%d] ", __func__, __SOURCE_PATH_FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define __SOURCE_PATH_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        (void) fprintf((fd), __VA_ARGS__);                                               \
  |  |  |  |   81|      0|        (void) fprintf((fd), "\n");                                                      \
  |  |  |  |   82|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  998|      9|        return RNP_ERROR_BAD_FORMAT;
  999|      9|    }
 1000|       |
 1001|       |    /* signature type */
 1002|   600k|    type_ = (pgp_sig_type_t) buf[0];
 1003|       |    /* public key algorithm */
 1004|   600k|    palg = (pgp_pubkey_alg_t) buf[1];
 1005|       |    /* hash algorithm */
 1006|   600k|    halg = (pgp_hash_alg_t) buf[2];
 1007|       |    /* hashed subpackets length */
 1008|       |
 1009|   600k|    size_t splen = 0;
 1010|   600k|    auto   hash_begin = pkt.cur();
 1011|   600k|    if (!get_subpkt_len(pkt, splen)) {
  ------------------
  |  Branch (1011:9): [True: 301, False: 600k]
  ------------------
 1012|    301|        RNP_LOG("cannot get hashed len");
  ------------------
  |  |   84|    301|#define RNP_LOG(...) RNP_LOG_FD(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   76|    301|    do {                                                                                 \
  |  |  |  |   77|    301|        if (!rnp_log_switch())                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:13): [True: 301, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   78|    301|            break;                                                                       \
  |  |  |  |   79|    301|        (void) fprintf((fd), "[%s() %s:%d] ", __func__, __SOURCE_PATH_FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define __SOURCE_PATH_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        (void) fprintf((fd), __VA_ARGS__);                                               \
  |  |  |  |   81|      0|        (void) fprintf((fd), "\n");                                                      \
  |  |  |  |   82|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1013|    301|        return RNP_ERROR_BAD_FORMAT;
 1014|    301|    }
 1015|   600k|    size_t splen_size = pkt.cur() - hash_begin;
 1016|       |    /* hashed subpackets length + splen_size bytes of length of unhashed subpackets. v6 splen
 1017|       |     * is 32-bit, so do not add it to anything: the sum may wrap with a 32-bit size_t. */
 1018|   600k|    if ((splen > pkt.left()) || (pkt.left() - splen < splen_size)) {
  ------------------
  |  Branch (1018:9): [True: 1.03k, False: 599k]
  |  Branch (1018:33): [True: 41, False: 599k]
  ------------------
 1019|  1.07k|        RNP_LOG("wrong packet or hashed subpackets length");
  ------------------
  |  |   84|  1.07k|#define RNP_LOG(...) RNP_LOG_FD(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   76|  1.07k|    do {                                                                                 \
  |  |  |  |   77|  1.07k|        if (!rnp_log_switch())                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:13): [True: 1.07k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   78|  1.07k|            break;                                                                       \
  |  |  |  |   79|  1.07k|        (void) fprintf((fd), "[%s() %s:%d] ", __func__, __SOURCE_PATH_FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define __SOURCE_PATH_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        (void) fprintf((fd), __VA_ARGS__);                                               \
  |  |  |  |   81|      0|        (void) fprintf((fd), "\n");                                                      \
  |  |  |  |   82|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1020|  1.07k|        return RNP_ERROR_BAD_FORMAT;
 1021|  1.07k|    }
 1022|       |    /* building hashed data */
 1023|   599k|    size_t hlen = 4 + splen + splen_size;
 1024|   599k|    hashed_data.resize(hlen);
 1025|   599k|    hashed_data[0] = version;
 1026|   599k|    static_assert(sizeof(buf) == 3, "Wrong signature header size.");
 1027|   599k|    pkt.skip_back(3 + splen_size);
 1028|       |
 1029|   599k|    if (!pkt.get(hashed_data.data() + 1, hlen - 1)) {
  ------------------
  |  Branch (1029:9): [True: 0, False: 599k]
  ------------------
 1030|      0|        RNP_LOG("cannot get hashed subpackets data");
  ------------------
  |  |   84|      0|#define RNP_LOG(...) RNP_LOG_FD(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   76|      0|    do {                                                                                 \
  |  |  |  |   77|      0|        if (!rnp_log_switch())                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   78|      0|            break;                                                                       \
  |  |  |  |   79|      0|        (void) fprintf((fd), "[%s() %s:%d] ", __func__, __SOURCE_PATH_FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define __SOURCE_PATH_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        (void) fprintf((fd), __VA_ARGS__);                                               \
  |  |  |  |   81|      0|        (void) fprintf((fd), "\n");                                                      \
  |  |  |  |   82|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1031|      0|        return RNP_ERROR_BAD_FORMAT;
 1032|      0|    }
 1033|       |    /* parsing hashed subpackets */
 1034|   599k|    if (!parse_subpackets(hashed_data.data() + 4 + splen_size, splen, true, depth)) {
  ------------------
  |  Branch (1034:9): [True: 3.45k, False: 596k]
  ------------------
 1035|  3.45k|        RNP_LOG("failed to parse hashed subpackets");
  ------------------
  |  |   84|  3.45k|#define RNP_LOG(...) RNP_LOG_FD(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   76|  3.45k|    do {                                                                                 \
  |  |  |  |   77|  3.45k|        if (!rnp_log_switch())                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:13): [True: 3.45k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   78|  3.45k|            break;                                                                       \
  |  |  |  |   79|  3.45k|        (void) fprintf((fd), "[%s() %s:%d] ", __func__, __SOURCE_PATH_FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define __SOURCE_PATH_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        (void) fprintf((fd), __VA_ARGS__);                                               \
  |  |  |  |   81|      0|        (void) fprintf((fd), "\n");                                                      \
  |  |  |  |   82|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1036|  3.45k|        return RNP_ERROR_BAD_FORMAT;
 1037|  3.45k|    }
 1038|       |
 1039|       |    /* reading unhashed subpackets */
 1040|   596k|    if (!get_subpkt_len(pkt, splen)) {
  ------------------
  |  Branch (1040:9): [True: 0, False: 596k]
  ------------------
 1041|      0|        RNP_LOG("cannot get unhashed len");
  ------------------
  |  |   84|      0|#define RNP_LOG(...) RNP_LOG_FD(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   76|      0|    do {                                                                                 \
  |  |  |  |   77|      0|        if (!rnp_log_switch())                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   78|      0|            break;                                                                       \
  |  |  |  |   79|      0|        (void) fprintf((fd), "[%s() %s:%d] ", __func__, __SOURCE_PATH_FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define __SOURCE_PATH_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        (void) fprintf((fd), __VA_ARGS__);                                               \
  |  |  |  |   81|      0|        (void) fprintf((fd), "\n");                                                      \
  |  |  |  |   82|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1042|      0|        return RNP_ERROR_BAD_FORMAT;
 1043|      0|    }
 1044|   596k|    if (pkt.left() < splen) {
  ------------------
  |  Branch (1044:9): [True: 949, False: 595k]
  ------------------
 1045|    949|        RNP_LOG("not enough data for unhashed subpackets");
  ------------------
  |  |   84|    949|#define RNP_LOG(...) RNP_LOG_FD(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   76|    949|    do {                                                                                 \
  |  |  |  |   77|    949|        if (!rnp_log_switch())                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:13): [True: 949, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   78|    949|            break;                                                                       \
  |  |  |  |   79|    949|        (void) fprintf((fd), "[%s() %s:%d] ", __func__, __SOURCE_PATH_FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define __SOURCE_PATH_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        (void) fprintf((fd), __VA_ARGS__);                                               \
  |  |  |  |   81|      0|        (void) fprintf((fd), "\n");                                                      \
  |  |  |  |   82|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1046|    949|        return RNP_ERROR_BAD_FORMAT;
 1047|    949|    }
 1048|   595k|    if (!parse_subpackets(pkt.cur(), splen, false, depth)) {
  ------------------
  |  Branch (1048:9): [True: 1.29k, False: 593k]
  ------------------
 1049|  1.29k|        RNP_LOG("failed to parse unhashed subpackets");
  ------------------
  |  |   84|  1.29k|#define RNP_LOG(...) RNP_LOG_FD(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   76|  1.29k|    do {                                                                                 \
  |  |  |  |   77|  1.29k|        if (!rnp_log_switch())                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:13): [True: 1.29k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   78|  1.29k|            break;                                                                       \
  |  |  |  |   79|  1.29k|        (void) fprintf((fd), "[%s() %s:%d] ", __func__, __SOURCE_PATH_FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define __SOURCE_PATH_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        (void) fprintf((fd), __VA_ARGS__);                                               \
  |  |  |  |   81|      0|        (void) fprintf((fd), "\n");                                                      \
  |  |  |  |   82|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1050|  1.29k|        return RNP_ERROR_BAD_FORMAT;
 1051|  1.29k|    }
 1052|   593k|    pkt.skip(splen);
 1053|   593k|    return RNP_SUCCESS;
 1054|   595k|}
_ZN3pgp3pkt9Signature5parseER17pgp_packet_body_tm:
 1058|   605k|{
 1059|   605k|    uint8_t ver = 0;
 1060|   605k|    if (!pkt.get(ver)) {
  ------------------
  |  Branch (1060:9): [True: 80, False: 605k]
  ------------------
 1061|     80|        return RNP_ERROR_BAD_FORMAT;
 1062|     80|    }
 1063|   605k|    version = (pgp_version_t) ver;
 1064|       |
 1065|       |    /* v3 or v4 or v6 signature body */
 1066|   605k|    rnp_result_t res;
 1067|   605k|    switch (ver) {
 1068|  2.32k|    case PGP_V2:
  ------------------
  |  Branch (1068:5): [True: 2.32k, False: 603k]
  ------------------
 1069|  2.32k|        FALLTHROUGH_STATEMENT;
  ------------------
  |  |  109|  2.32k|# define FALLTHROUGH_STATEMENT [[fallthrough]]
  ------------------
 1070|  2.78k|    case PGP_V3:
  ------------------
  |  Branch (1070:5): [True: 456, False: 604k]
  ------------------
 1071|  2.78k|        res = parse_v2v3(pkt);
 1072|  2.78k|        break;
 1073|   587k|    case PGP_V4:
  ------------------
  |  Branch (1073:5): [True: 587k, False: 17.4k]
  ------------------
 1074|   587k|        FALLTHROUGH_STATEMENT;
  ------------------
  |  |  109|   587k|# define FALLTHROUGH_STATEMENT [[fallthrough]]
  ------------------
 1075|   597k|    case PGP_V5:
  ------------------
  |  Branch (1075:5): [True: 9.99k, False: 595k]
  ------------------
 1076|   597k|#if defined(ENABLE_CRYPTO_REFRESH)
 1077|   597k|        FALLTHROUGH_STATEMENT;
  ------------------
  |  |  109|   597k|# define FALLTHROUGH_STATEMENT [[fallthrough]]
  ------------------
 1078|   600k|    case PGP_V6:
  ------------------
  |  Branch (1078:5): [True: 2.89k, False: 602k]
  ------------------
 1079|   600k|#endif
 1080|   600k|        res = parse_v4up(pkt, depth);
 1081|   600k|        break;
 1082|  1.74k|    default:
  ------------------
  |  Branch (1082:5): [True: 1.74k, False: 603k]
  ------------------
 1083|  1.74k|        RNP_LOG("unknown signature version: %d", (int) ver);
  ------------------
  |  |   84|  1.74k|#define RNP_LOG(...) RNP_LOG_FD(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   76|  1.74k|    do {                                                                                 \
  |  |  |  |   77|  1.74k|        if (!rnp_log_switch())                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:13): [True: 1.74k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   78|  1.74k|            break;                                                                       \
  |  |  |  |   79|  1.74k|        (void) fprintf((fd), "[%s() %s:%d] ", __func__, __SOURCE_PATH_FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define __SOURCE_PATH_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        (void) fprintf((fd), __VA_ARGS__);                                               \
  |  |  |  |   81|      0|        (void) fprintf((fd), "\n");                                                      \
  |  |  |  |   82|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1084|  1.74k|        res = RNP_ERROR_BAD_FORMAT;
 1085|   605k|    }
 1086|       |
 1087|   605k|    if (res) {
  ------------------
  |  Branch (1087:9): [True: 9.38k, False: 596k]
  ------------------
 1088|  9.38k|        return res;
 1089|  9.38k|    }
 1090|       |
 1091|       |    /* left 16 bits of the hash */
 1092|   596k|    if (!pkt.get(lbits.data(), 2)) {
  ------------------
  |  Branch (1092:9): [True: 445, False: 595k]
  ------------------
 1093|    445|        RNP_LOG("not enough data for hash left bits");
  ------------------
  |  |   84|    445|#define RNP_LOG(...) RNP_LOG_FD(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   76|    445|    do {                                                                                 \
  |  |  |  |   77|    445|        if (!rnp_log_switch())                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:13): [True: 445, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   78|    445|            break;                                                                       \
  |  |  |  |   79|    445|        (void) fprintf((fd), "[%s() %s:%d] ", __func__, __SOURCE_PATH_FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define __SOURCE_PATH_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        (void) fprintf((fd), __VA_ARGS__);                                               \
  |  |  |  |   81|      0|        (void) fprintf((fd), "\n");                                                      \
  |  |  |  |   82|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1094|    445|        return RNP_ERROR_BAD_FORMAT;
 1095|    445|    }
 1096|       |
 1097|   595k|#if defined(ENABLE_CRYPTO_REFRESH)
 1098|   595k|    if (ver == PGP_V6) {
  ------------------
  |  Branch (1098:9): [True: 1.78k, False: 593k]
  ------------------
 1099|  1.78k|        uint8_t salt_size = 0;
 1100|  1.78k|        if (!pkt.get(salt_size)) {
  ------------------
  |  Branch (1100:13): [True: 656, False: 1.12k]
  ------------------
 1101|    656|            RNP_LOG("not enough data for v6 salt size octet");
  ------------------
  |  |   84|    656|#define RNP_LOG(...) RNP_LOG_FD(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   76|    656|    do {                                                                                 \
  |  |  |  |   77|    656|        if (!rnp_log_switch())                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:13): [True: 656, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   78|    656|            break;                                                                       \
  |  |  |  |   79|    656|        (void) fprintf((fd), "[%s() %s:%d] ", __func__, __SOURCE_PATH_FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define __SOURCE_PATH_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        (void) fprintf((fd), __VA_ARGS__);                                               \
  |  |  |  |   81|      0|        (void) fprintf((fd), "\n");                                                      \
  |  |  |  |   82|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1102|    656|            return RNP_ERROR_BAD_FORMAT;
 1103|    656|        }
 1104|  1.12k|        size_t expect_salt_size;
 1105|  1.12k|        if (!pgp::pkt::Signature::v6_salt_size(halg, &expect_salt_size)) {
  ------------------
  |  Branch (1105:13): [True: 344, False: 783]
  ------------------
 1106|    344|            RNP_LOG("invalid halg");
  ------------------
  |  |   84|    344|#define RNP_LOG(...) RNP_LOG_FD(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   76|    344|    do {                                                                                 \
  |  |  |  |   77|    344|        if (!rnp_log_switch())                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:13): [True: 344, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   78|    344|            break;                                                                       \
  |  |  |  |   79|    344|        (void) fprintf((fd), "[%s() %s:%d] ", __func__, __SOURCE_PATH_FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define __SOURCE_PATH_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        (void) fprintf((fd), __VA_ARGS__);                                               \
  |  |  |  |   81|      0|        (void) fprintf((fd), "\n");                                                      \
  |  |  |  |   82|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1107|    344|            return RNP_ERROR_BAD_FORMAT;
 1108|    344|        }
 1109|    783|        if (salt_size != expect_salt_size) {
  ------------------
  |  Branch (1109:13): [True: 296, False: 487]
  ------------------
 1110|    296|            RNP_LOG("invalid salt size");
  ------------------
  |  |   84|    296|#define RNP_LOG(...) RNP_LOG_FD(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   76|    296|    do {                                                                                 \
  |  |  |  |   77|    296|        if (!rnp_log_switch())                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:13): [True: 296, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   78|    296|            break;                                                                       \
  |  |  |  |   79|    296|        (void) fprintf((fd), "[%s() %s:%d] ", __func__, __SOURCE_PATH_FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define __SOURCE_PATH_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        (void) fprintf((fd), __VA_ARGS__);                                               \
  |  |  |  |   81|      0|        (void) fprintf((fd), "\n");                                                      \
  |  |  |  |   82|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1111|    296|            return RNP_ERROR_BAD_FORMAT;
 1112|    296|        }
 1113|    487|        salt.resize(salt_size);
 1114|    487|        if (!pkt.get(salt.data(), salt_size)) {
  ------------------
  |  Branch (1114:13): [True: 93, False: 394]
  ------------------
 1115|     93|            RNP_LOG("not enough data for v6 signature salt");
  ------------------
  |  |   84|     93|#define RNP_LOG(...) RNP_LOG_FD(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   76|     93|    do {                                                                                 \
  |  |  |  |   77|     93|        if (!rnp_log_switch())                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:13): [True: 93, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   78|     93|            break;                                                                       \
  |  |  |  |   79|     93|        (void) fprintf((fd), "[%s() %s:%d] ", __func__, __SOURCE_PATH_FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define __SOURCE_PATH_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        (void) fprintf((fd), __VA_ARGS__);                                               \
  |  |  |  |   81|      0|        (void) fprintf((fd), "\n");                                                      \
  |  |  |  |   82|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1116|     93|            return RNP_ERROR_BAD_FORMAT;
 1117|     93|        }
 1118|    487|    }
 1119|   594k|#endif
 1120|       |
 1121|       |    /* raw signature material */
 1122|       |    /* we cannot fail here */
 1123|   594k|    pkt.get(material_buf, pkt.left());
 1124|       |    /* check whether it can be parsed */
 1125|   594k|    if (!parse_material()) {
  ------------------
  |  Branch (1125:9): [True: 5.33k, False: 588k]
  ------------------
 1126|  5.33k|        return RNP_ERROR_BAD_FORMAT;
 1127|  5.33k|    }
 1128|   588k|    return RNP_SUCCESS;
 1129|   594k|}
_ZN3pgp3pkt9Signature5parseER12pgp_source_t:
 1133|   590k|{
 1134|   590k|    pgp_packet_body_t pkt(PGP_PKT_SIGNATURE);
 1135|   590k|    rnp_result_t      res = pkt.read(src);
 1136|   590k|    if (res) {
  ------------------
  |  Branch (1136:9): [True: 734, False: 590k]
  ------------------
 1137|    734|        return res;
 1138|    734|    }
 1139|   590k|    return parse(pkt);
 1140|   590k|}
_ZNK3pgp3pkt9Signature14parse_materialEv:
 1144|   594k|{
 1145|   594k|    auto sig = SigMaterial::create(palg, halg);
 1146|   594k|    if (!sig) {
  ------------------
  |  Branch (1146:9): [True: 1.56k, False: 592k]
  ------------------
 1147|  1.56k|        return nullptr;
 1148|  1.56k|    }
 1149|   592k|    pgp_packet_body_t pkt(material_buf);
 1150|   592k|    if (!sig->parse(pkt)) {
  ------------------
  |  Branch (1150:9): [True: 3.50k, False: 589k]
  ------------------
 1151|  3.50k|        return nullptr;
 1152|  3.50k|    }
 1153|   589k|    if (pkt.left()) {
  ------------------
  |  Branch (1153:9): [True: 273, False: 588k]
  ------------------
 1154|    273|        RNP_LOG("extra %zu bytes in pk packet", pkt.left());
  ------------------
  |  |   84|    273|#define RNP_LOG(...) RNP_LOG_FD(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   76|    273|    do {                                                                                 \
  |  |  |  |   77|    273|        if (!rnp_log_switch())                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:13): [True: 273, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   78|    273|            break;                                                                       \
  |  |  |  |   79|    273|        (void) fprintf((fd), "[%s() %s:%d] ", __func__, __SOURCE_PATH_FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define __SOURCE_PATH_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        (void) fprintf((fd), __VA_ARGS__);                                               \
  |  |  |  |   81|      0|        (void) fprintf((fd), "\n");                                                      \
  |  |  |  |   82|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1155|    273|        return nullptr;
 1156|    273|    }
 1157|   588k|    return sig;
 1158|   589k|}
_ZN3pgp3pkt9Signature12v6_salt_sizeE14pgp_hash_alg_tPm:
 1236|  1.12k|{
 1237|  1.12k|    switch (halg) {
 1238|     68|    case PGP_HASH_SHA256:
  ------------------
  |  Branch (1238:5): [True: 68, False: 1.05k]
  ------------------
 1239|     68|        *salt_size = 16;
 1240|     68|        break;
 1241|     40|    case PGP_HASH_SHA224:
  ------------------
  |  Branch (1241:5): [True: 40, False: 1.08k]
  ------------------
 1242|     40|        *salt_size = 16;
 1243|     40|        break;
 1244|    108|    case PGP_HASH_SHA384:
  ------------------
  |  Branch (1244:5): [True: 108, False: 1.01k]
  ------------------
 1245|    108|        *salt_size = 24;
 1246|    108|        break;
 1247|    179|    case PGP_HASH_SHA512:
  ------------------
  |  Branch (1247:5): [True: 179, False: 948]
  ------------------
 1248|    179|        *salt_size = 32;
 1249|    179|        break;
 1250|    268|    case PGP_HASH_SHA3_256:
  ------------------
  |  Branch (1250:5): [True: 268, False: 859]
  ------------------
 1251|    268|        *salt_size = 16;
 1252|    268|        break;
 1253|    120|    case PGP_HASH_SHA3_512:
  ------------------
  |  Branch (1253:5): [True: 120, False: 1.00k]
  ------------------
 1254|    120|        *salt_size = 32;
 1255|    120|        break;
 1256|    344|    default:
  ------------------
  |  Branch (1256:5): [True: 344, False: 783]
  ------------------
 1257|    344|        RNP_LOG("no V6 salt size for algorithm");
  ------------------
  |  |   84|    344|#define RNP_LOG(...) RNP_LOG_FD(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |   76|    344|    do {                                                                                 \
  |  |  |  |   77|    344|        if (!rnp_log_switch())                                                           \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:13): [True: 344, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   78|    344|            break;                                                                       \
  |  |  |  |   79|    344|        (void) fprintf((fd), "[%s() %s:%d] ", __func__, __SOURCE_PATH_FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|#define __SOURCE_PATH_FILE__ (__FILE__)
  |  |  |  |  ------------------
  |  |  |  |   80|      0|        (void) fprintf((fd), __VA_ARGS__);                                               \
  |  |  |  |   81|      0|        (void) fprintf((fd), "\n");                                                      \
  |  |  |  |   82|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1258|    344|        return false;
 1259|  1.12k|    }
 1260|    783|    return true;
 1261|  1.12k|}

_ZN3pgp3pkt9SignatureC2Ev:
   80|   606k|        : type_(PGP_SIG_BINARY), version(PGP_VUNKNOWN), palg(PGP_PKA_NOTHING),
   81|   606k|          halg(PGP_HASH_UNKNOWN), creation_time(0){};
_ZNK3pgp3pkt9Signature4typeEv:
   88|   174k|    {
   89|   174k|        return type_;
   90|   174k|    };

