_ZN5Botan17ct_expand_top_bitITkNSt3__117unsigned_integralEmEET_S2_:
   28|  16.9k|BOTAN_FORCE_INLINE constexpr T ct_expand_top_bit(T a) {
   29|  16.9k|   const T top = CT::value_barrier<T>(a >> (sizeof(T) * 8 - 1));
   30|  16.9k|   return static_cast<T>(0) - top;
   31|  16.9k|}
_ZN5Botan10ct_is_zeroITkNSt3__117unsigned_integralEmEET_S2_:
   37|  16.9k|BOTAN_FORCE_INLINE constexpr T ct_is_zero(T x) {
   38|  16.9k|   return ct_expand_top_bit<T>(~x & (x - 1));
   39|  16.9k|}
_ZN5Botan8high_bitITkNSt3__117unsigned_integralEmEEmT_:
   73|    174|BOTAN_FORCE_INLINE constexpr size_t high_bit(T n) {
   74|    174|   size_t hb = 0;
   75|       |
   76|  1.21k|   for(size_t s = 8 * sizeof(T) / 2; s > 0; s /= 2) {
  ------------------
  |  Branch (76:38): [True: 1.04k, False: 174]
  ------------------
   77|       |      // Equivalent to: ((n >> s) == 0) ? 0 : s;
   78|  1.04k|      const size_t z = s - ct_if_is_zero_ret<T>(n >> s, s);
   79|  1.04k|      hb += z;
   80|  1.04k|      n >>= z;
   81|  1.04k|   }
   82|       |
   83|    174|   hb += n;
   84|       |
   85|    174|   return hb;
   86|    174|}
_ZN5Botan17ct_if_is_zero_retITkNSt3__117unsigned_integralEmEEmT_m:
   45|  1.04k|BOTAN_FORCE_INLINE constexpr size_t ct_if_is_zero_ret(T x, size_t s) {
   46|       |   /*
   47|       |   Similar to `return ct_is_zero(x) & s` but has to account for possibility that
   48|       |   sizeof(T) is smaller than sizeof(size_t) which would lead to incomplete masking
   49|       |   */
   50|  1.04k|   const T a = ~x & (x - 1);
   51|  1.04k|   const size_t a_top = static_cast<size_t>(CT::value_barrier<T>(a >> (sizeof(T) * 8 - 1)));
   52|  1.04k|   const size_t mask = static_cast<size_t>(0) - a_top;
   53|  1.04k|   return mask & s;
   54|  1.04k|}

_ZN5Botan13reverse_bytesITkNSt3__117unsigned_integralEmQooooooeqstT_Li1EeqstS2_Li2EeqstS2_Li4EeqstS2_Li8EEES2_S2_:
   27|  8.65k|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|  8.65k|   } else if constexpr(sizeof(T) == 8) {
   45|  8.65k|#if BOTAN_COMPILER_HAS_BUILTIN(__builtin_bswap64)
   46|  8.65k|      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|  8.65k|   }
   57|  8.65k|}
_ZN5Botan13reverse_bytesITkNSt3__117unsigned_integralEtQooooooeqstT_Li1EeqstS2_Li2EeqstS2_Li4EeqstS2_Li8EEES2_S2_:
   27|     91|inline constexpr T reverse_bytes(T x) {
   28|       |   if constexpr(sizeof(T) == 1) {
   29|       |      return x;
   30|     91|   } else if constexpr(sizeof(T) == 2) {
   31|     91|#if BOTAN_COMPILER_HAS_BUILTIN(__builtin_bswap16)
   32|     91|      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|       |   } else if constexpr(sizeof(T) == 8) {
   45|       |#if BOTAN_COMPILER_HAS_BUILTIN(__builtin_bswap64)
   46|       |      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|       |   }
   57|     91|}
_ZN5Botan13reverse_bytesITkNSt3__117unsigned_integralEjQooooooeqstT_Li1EeqstS2_Li2EeqstS2_Li4EeqstS2_Li8EEES2_S2_:
   27|     80|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|     80|   } else if constexpr(sizeof(T) == 4) {
   37|     80|#if BOTAN_COMPILER_HAS_BUILTIN(__builtin_bswap32)
   38|     80|      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|       |   } else if constexpr(sizeof(T) == 8) {
   45|       |#if BOTAN_COMPILER_HAS_BUILTIN(__builtin_bswap64)
   46|       |      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|       |   }
   57|     80|}

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

_ZN5Botan2CT8unpoisonITkNSt3__18integralEmEEvRKT_:
  112|  1.42k|constexpr void unpoison(const T& p) {
  113|  1.42k|   unpoison(&p, 1);
  114|  1.42k|}
_ZN5Botan2CT8unpoisonImEEvPKT_m:
   67|  2.77k|constexpr inline void unpoison(const T* p, size_t n) {
   68|       |#if defined(BOTAN_HAS_VALGRIND)
   69|       |   if(!std::is_constant_evaluated()) {
   70|       |      VALGRIND_MAKE_MEM_DEFINED(p, n * sizeof(T));
   71|       |   }
   72|       |#endif
   73|       |
   74|  2.77k|   BOTAN_UNUSED(p, n);
  ------------------
  |  |  144|  2.77k|#define BOTAN_UNUSED Botan::ignore_params
  ------------------
   75|  2.77k|}

_ZN5Botan3fmtIJPKcS2_S2_EEENSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEENS3_17basic_string_viewIcS6_EEDpRKT_:
   53|     23|std::string fmt(std::string_view format, const T&... args) {
   54|     23|   std::ostringstream oss;
   55|     23|   oss.imbue(std::locale::classic());
   56|     23|   fmt_detail::do_fmt(oss, format, args...);
   57|     23|   return oss.str();
   58|     23|}
_ZN5Botan10fmt_detail6do_fmtIPKcJS3_S3_EEEvRNSt3__119basic_ostringstreamIcNS4_11char_traitsIcEENS4_9allocatorIcEEEENS4_17basic_string_viewIcS7_EERKT_DpRKT0_:
   25|     23|void do_fmt(std::ostringstream& oss, std::string_view format, const T& val, const Ts&... rest) {
   26|     23|   size_t i = 0;
   27|       |
   28|     23|   while(i < format.size()) {
  ------------------
  |  Branch (28:10): [True: 23, False: 0]
  ------------------
   29|     23|      if(format[i] == '{' && (format.size() > (i + 1)) && format.at(i + 1) == '}') {
  ------------------
  |  Branch (29:10): [True: 23, False: 0]
  |  Branch (29:30): [True: 23, False: 0]
  |  Branch (29:59): [True: 23, False: 0]
  ------------------
   30|     23|         oss << val;
   31|     23|         return do_fmt(oss, format.substr(i + 2), rest...);
   32|     23|      } else {
   33|      0|         oss << format[i];
   34|      0|      }
   35|       |
   36|      0|      i += 1;
   37|      0|   }
   38|     23|}
_ZN5Botan10fmt_detail6do_fmtIPKcJS3_EEEvRNSt3__119basic_ostringstreamIcNS4_11char_traitsIcEENS4_9allocatorIcEEEENS4_17basic_string_viewIcS7_EERKT_DpRKT0_:
   25|     23|void do_fmt(std::ostringstream& oss, std::string_view format, const T& val, const Ts&... rest) {
   26|     23|   size_t i = 0;
   27|       |
   28|    115|   while(i < format.size()) {
  ------------------
  |  Branch (28:10): [True: 115, False: 0]
  ------------------
   29|    115|      if(format[i] == '{' && (format.size() > (i + 1)) && format.at(i + 1) == '}') {
  ------------------
  |  Branch (29:10): [True: 23, False: 92]
  |  Branch (29:30): [True: 23, False: 0]
  |  Branch (29:59): [True: 23, False: 0]
  ------------------
   30|     23|         oss << val;
   31|     23|         return do_fmt(oss, format.substr(i + 2), rest...);
   32|     92|      } else {
   33|     92|         oss << format[i];
   34|     92|      }
   35|       |
   36|     92|      i += 1;
   37|     92|   }
   38|     23|}
_ZN5Botan10fmt_detail6do_fmtIPKcJEEEvRNSt3__119basic_ostringstreamIcNS4_11char_traitsIcEENS4_9allocatorIcEEEENS4_17basic_string_viewIcS7_EERKT_DpRKT0_:
   25|    130|void do_fmt(std::ostringstream& oss, std::string_view format, const T& val, const Ts&... rest) {
   26|    130|   size_t i = 0;
   27|       |
   28|  3.14k|   while(i < format.size()) {
  ------------------
  |  Branch (28:10): [True: 3.14k, False: 0]
  ------------------
   29|  3.14k|      if(format[i] == '{' && (format.size() > (i + 1)) && format.at(i + 1) == '}') {
  ------------------
  |  Branch (29:10): [True: 130, False: 3.01k]
  |  Branch (29:30): [True: 130, False: 0]
  |  Branch (29:59): [True: 130, False: 0]
  ------------------
   30|    130|         oss << val;
   31|    130|         return do_fmt(oss, format.substr(i + 2), rest...);
   32|  3.01k|      } else {
   33|  3.01k|         oss << format[i];
   34|  3.01k|      }
   35|       |
   36|  3.01k|      i += 1;
   37|  3.01k|   }
   38|    130|}
_ZN5Botan10fmt_detail6do_fmtERNSt3__119basic_ostringstreamIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS1_17basic_string_viewIcS4_EE:
   20|  1.38k|inline void do_fmt(std::ostringstream& oss, std::string_view format) {
   21|  1.38k|   oss << format;
   22|  1.38k|}
_ZN5Botan10fmt_detail6do_fmtINSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEJEEEvRNS2_19basic_ostringstreamIcS5_NS2_9allocatorIcEEEES6_RKT_DpRKT0_:
   25|    914|void do_fmt(std::ostringstream& oss, std::string_view format, const T& val, const Ts&... rest) {
   26|    914|   size_t i = 0;
   27|       |
   28|  6.31k|   while(i < format.size()) {
  ------------------
  |  Branch (28:10): [True: 6.31k, False: 0]
  ------------------
   29|  6.31k|      if(format[i] == '{' && (format.size() > (i + 1)) && format.at(i + 1) == '}') {
  ------------------
  |  Branch (29:10): [True: 914, False: 5.40k]
  |  Branch (29:30): [True: 914, False: 0]
  |  Branch (29:59): [True: 914, False: 0]
  ------------------
   30|    914|         oss << val;
   31|    914|         return do_fmt(oss, format.substr(i + 2), rest...);
   32|  5.40k|      } else {
   33|  5.40k|         oss << format[i];
   34|  5.40k|      }
   35|       |
   36|  5.40k|      i += 1;
   37|  5.40k|   }
   38|    914|}
_ZN5Botan3fmtIJNSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEEEENS1_12basic_stringIcS4_NS1_9allocatorIcEEEES5_DpRKT_:
   53|    914|std::string fmt(std::string_view format, const T&... args) {
   54|    914|   std::ostringstream oss;
   55|    914|   oss.imbue(std::locale::classic());
   56|    914|   fmt_detail::do_fmt(oss, format, args...);
   57|    914|   return oss.str();
   58|    914|}
_ZN5Botan10fmt_detail6do_fmtIjJEEEvRNSt3__119basic_ostringstreamIcNS2_11char_traitsIcEENS2_9allocatorIcEEEENS2_17basic_string_viewIcS5_EERKT_DpRKT0_:
   25|    282|void do_fmt(std::ostringstream& oss, std::string_view format, const T& val, const Ts&... rest) {
   26|    282|   size_t i = 0;
   27|       |
   28|    599|   while(i < format.size()) {
  ------------------
  |  Branch (28:10): [True: 599, False: 0]
  ------------------
   29|    599|      if(format[i] == '{' && (format.size() > (i + 1)) && format.at(i + 1) == '}') {
  ------------------
  |  Branch (29:10): [True: 282, False: 317]
  |  Branch (29:30): [True: 282, False: 0]
  |  Branch (29:59): [True: 282, False: 0]
  ------------------
   30|    282|         oss << val;
   31|    282|         return do_fmt(oss, format.substr(i + 2), rest...);
   32|    317|      } else {
   33|    317|         oss << format[i];
   34|    317|      }
   35|       |
   36|    317|      i += 1;
   37|    317|   }
   38|    282|}
_ZN5Botan3fmtIJNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEEEES7_NS1_17basic_string_viewIcS4_EEDpRKT_:
   53|     59|std::string fmt(std::string_view format, const T&... args) {
   54|     59|   std::ostringstream oss;
   55|     59|   oss.imbue(std::locale::classic());
   56|     59|   fmt_detail::do_fmt(oss, format, args...);
   57|     59|   return oss.str();
   58|     59|}
_ZN5Botan10fmt_detail6do_fmtINSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEJEEEvRNS2_19basic_ostringstreamIcS5_S7_EENS2_17basic_string_viewIcS5_EERKT_DpRKT0_:
   25|     59|void do_fmt(std::ostringstream& oss, std::string_view format, const T& val, const Ts&... rest) {
   26|     59|   size_t i = 0;
   27|       |
   28|  1.29k|   while(i < format.size()) {
  ------------------
  |  Branch (28:10): [True: 1.29k, False: 0]
  ------------------
   29|  1.29k|      if(format[i] == '{' && (format.size() > (i + 1)) && format.at(i + 1) == '}') {
  ------------------
  |  Branch (29:10): [True: 59, False: 1.23k]
  |  Branch (29:30): [True: 59, False: 0]
  |  Branch (29:59): [True: 59, False: 0]
  ------------------
   30|     59|         oss << val;
   31|     59|         return do_fmt(oss, format.substr(i + 2), rest...);
   32|  1.23k|      } else {
   33|  1.23k|         oss << format[i];
   34|  1.23k|      }
   35|       |
   36|  1.23k|      i += 1;
   37|  1.23k|   }
   38|     59|}
_ZN5Botan3fmtIJNSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEjEEENS1_12basic_stringIcS4_NS1_9allocatorIcEEEES5_DpRKT_:
   53|     35|std::string fmt(std::string_view format, const T&... args) {
   54|     35|   std::ostringstream oss;
   55|     35|   oss.imbue(std::locale::classic());
   56|     35|   fmt_detail::do_fmt(oss, format, args...);
   57|     35|   return oss.str();
   58|     35|}
_ZN5Botan10fmt_detail6do_fmtINSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEJjEEEvRNS2_19basic_ostringstreamIcS5_NS2_9allocatorIcEEEES6_RKT_DpRKT0_:
   25|     35|void do_fmt(std::ostringstream& oss, std::string_view format, const T& val, const Ts&... rest) {
   26|     35|   size_t i = 0;
   27|       |
   28|     35|   while(i < format.size()) {
  ------------------
  |  Branch (28:10): [True: 35, False: 0]
  ------------------
   29|     35|      if(format[i] == '{' && (format.size() > (i + 1)) && format.at(i + 1) == '}') {
  ------------------
  |  Branch (29:10): [True: 35, False: 0]
  |  Branch (29:30): [True: 35, False: 0]
  |  Branch (29:59): [True: 35, False: 0]
  ------------------
   30|     35|         oss << val;
   31|     35|         return do_fmt(oss, format.substr(i + 2), rest...);
   32|     35|      } else {
   33|      0|         oss << format[i];
   34|      0|      }
   35|       |
   36|      0|      i += 1;
   37|      0|   }
   38|     35|}
_ZN5Botan3fmtIJjjEEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS1_17basic_string_viewIcS4_EEDpRKT_:
   53|    247|std::string fmt(std::string_view format, const T&... args) {
   54|    247|   std::ostringstream oss;
   55|    247|   oss.imbue(std::locale::classic());
   56|    247|   fmt_detail::do_fmt(oss, format, args...);
   57|    247|   return oss.str();
   58|    247|}
_ZN5Botan10fmt_detail6do_fmtIjJjEEEvRNSt3__119basic_ostringstreamIcNS2_11char_traitsIcEENS2_9allocatorIcEEEENS2_17basic_string_viewIcS5_EERKT_DpRKT0_:
   25|    247|void do_fmt(std::ostringstream& oss, std::string_view format, const T& val, const Ts&... rest) {
   26|    247|   size_t i = 0;
   27|       |
   28|  7.13k|   while(i < format.size()) {
  ------------------
  |  Branch (28:10): [True: 7.13k, False: 0]
  ------------------
   29|  7.13k|      if(format[i] == '{' && (format.size() > (i + 1)) && format.at(i + 1) == '}') {
  ------------------
  |  Branch (29:10): [True: 247, False: 6.88k]
  |  Branch (29:30): [True: 247, False: 0]
  |  Branch (29:59): [True: 247, False: 0]
  ------------------
   30|    247|         oss << val;
   31|    247|         return do_fmt(oss, format.substr(i + 2), rest...);
   32|  6.88k|      } else {
   33|  6.88k|         oss << format[i];
   34|  6.88k|      }
   35|       |
   36|  6.88k|      i += 1;
   37|  6.88k|   }
   38|    247|}
_ZN5Botan3fmtIJPKcEEENSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEENS3_17basic_string_viewIcS6_EEDpRKT_:
   53|    107|std::string fmt(std::string_view format, const T&... args) {
   54|    107|   std::ostringstream oss;
   55|    107|   oss.imbue(std::locale::classic());
   56|    107|   fmt_detail::do_fmt(oss, format, args...);
   57|    107|   return oss.str();
   58|    107|}

_ZN5Botan11checked_mulITkNSt3__117unsigned_integralEmEENS1_8optionalIT_EES3_S3_:
   46|  4.98k|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|  4.98k|   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|  4.98k|   if(a != 0 && r / a != b) {
  ------------------
  |  Branch (53:7): [True: 4.98k, False: 0]
  |  Branch (53:17): [True: 0, False: 4.98k]
  ------------------
   54|      0|      return {};
   55|      0|   }
   56|  4.98k|   return r;
   57|  4.98k|}

_ZN5Botan12get_byte_varImEEhmT_:
   69|  4.20k|inline constexpr uint8_t get_byte_var(size_t byte_num, T input) {
   70|  4.20k|   return static_cast<uint8_t>(input >> (((~byte_num) & (sizeof(T) - 1)) << 3));
   71|  4.20k|}
_ZN5Botan7load_beImJNSt3__14spanIKhLm8EEEEEEDaDpOT0_:
  504|  7.41k|inline constexpr auto load_be(ParamTs&&... params) {
  505|  7.41k|   return detail::load_any<std::endian::big, OutT>(std::forward<ParamTs>(params)...);
  506|  7.41k|}
_ZN5Botan6detail8load_anyILNSt3__16endianE64206ETkNS0_20unsigned_integralishEmTkNS_6ranges16contiguous_rangeIhEENS2_4spanIKhLm8EEEQnt15custom_loadableINS0_19wrapped_type_helperIu14__remove_cvrefIT0_EE4typeEEEESA_OT1_:
  278|  7.41k|inline constexpr WrappedOutT load_any(InR&& in_range) {
  279|  7.41k|   using OutT = detail::wrapped_type<WrappedOutT>;
  280|  7.41k|   ranges::assert_exact_byte_length<sizeof(OutT)>(in_range);
  281|       |
  282|  7.41k|   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|  7.41k|      if(std::is_constant_evaluated()) /* TODO: C++23: if consteval {} */ {
  287|  7.41k|         return fallback_load_any<endianness, OutT>(std::forward<InR>(in_range));
  288|  7.41k|      } else {
  289|  7.41k|         const std::span in{in_range};
  290|  7.41k|         if constexpr(sizeof(OutT) == 1) {
  291|  7.41k|            return static_cast<OutT>(in[0]);
  292|  7.41k|         } else if constexpr(endianness == std::endian::native) {
  293|  7.41k|            return typecast_copy<OutT>(in);
  294|  7.41k|         } else {
  295|  7.41k|            static_assert(opposite(endianness) == std::endian::native);
  296|  7.41k|            return reverse_bytes(typecast_copy<OutT>(in));
  297|  7.41k|         }
  298|  7.41k|      }
  299|  7.41k|   }());
  300|  7.41k|}
_ZN5Botan6detail24wrap_strong_type_or_enumITkNS0_20unsigned_integralishEmTkNSt3__117unsigned_integralEmEEDaT0_:
  200|  8.65k|constexpr auto wrap_strong_type_or_enum(T t) {
  201|       |   if constexpr(std::is_enum_v<OutT>) {
  202|       |      return static_cast<OutT>(t);
  203|  8.65k|   } else {
  204|  8.65k|      return Botan::wrap_strong_type<OutT>(t);
  205|  8.65k|   }
  206|  8.65k|}
_ZZN5Botan6detail8load_anyILNSt3__16endianE64206ETkNS0_20unsigned_integralishEmTkNS_6ranges16contiguous_rangeIhEENS2_4spanIKhLm8EEEQnt15custom_loadableINS0_19wrapped_type_helperIu14__remove_cvrefIT0_EE4typeEEEESA_OT1_ENKUlvE_clEv:
  282|  7.41k|   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|  7.41k|      if(std::is_constant_evaluated()) /* TODO: C++23: if consteval {} */ {
  ------------------
  |  Branch (286:10): [Folded, False: 7.41k]
  ------------------
  287|      0|         return fallback_load_any<endianness, OutT>(std::forward<InR>(in_range));
  288|  7.41k|      } else {
  289|  7.41k|         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|  7.41k|         } else {
  295|  7.41k|            static_assert(opposite(endianness) == std::endian::native);
  296|  7.41k|            return reverse_bytes(typecast_copy<OutT>(in));
  297|  7.41k|         }
  298|  7.41k|      }
  299|  7.41k|   }());
_ZN5Botan7load_beImJRNSt3__15arrayIhLm8EEEEEEDaDpOT0_:
  504|  1.23k|inline constexpr auto load_be(ParamTs&&... params) {
  505|  1.23k|   return detail::load_any<std::endian::big, OutT>(std::forward<ParamTs>(params)...);
  506|  1.23k|}
_ZN5Botan6detail8load_anyILNSt3__16endianE64206ETkNS0_20unsigned_integralishEmTkNS_6ranges16contiguous_rangeIhEERNS2_5arrayIhLm8EEEQnt15custom_loadableINS0_19wrapped_type_helperIu14__remove_cvrefIT0_EE4typeEEEESA_OT1_:
  278|  1.23k|inline constexpr WrappedOutT load_any(InR&& in_range) {
  279|  1.23k|   using OutT = detail::wrapped_type<WrappedOutT>;
  280|  1.23k|   ranges::assert_exact_byte_length<sizeof(OutT)>(in_range);
  281|       |
  282|  1.23k|   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|  1.23k|      if(std::is_constant_evaluated()) /* TODO: C++23: if consteval {} */ {
  287|  1.23k|         return fallback_load_any<endianness, OutT>(std::forward<InR>(in_range));
  288|  1.23k|      } else {
  289|  1.23k|         const std::span in{in_range};
  290|  1.23k|         if constexpr(sizeof(OutT) == 1) {
  291|  1.23k|            return static_cast<OutT>(in[0]);
  292|  1.23k|         } else if constexpr(endianness == std::endian::native) {
  293|  1.23k|            return typecast_copy<OutT>(in);
  294|  1.23k|         } else {
  295|  1.23k|            static_assert(opposite(endianness) == std::endian::native);
  296|  1.23k|            return reverse_bytes(typecast_copy<OutT>(in));
  297|  1.23k|         }
  298|  1.23k|      }
  299|  1.23k|   }());
  300|  1.23k|}
_ZZN5Botan6detail8load_anyILNSt3__16endianE64206ETkNS0_20unsigned_integralishEmTkNS_6ranges16contiguous_rangeIhEERNS2_5arrayIhLm8EEEQnt15custom_loadableINS0_19wrapped_type_helperIu14__remove_cvrefIT0_EE4typeEEEESA_OT1_ENKUlvE_clEv:
  282|  1.23k|   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|  1.23k|      if(std::is_constant_evaluated()) /* TODO: C++23: if consteval {} */ {
  ------------------
  |  Branch (286:10): [Folded, False: 1.23k]
  ------------------
  287|      0|         return fallback_load_any<endianness, OutT>(std::forward<InR>(in_range));
  288|  1.23k|      } else {
  289|  1.23k|         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|  1.23k|         } else {
  295|  1.23k|            static_assert(opposite(endianness) == std::endian::native);
  296|  1.23k|            return reverse_bytes(typecast_copy<OutT>(in));
  297|  1.23k|         }
  298|  1.23k|      }
  299|  1.23k|   }());
_ZN5Botan6detail24wrap_strong_type_or_enumITkNS0_20unsigned_integralishEjTkNSt3__117unsigned_integralEjEEDaT0_:
  200|     80|constexpr auto wrap_strong_type_or_enum(T t) {
  201|       |   if constexpr(std::is_enum_v<OutT>) {
  202|       |      return static_cast<OutT>(t);
  203|     80|   } else {
  204|     80|      return Botan::wrap_strong_type<OutT>(t);
  205|     80|   }
  206|     80|}
_ZN5Botan6detail8load_anyILNSt3__16endianE64206ETkNS0_20unsigned_integralishEjTkNS_6ranges16contiguous_rangeIhEENS2_4spanIKhLm4EEEQnt15custom_loadableINS0_19wrapped_type_helperIu14__remove_cvrefIT0_EE4typeEEEESA_OT1_:
  278|     80|inline constexpr WrappedOutT load_any(InR&& in_range) {
  279|     80|   using OutT = detail::wrapped_type<WrappedOutT>;
  280|     80|   ranges::assert_exact_byte_length<sizeof(OutT)>(in_range);
  281|       |
  282|     80|   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|     80|      if(std::is_constant_evaluated()) /* TODO: C++23: if consteval {} */ {
  287|     80|         return fallback_load_any<endianness, OutT>(std::forward<InR>(in_range));
  288|     80|      } else {
  289|     80|         const std::span in{in_range};
  290|     80|         if constexpr(sizeof(OutT) == 1) {
  291|     80|            return static_cast<OutT>(in[0]);
  292|     80|         } else if constexpr(endianness == std::endian::native) {
  293|     80|            return typecast_copy<OutT>(in);
  294|     80|         } else {
  295|     80|            static_assert(opposite(endianness) == std::endian::native);
  296|     80|            return reverse_bytes(typecast_copy<OutT>(in));
  297|     80|         }
  298|     80|      }
  299|     80|   }());
  300|     80|}
_ZZN5Botan6detail8load_anyILNSt3__16endianE64206ETkNS0_20unsigned_integralishEjTkNS_6ranges16contiguous_rangeIhEENS2_4spanIKhLm4EEEQnt15custom_loadableINS0_19wrapped_type_helperIu14__remove_cvrefIT0_EE4typeEEEESA_OT1_ENKUlvE_clEv:
  282|     80|   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|     80|      if(std::is_constant_evaluated()) /* TODO: C++23: if consteval {} */ {
  ------------------
  |  Branch (286:10): [Folded, False: 80]
  ------------------
  287|      0|         return fallback_load_any<endianness, OutT>(std::forward<InR>(in_range));
  288|     80|      } else {
  289|     80|         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|     80|         } else {
  295|     80|            static_assert(opposite(endianness) == std::endian::native);
  296|     80|            return reverse_bytes(typecast_copy<OutT>(in));
  297|     80|         }
  298|     80|      }
  299|     80|   }());
_ZN5Botan7load_beItJRPKhRmEEEDaDpOT0_:
  504|     91|inline constexpr auto load_be(ParamTs&&... params) {
  505|     91|   return detail::load_any<std::endian::big, OutT>(std::forward<ParamTs>(params)...);
  506|     91|}
_ZN5Botan6detail8load_anyILNSt3__16endianE64206ETkNS0_20unsigned_integralishEtEET0_PKhm:
  454|     91|inline constexpr OutT load_any(const uint8_t in[], size_t off) {
  455|       |   // asserts that *in points to enough bytes to read at offset off
  456|     91|   constexpr size_t out_size = sizeof(OutT);
  457|     91|   return load_any<endianness, OutT>(std::span<const uint8_t, out_size>(in + off * out_size, out_size));
  458|     91|}
_ZN5Botan6detail8load_anyILNSt3__16endianE64206ETkNS0_20unsigned_integralishEtTkNS_6ranges16contiguous_rangeIhEENS2_4spanIKhLm2EEEQnt15custom_loadableINS0_19wrapped_type_helperIu14__remove_cvrefIT0_EE4typeEEEESA_OT1_:
  278|     91|inline constexpr WrappedOutT load_any(InR&& in_range) {
  279|     91|   using OutT = detail::wrapped_type<WrappedOutT>;
  280|     91|   ranges::assert_exact_byte_length<sizeof(OutT)>(in_range);
  281|       |
  282|     91|   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|     91|      if(std::is_constant_evaluated()) /* TODO: C++23: if consteval {} */ {
  287|     91|         return fallback_load_any<endianness, OutT>(std::forward<InR>(in_range));
  288|     91|      } else {
  289|     91|         const std::span in{in_range};
  290|     91|         if constexpr(sizeof(OutT) == 1) {
  291|     91|            return static_cast<OutT>(in[0]);
  292|     91|         } else if constexpr(endianness == std::endian::native) {
  293|     91|            return typecast_copy<OutT>(in);
  294|     91|         } else {
  295|     91|            static_assert(opposite(endianness) == std::endian::native);
  296|     91|            return reverse_bytes(typecast_copy<OutT>(in));
  297|     91|         }
  298|     91|      }
  299|     91|   }());
  300|     91|}
_ZN5Botan6detail24wrap_strong_type_or_enumITkNS0_20unsigned_integralishEtTkNSt3__117unsigned_integralEtEEDaT0_:
  200|     91|constexpr auto wrap_strong_type_or_enum(T t) {
  201|       |   if constexpr(std::is_enum_v<OutT>) {
  202|       |      return static_cast<OutT>(t);
  203|     91|   } else {
  204|     91|      return Botan::wrap_strong_type<OutT>(t);
  205|     91|   }
  206|     91|}
_ZZN5Botan6detail8load_anyILNSt3__16endianE64206ETkNS0_20unsigned_integralishEtTkNS_6ranges16contiguous_rangeIhEENS2_4spanIKhLm2EEEQnt15custom_loadableINS0_19wrapped_type_helperIu14__remove_cvrefIT0_EE4typeEEEESA_OT1_ENKUlvE_clEv:
  282|     91|   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|     91|      if(std::is_constant_evaluated()) /* TODO: C++23: if consteval {} */ {
  ------------------
  |  Branch (286:10): [Folded, False: 91]
  ------------------
  287|      0|         return fallback_load_any<endianness, OutT>(std::forward<InR>(in_range));
  288|     91|      } else {
  289|     91|         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|     91|         } else {
  295|     91|            static_assert(opposite(endianness) == std::endian::native);
  296|     91|            return reverse_bytes(typecast_copy<OutT>(in));
  297|     91|         }
  298|     91|      }
  299|     91|   }());
_ZN5Botan7load_beIjJRPKhRmEEEDaDpOT0_:
  504|     80|inline constexpr auto load_be(ParamTs&&... params) {
  505|     80|   return detail::load_any<std::endian::big, OutT>(std::forward<ParamTs>(params)...);
  506|     80|}
_ZN5Botan6detail8load_anyILNSt3__16endianE64206ETkNS0_20unsigned_integralishEjEET0_PKhm:
  454|     80|inline constexpr OutT load_any(const uint8_t in[], size_t off) {
  455|       |   // asserts that *in points to enough bytes to read at offset off
  456|     80|   constexpr size_t out_size = sizeof(OutT);
  457|     80|   return load_any<endianness, OutT>(std::span<const uint8_t, out_size>(in + off * out_size, out_size));
  458|     80|}

_ZN5Botan15bytes_to_stringENSt3__14spanIKhLm18446744073709551615EEE:
   76|    243|inline std::string bytes_to_string(std::span<const uint8_t> bytes) {
   77|    243|   return std::string(reinterpret_cast<const char*>(bytes.data()), bytes.size());
   78|    243|}

_ZN5Botan8round_upEmm:
   26|  1.24k|constexpr inline size_t round_up(size_t n, size_t align_to) {
   27|       |   // Arguably returning n in this case would also be sensible
   28|  1.24k|   BOTAN_ARG_CHECK(align_to != 0, "align_to must not be 0");
  ------------------
  |  |   35|  1.24k|   do {                                                          \
  |  |   36|  1.24k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */              \
  |  |   37|  1.24k|      if(!(expr)) {                                              \
  |  |  ------------------
  |  |  |  Branch (37:10): [True: 0, False: 1.24k]
  |  |  ------------------
  |  |   38|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */     \
  |  |   39|      0|         Botan::throw_invalid_argument(msg, __func__, __FILE__); \
  |  |   40|      0|      }                                                          \
  |  |   41|  1.24k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 1.24k]
  |  |  ------------------
  ------------------
   29|       |
   30|  1.24k|   if(n % align_to > 0) {
  ------------------
  |  Branch (30:7): [True: 1.22k, False: 25]
  ------------------
   31|  1.22k|      const size_t adj = align_to - (n % align_to);
   32|  1.22k|      BOTAN_ARG_CHECK(n + adj >= n, "Integer overflow during rounding");
  ------------------
  |  |   35|  1.22k|   do {                                                          \
  |  |   36|  1.22k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */              \
  |  |   37|  1.22k|      if(!(expr)) {                                              \
  |  |  ------------------
  |  |  |  Branch (37:10): [True: 0, False: 1.22k]
  |  |  ------------------
  |  |   38|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */     \
  |  |   39|      0|         Botan::throw_invalid_argument(msg, __func__, __FILE__); \
  |  |   40|      0|      }                                                          \
  |  |   41|  1.22k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 1.22k]
  |  |  ------------------
  ------------------
   33|  1.22k|      n += adj;
   34|  1.22k|   }
   35|  1.24k|   return n;
   36|  1.24k|}

_ZN5Botan2CT13value_barrierITkNSt3__117unsigned_integralEmQntsr3stdE7same_asIbT_EEES3_S3_:
   43|  18.1k|constexpr inline T value_barrier(T x) {
   44|  18.1k|   if(std::is_constant_evaluated()) {
  ------------------
  |  Branch (44:7): [Folded, False: 18.1k]
  ------------------
   45|      0|      return x;
   46|  18.1k|   } else {
   47|  18.1k|#if defined(BOTAN_CT_VALUE_BARRIER_USE_ASM)
   48|       |      /*
   49|       |      * We may want a "stronger" statement such as
   50|       |      *     asm volatile("" : "+r,m"(x) : : "memory);
   51|       |      * (see https://theunixzoo.co.uk/blog/2021-10-14-preventing-optimisations.html)
   52|       |      * however the current approach seems sufficient with current compilers,
   53|       |      * and is minimally damaging with regards to degrading code generation.
   54|       |      */
   55|  18.1k|      asm("" : "+r"(x) : /* no input */);  // NOLINT(*-no-assembler)
   56|  18.1k|      return x;
   57|       |#elif defined(BOTAN_CT_VALUE_BARRIER_USE_VOLATILE)
   58|       |      volatile T vx = x;
   59|       |      return vx;
   60|       |#else
   61|       |      return x;
   62|       |#endif
   63|  18.1k|   }
   64|  18.1k|}

_ZN5Botan11ASN1_ObjectD2Ev:
  122|  11.8k|      virtual ~ASN1_Object() = default;
_ZNK5Botan10BER_Object6is_setEv:
  138|  31.6k|      bool is_set() const { return m_type_tag != ASN1_Type::NoObject; }
_ZNK5Botan10BER_Object7taggingEv:
  140|  13.6k|      uint32_t tagging() const { return type_tag() | class_tag(); }
_ZNK5Botan10BER_Object8type_tagEv:
  142|  13.6k|      ASN1_Type type_tag() const { return m_type_tag; }
_ZNK5Botan10BER_Object9class_tagEv:
  144|  14.8k|      ASN1_Class class_tag() const { return m_class_tag; }
_ZNK5Botan10BER_Object4typeEv:
  146|  1.23k|      ASN1_Type type() const { return m_type_tag; }
_ZNK5Botan10BER_Object9get_classEv:
  148|    881|      ASN1_Class get_class() const { return m_class_tag; }
_ZNK5Botan10BER_Object4bitsEv:
  150|  47.8k|      const uint8_t* bits() const { return m_value.data(); }
_ZNK5Botan10BER_Object6lengthEv:
  152|   143k|      size_t length() const { return m_value.size(); }
_ZNK5Botan10BER_Object4dataEv:
  154|  3.59k|      std::span<const uint8_t> data() const { return std::span{m_value}; }
_ZN5Botan10BER_Object12mutable_bitsEm:
  171|  11.7k|      uint8_t* mutable_bits(size_t length) {
  172|  11.7k|         m_value.resize(length);
  173|  11.7k|         return m_value.data();
  174|  11.7k|      }
_ZNK5Botan3OIDeqERKS0_:
  301|    870|      bool operator==(const OID& other) const { return m_id == other.m_id; }
_ZNK5Botan11ASN1_String5emptyEv:
  369|    119|      bool empty() const { return m_utf8_str.empty(); }
_ZN5BotanorENS_10ASN1_ClassES0_:
   78|  8.36k|inline ASN1_Class operator|(ASN1_Class x, ASN1_Class y) {
   79|  8.36k|   return static_cast<ASN1_Class>(static_cast<uint32_t>(x) | static_cast<uint32_t>(y));
   80|  8.36k|}
_ZN5BotanorENS_9ASN1_TypeENS_10ASN1_ClassE:
   82|  13.6k|inline uint32_t operator|(ASN1_Type x, ASN1_Class y) {
   83|  13.6k|   return static_cast<uint32_t>(x) | static_cast<uint32_t>(y);
   84|  13.6k|}
_ZN5BotanorENS_10ASN1_ClassENS_9ASN1_TypeE:
   86|  1.88k|inline uint32_t operator|(ASN1_Class x, ASN1_Type y) {
   87|  1.88k|   return static_cast<uint32_t>(x) | static_cast<uint32_t>(y);
   88|  1.88k|}
_ZN5BotanneERKNS_3OIDES2_:
  342|    870|inline bool operator!=(const OID& a, const OID& b) {
  343|    870|   return !(a == b);
  344|    870|}
_ZN5Botan11ASN1_ObjectC2Ev:
  117|  11.0k|      ASN1_Object() = default;
_ZN5Botan19AlgorithmIdentifierC2Ev:
  399|  1.77k|      AlgorithmIdentifier() = default;
_ZN5Botan3OIDC2Ev:
  220|  3.04k|      explicit OID() = default;
_ZN5Botan10BER_ObjectC2Ev:
  130|  23.6k|      BER_Object() = default;
_ZN5Botan10BER_ObjectaSEOS0_:
  135|  2.92k|      BER_Object& operator=(BER_Object&& other) = default;
_ZN5Botan11ASN1_ObjectC2ERKS0_:
  118|    442|      ASN1_Object(const ASN1_Object&) = default;
_ZN5Botan11ASN1_ObjectC2EOS0_:
  120|    342|      ASN1_Object(ASN1_Object&&) = default;
_ZN5Botan11ASN1_ObjectaSERKS0_:
  119|    327|      ASN1_Object& operator=(const ASN1_Object&) = default;
_ZN5Botan10BER_ObjectaSERKS0_:
  134|    595|      BER_Object& operator=(const BER_Object& other) = default;
_ZN5Botan10BER_ObjectC2EOS0_:
  133|  7.09k|      BER_Object(BER_Object&& other) = default;

_ZN5Botan9ASN1_TimeC2Ev:
   39|  1.76k|      ASN1_Time() = default;

_ZN5Botan13ignore_paramsIJPKmmEEEvDpRKT_:
  142|  2.77k|constexpr void ignore_params([[maybe_unused]] const T&... args) {}
_ZN5Botan13ignore_paramsIJjEEEvDpRKT_:
  142|     89|constexpr void ignore_params([[maybe_unused]] const T&... args) {}

_ZN5Botan11BER_Decoder14start_sequenceEv:
  160|  5.32k|      BER_Decoder start_sequence() { return start_cons(ASN1_Type::Sequence, ASN1_Class::Universal); }
_ZN5Botan11BER_Decoder6decodeERNS_6BigIntE:
  230|      1|      BER_Decoder& decode(BigInt& out) { return decode(out, ASN1_Type::Integer, ASN1_Class::Universal); }
_ZN5Botan11BER_Decoder6Limits3DEREv:
   35|  2.95k|            static Limits DER() { return Limits(false, 0); }
_ZN5Botan11BER_Decoder6LimitsC2Ebm:
   54|  2.95k|                  m_allow_ber(allow_ber), m_max_nested_indef(max_nested_indef) {}
_ZN5Botan11BER_Decoder22start_context_specificEj:
  164|    961|      BER_Decoder start_context_specific(uint32_t tag) {
  165|    961|         return start_cons(ASN1_Type(tag), ASN1_Class::ContextSpecific);
  166|    961|      }
_ZN5Botan11BER_Decoder21get_next_octet_stringEv:
  232|    640|      std::vector<uint8_t> get_next_octet_string() {
  233|    640|         std::vector<uint8_t> out_vec;
  234|    640|         decode(out_vec, ASN1_Type::OctetString);
  235|    640|         return out_vec;
  236|    640|      }
_ZN5Botan11BER_DecoderC2ERKNS_10BER_ObjectENS0_6LimitsE:
   81|    362|            BER_Decoder(obj.data(), limits) {}
_ZN5Botan11BER_Decoder6decodeINSt3__19allocatorIhEEEERS0_RNS2_6vectorIhT_EENS_9ASN1_TypeE:
  242|  1.26k|      BER_Decoder& decode(std::vector<uint8_t, Alloc>& out, ASN1_Type real_type) {
  243|  1.26k|         return decode(out, real_type, real_type, ASN1_Class::Universal);
  244|  1.26k|      }
_ZN5Botan11BER_Decoder15decode_optionalINS_10ExtensionsEEERS0_RT_NS_9ASN1_TypeENS_10ASN1_ClassERKS4_:
  285|     13|      BER_Decoder& decode_optional(T& out, ASN1_Type type_tag, ASN1_Class class_tag, const T& default_value = T()) {
  286|     13|         std::optional<T> optval;
  287|     13|         this->decode_optional(optval, type_tag, class_tag);
  288|     13|         out = optval ? *optval : default_value;
  ------------------
  |  Branch (288:16): [True: 0, False: 13]
  ------------------
  289|     13|         return (*this);
  290|     13|      }
_ZN5Botan11BER_Decoder15decode_optionalINS_10ExtensionsEEERS0_RNSt3__18optionalIT_EENS_9ASN1_TypeENS_10ASN1_ClassE:
  394|     13|BER_Decoder& BER_Decoder::decode_optional(std::optional<T>& optval, ASN1_Type type_tag, ASN1_Class class_tag) {
  395|     13|   BER_Object obj = get_next_object();
  396|       |
  397|     13|   if(obj.is_a(type_tag, class_tag)) {
  ------------------
  |  Branch (397:7): [True: 1, False: 12]
  ------------------
  398|      1|      T out{};
  399|      1|      if(class_tag == ASN1_Class::ExplicitContextSpecific) {
  ------------------
  |  Branch (399:10): [True: 1, False: 0]
  ------------------
  400|      1|         BER_Decoder(obj, m_limits).decode(out).verify_end();
  401|      1|      } else {
  402|      0|         this->push_back(std::move(obj));
  403|      0|         this->decode(out, type_tag, class_tag);
  404|      0|      }
  405|      1|      optval = std::move(out);
  406|     12|   } else {
  407|     12|      this->push_back(std::move(obj));
  408|     12|      optval = std::nullopt;
  409|     12|   }
  410|       |
  411|     13|   return (*this);
  412|     13|}
_ZN5Botan11BER_Decoder16decode_and_checkINS_3OIDEEERS0_RKT_NSt3__117basic_string_viewIcNS7_11char_traitsIcEEEE:
  327|    941|      BER_Decoder& decode_and_check(const T& expected, std::string_view error_msg) {
  328|    941|         T actual;
  329|    941|         decode(actual);
  330|       |
  331|    941|         if(actual != expected) {
  ------------------
  |  Branch (331:13): [True: 230, False: 711]
  ------------------
  332|    230|            throw Decoding_Error(error_msg);
  333|    230|         }
  334|       |
  335|    711|         return (*this);
  336|    941|      }
_ZN5Botan11BER_Decoder9raw_bytesINSt3__19allocatorIhEEEERS0_RNS2_6vectorIhT_EE:
  203|  1.59k|      BER_Decoder& raw_bytes(std::vector<uint8_t, Alloc>& out) {
  204|  1.59k|         out.clear();
  205|  16.9k|         for(;;) {
  206|  16.9k|            if(auto next = this->read_next_byte()) {
  ------------------
  |  Branch (206:21): [True: 15.3k, False: 1.59k]
  ------------------
  207|  15.3k|               out.push_back(*next);
  208|  15.3k|            } else {
  209|  1.59k|               break;
  210|  1.59k|            }
  211|  16.9k|         }
  212|  1.59k|         return (*this);
  213|  1.59k|      }
_ZN5Botan11BER_Decoder15decode_optionalImEERS0_RT_NS_9ASN1_TypeENS_10ASN1_ClassERKS3_:
  285|    543|      BER_Decoder& decode_optional(T& out, ASN1_Type type_tag, ASN1_Class class_tag, const T& default_value = T()) {
  286|    543|         std::optional<T> optval;
  287|    543|         this->decode_optional(optval, type_tag, class_tag);
  288|    543|         out = optval ? *optval : default_value;
  ------------------
  |  Branch (288:16): [True: 4, False: 539]
  ------------------
  289|    543|         return (*this);
  290|    543|      }
_ZN5Botan11BER_Decoder15decode_optionalImEERS0_RNSt3__18optionalIT_EENS_9ASN1_TypeENS_10ASN1_ClassE:
  394|    543|BER_Decoder& BER_Decoder::decode_optional(std::optional<T>& optval, ASN1_Type type_tag, ASN1_Class class_tag) {
  395|    543|   BER_Object obj = get_next_object();
  396|       |
  397|    543|   if(obj.is_a(type_tag, class_tag)) {
  ------------------
  |  Branch (397:7): [True: 6, False: 537]
  ------------------
  398|      6|      T out{};
  399|      6|      if(class_tag == ASN1_Class::ExplicitContextSpecific) {
  ------------------
  |  Branch (399:10): [True: 6, False: 0]
  ------------------
  400|      6|         BER_Decoder(obj, m_limits).decode(out).verify_end();
  401|      6|      } else {
  402|      0|         this->push_back(std::move(obj));
  403|      0|         this->decode(out, type_tag, class_tag);
  404|      0|      }
  405|      6|      optval = std::move(out);
  406|    537|   } else {
  407|    537|      this->push_back(std::move(obj));
  408|    537|      optval = std::nullopt;
  409|    537|   }
  410|       |
  411|    543|   return (*this);
  412|    543|}
_ZN5Botan11BER_Decoder6decodeERm:
  225|      6|      BER_Decoder& decode(size_t& out) { return decode(out, ASN1_Type::Integer, ASN1_Class::Universal); }
_ZN5Botan11BER_Decoder15decode_optionalINS_7X509_DNEEERS0_RT_NS_9ASN1_TypeENS_10ASN1_ClassERKS4_:
  285|    539|      BER_Decoder& decode_optional(T& out, ASN1_Type type_tag, ASN1_Class class_tag, const T& default_value = T()) {
  286|    539|         std::optional<T> optval;
  287|    539|         this->decode_optional(optval, type_tag, class_tag);
  288|    539|         out = optval ? *optval : default_value;
  ------------------
  |  Branch (288:16): [True: 116, False: 423]
  ------------------
  289|    539|         return (*this);
  290|    539|      }
_ZN5Botan11BER_Decoder15decode_optionalINS_7X509_DNEEERS0_RNSt3__18optionalIT_EENS_9ASN1_TypeENS_10ASN1_ClassE:
  394|    539|BER_Decoder& BER_Decoder::decode_optional(std::optional<T>& optval, ASN1_Type type_tag, ASN1_Class class_tag) {
  395|    539|   BER_Object obj = get_next_object();
  396|       |
  397|    539|   if(obj.is_a(type_tag, class_tag)) {
  ------------------
  |  Branch (397:7): [True: 339, False: 200]
  ------------------
  398|    339|      T out{};
  399|    339|      if(class_tag == ASN1_Class::ExplicitContextSpecific) {
  ------------------
  |  Branch (399:10): [True: 339, False: 0]
  ------------------
  400|    339|         BER_Decoder(obj, m_limits).decode(out).verify_end();
  401|    339|      } else {
  402|      0|         this->push_back(std::move(obj));
  403|      0|         this->decode(out, type_tag, class_tag);
  404|      0|      }
  405|    339|      optval = std::move(out);
  406|    339|   } else {
  407|    200|      this->push_back(std::move(obj));
  408|    200|      optval = std::nullopt;
  409|    200|   }
  410|       |
  411|    539|   return (*this);
  412|    539|}
_ZN5Botan11BER_Decoder22decode_optional_stringINSt3__19allocatorIhEEEERS0_RNS2_6vectorIhT_EENS_9ASN1_TypeEjNS_10ASN1_ClassE:
  345|    315|                                          ASN1_Class class_tag = ASN1_Class::ContextSpecific) {
  346|    315|         BER_Object obj = get_next_object();
  347|       |
  348|    315|         const ASN1_Type type_tag = static_cast<ASN1_Type>(expected_tag);
  349|       |
  350|    315|         if(obj.is_a(type_tag, class_tag)) {
  ------------------
  |  Branch (350:13): [True: 5, False: 310]
  ------------------
  351|      5|            if(class_tag == ASN1_Class::ExplicitContextSpecific) {
  ------------------
  |  Branch (351:16): [True: 5, False: 0]
  ------------------
  352|      5|               BER_Decoder(obj, m_limits).decode(out, real_type).verify_end();
  353|      5|            } else {
  354|      0|               push_back(std::move(obj));
  355|      0|               decode(out, real_type, type_tag, class_tag);
  356|      0|            }
  357|    310|         } else {
  358|    310|            out.clear();
  359|    310|            push_back(std::move(obj));
  360|    310|         }
  361|       |
  362|    315|         return (*this);
  363|    315|      }
_ZN5Botan11BER_Decoder11decode_listINS_4OCSP14SingleResponseEEERS0_RNSt3__16vectorIT_NS5_9allocatorIS7_EEEENS_9ASN1_TypeENS_10ASN1_ClassE:
  443|     23|BER_Decoder& BER_Decoder::decode_list(std::vector<T>& vec, ASN1_Type type_tag, ASN1_Class class_tag) {
  444|     23|   BER_Decoder list = start_cons(type_tag, class_tag);
  445|       |
  446|     25|   while(list.more_items()) {
  ------------------
  |  Branch (446:10): [True: 2, False: 23]
  ------------------
  447|      2|      T value;
  448|      2|      list.decode(value);
  449|      2|      vec.push_back(std::move(value));
  450|      2|   }
  451|       |
  452|     23|   list.end_cons();
  453|       |
  454|     23|   return (*this);
  455|     23|}
_ZNK5Botan11BER_Decoder6Limits18allow_ber_encodingEv:
   44|  26.6k|            bool allow_ber_encoding() const { return m_allow_ber; }
_ZNK5Botan11BER_Decoder6Limits20require_der_encodingEv:
   46|  14.5k|            bool require_der_encoding() const { return !allow_ber_encoding(); }
_ZNK5Botan11BER_Decoder6limitsEv:
   98|  6.50k|      Limits limits() const { return m_limits; }
_ZN5Botan11BER_Decoder9start_setEv:
  162|    351|      BER_Decoder start_set() { return start_cons(ASN1_Type::Set, ASN1_Class::Universal); }

_ZN5Botan6BigIntD2Ev:
  185|  1.34k|      ~BigInt() { _const_time_unpoison(); }
_ZN5Botan6BigInt5clearEv:
  415|  1.24k|      void clear() {
  416|  1.24k|         m_data.set_to_zero();
  417|  1.24k|         m_signedness = Positive;
  418|  1.24k|      }
_ZNK5Botan6BigInt6signumEv:
  467|  1.24k|      int signum() const {
  468|  1.24k|         if(sig_words() == 0) {
  ------------------
  |  Branch (468:13): [True: 967, False: 280]
  ------------------
  469|    967|            return 0;
  470|    967|         }
  471|    280|         return (sign() == Negative) ? -1 : 1;
  ------------------
  |  Branch (471:17): [True: 106, False: 174]
  ------------------
  472|  1.24k|      }
_ZNK5Botan6BigInt7is_zeroEv:
  484|    106|      bool is_zero() const { return sig_words() == 0; }
_ZNK5Botan6BigInt7word_atEm:
  574|  4.37k|      word word_at(size_t n) const { return m_data.get_word_at(n); }
_ZNK5Botan6BigInt4signEv:
  604|    386|      Sign sign() const { return (m_signedness); }
_ZNK5Botan6BigInt12reverse_signEv:
  609|    106|      Sign reverse_sign() const {
  610|    106|         if(sign() == Positive) {
  ------------------
  |  Branch (610:13): [True: 106, False: 0]
  ------------------
  611|    106|            return Negative;
  612|    106|         }
  613|      0|         return Positive;
  614|    106|      }
_ZN5Botan6BigInt9flip_signEv:
  619|    106|      BOTAN_DEPRECATED("Deprecated no replacement") void flip_sign() { set_sign(reverse_sign()); }
_ZN5Botan6BigInt8set_signENS0_4SignE:
  625|    106|      void set_sign(Sign sign) {
  626|    106|         if(sign == Negative && is_zero()) {
  ------------------
  |  Branch (626:13): [True: 106, False: 0]
  |  Branch (626:33): [True: 0, False: 106]
  ------------------
  627|      0|            sign = Positive;
  628|      0|         }
  629|       |
  630|    106|         m_signedness = sign;
  631|    106|      }
_ZNK5Botan6BigInt9sig_wordsEv:
  648|  2.66k|      size_t sig_words() const { return m_data.sig_words(); }
_ZN5Botan6BigInt18_assign_from_bytesENSt3__14spanIKhLm18446744073709551615EEE:
  983|  1.24k|      void _assign_from_bytes(std::span<const uint8_t> bytes) { assign_from_bytes(bytes); }
_ZNK5Botan6BigInt4Data10const_dataEv:
 1027|  1.34k|            const word* const_data() const { return m_reg.data(); }
_ZNK5Botan6BigInt4Data11get_word_atEm:
 1038|  4.37k|            word get_word_at(size_t n) const {
 1039|  4.37k|               if(n < m_reg.size()) {
  ------------------
  |  Branch (1039:19): [True: 4.37k, False: 0]
  ------------------
 1040|  4.37k|                  return m_reg[n];
 1041|  4.37k|               }
 1042|      0|               return 0;
 1043|  4.37k|            }
_ZNK5Botan6BigInt4Data4sizeEv:
 1075|  1.34k|            size_t size() const { return m_reg.size(); }
_ZN5Botan6BigInt4Data4swapERNSt3__16vectorImNS_16secure_allocatorImEEEE:
 1095|  1.24k|            void swap(secure_vector<word>& reg) noexcept {
 1096|  1.24k|               m_reg.swap(reg);
 1097|  1.24k|               invalidate_sig_words();
 1098|  1.24k|            }
_ZNK5Botan6BigInt4Data20invalidate_sig_wordsEv:
 1100|  1.24k|            void invalidate_sig_words() const noexcept { m_sig_words = sig_words_npos; }
_ZNK5Botan6BigInt4Data9sig_wordsEv:
 1102|  2.66k|            size_t sig_words() const {
 1103|  2.66k|               if(m_sig_words == sig_words_npos) {
  ------------------
  |  Branch (1103:19): [True: 1.24k, False: 1.42k]
  ------------------
 1104|  1.24k|                  m_sig_words = calc_sig_words();
 1105|  1.24k|               }
 1106|  2.66k|               return m_sig_words;
 1107|  2.66k|            }
_ZN5Botan6BigIntC2Ev:
   45|  1.34k|      BigInt() = default;

_ZN5Botan10DataSourceC2Ev:
  100|  9.81k|      DataSource() = default;
_ZN5Botan10DataSourceD2Ev:
  101|  9.81k|      virtual ~DataSource() = default;
_ZN5Botan17DataSource_MemoryC2ENSt3__14spanIKhLm18446744073709551615EEE:
  141|  3.64k|      explicit DataSource_Memory(std::span<const uint8_t> in) : m_source(in.begin(), in.end()), m_offset(0) {}

_ZNK5Botan9Exception4whatEv:
   94|    107|      const char* what() const noexcept override { return m_msg.c_str(); }

_ZN5Botan9clear_memImEEvPT_m:
  118|  1.24k|inline constexpr void clear_mem(T* ptr, size_t n) {
  119|  1.24k|   clear_bytes(ptr, sizeof(T) * n);
  120|  1.24k|}
_ZN5Botan11clear_bytesEPvm:
  101|  1.24k|inline constexpr void clear_bytes(void* ptr, size_t bytes) {
  102|  1.24k|   if(bytes > 0) {
  ------------------
  |  Branch (102:7): [True: 0, False: 1.24k]
  ------------------
  103|      0|      std::memset(ptr, 0, bytes);
  104|      0|   }
  105|  1.24k|}
_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|  7.41k|inline constexpr ToT typecast_copy(const FromR& src) {
  211|  7.41k|   ToT dst;  // NOLINT(*-member-init)
  212|  7.41k|   typecast_copy(dst, src);
  213|  7.41k|   return dst;
  214|  7.41k|}
_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|  7.41k|inline constexpr void typecast_copy(ToT& out, const FromR& in) {
  189|  7.41k|   typecast_copy(std::span<ToT, 1>(&out, 1), in);
  190|  7.41k|}
_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|  7.41k|inline constexpr void typecast_copy(ToR&& out /* NOLINT(*-std-forward) */, const FromR& in) {
  177|  7.41k|   ranges::assert_equal_byte_lengths(out, in);
  178|  7.41k|   std::memcpy(std::ranges::data(out), std::ranges::data(in), ranges::size_bytes(out));
  179|  7.41k|}
_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|  1.23k|inline constexpr void copy_mem(OutR&& out /* NOLINT(*-std-forward) */, const InR& in) {
  161|  1.23k|   ranges::assert_equal_byte_lengths(out, in);
  162|  1.23k|   if(std::is_constant_evaluated()) {
  ------------------
  |  Branch (162:7): [Folded, False: 1.23k]
  ------------------
  163|      0|      std::copy(std::ranges::begin(in), std::ranges::end(in), std::ranges::begin(out));
  164|  1.23k|   } else if(ranges::size_bytes(out) > 0) {
  ------------------
  |  Branch (164:14): [True: 1.23k, False: 0]
  ------------------
  165|  1.23k|      std::memmove(std::ranges::data(out), std::ranges::data(in), ranges::size_bytes(out));
  166|  1.23k|   }
  167|  1.23k|}
_ZN5Botan13typecast_copyImTkNS_6ranges16contiguous_rangeENSt3__14spanIhLm8EEEQaaaasr3stdE26is_default_constructible_vIT_Esr3stdE23is_trivially_copyable_vIS5_Esr3stdE23is_trivially_copyable_vINS2_11conditionalIXsr21__is_primary_templateINS2_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS2_6ranges5__cpo5beginEEclsr3stdE7declvalIRT0_EEEEEEEEE5valueENS2_26indirectly_readable_traitsISD_EESE_E4type10value_typeEEEES5_RKSA_:
  210|  1.23k|inline constexpr ToT typecast_copy(const FromR& src) {
  211|  1.23k|   ToT dst;  // NOLINT(*-member-init)
  212|  1.23k|   typecast_copy(dst, src);
  213|  1.23k|   return dst;
  214|  1.23k|}
_ZN5Botan13typecast_copyImTkNS_6ranges16contiguous_rangeENSt3__14spanIhLm8EEEQaaaasr3stdE23is_trivially_copyable_vINS2_11conditionalIXsr21__is_primary_templateINS2_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS2_6ranges5__cpo5beginEEclsr3stdE7declvalIRT0_EEEEEEEEE5valueENS2_26indirectly_readable_traitsISC_EESD_E4type10value_typeEEsr3stdE23is_trivially_copyable_vIT_Entsr3std6rangesE5rangeISJ_EEEvRSJ_RKS9_:
  188|  1.23k|inline constexpr void typecast_copy(ToT& out, const FromR& in) {
  189|  1.23k|   typecast_copy(std::span<ToT, 1>(&out, 1), in);
  190|  1.23k|}
_ZN5Botan13typecast_copyITkNS_6ranges23contiguous_output_rangeENSt3__14spanImLm1EEETkNS1_16contiguous_rangeENS3_IhLm8EEEQaasr3stdE23is_trivially_copyable_vINS2_11conditionalIXsr21__is_primary_templateINS2_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS2_6ranges5__cpo5beginEEclsr3stdE7declvalIRT0_EEEEEEEEE5valueENS2_26indirectly_readable_traitsISD_EESE_E4type10value_typeEEsr3stdE23is_trivially_copyable_vINS6_IXsr21__is_primary_templateINS7_Iu14__remove_cvrefIDTclL_ZNS9_5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENSF_ISN_EESO_E4type10value_typeEEEEvOSK_RKSA_:
  176|  1.23k|inline constexpr void typecast_copy(ToR&& out /* NOLINT(*-std-forward) */, const FromR& in) {
  177|  1.23k|   ranges::assert_equal_byte_lengths(out, in);
  178|  1.23k|   std::memcpy(std::ranges::data(out), std::ranges::data(in), ranges::size_bytes(out));
  179|  1.23k|}
_ZN5Botan19secure_scrub_memoryITkNS_6ranges23contiguous_output_rangeERNSt3__16vectorIhNS2_9allocatorIhEEEEEEvOT_:
   59|  30.7k|void secure_scrub_memory(ranges::contiguous_output_range auto&& data) {
   60|  30.7k|   secure_scrub_memory(std::ranges::data(data), ranges::size_bytes(data));
   61|  30.7k|}
_ZN5Botan8copy_memIhQsr3stdE12is_trivial_vIu7__decayIT_EEEEvPS1_PKS1_m:
  144|  55.7k|inline constexpr void copy_mem(T* out, const T* in, size_t n) {
  145|  55.7k|   BOTAN_ASSERT_IMPLICATION(n > 0, in != nullptr && out != nullptr, "If n > 0 then args are not null");
  ------------------
  |  |  103|  55.7k|   do {                                                                                          \
  |  |  104|  55.7k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                                              \
  |  |  105|   105k|      if((expr1) && !(expr2)) {                                                                  \
  |  |  ------------------
  |  |  |  Branch (105:10): [True: 52.7k, False: 2.95k]
  |  |  |  Branch (105:23): [True: 52.7k, False: 0]
  |  |  |  Branch (105:23): [True: 52.7k, False: 0]
  |  |  ------------------
  |  |  106|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                                     \
  |  |  107|      0|         Botan::assertion_failure(#expr1 " implies " #expr2, msg, __func__, __FILE__, __LINE__); \
  |  |  108|      0|      }                                                                                          \
  |  |  109|  55.7k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (109:12): [Folded, False: 55.7k]
  |  |  ------------------
  ------------------
  146|       |
  147|  55.7k|   if(in != nullptr && out != nullptr && n > 0) {
  ------------------
  |  Branch (147:7): [True: 55.6k, False: 50]
  |  Branch (147:24): [True: 55.2k, False: 423]
  |  Branch (147:42): [True: 52.7k, False: 2.48k]
  ------------------
  148|  52.7k|      std::memmove(out, in, sizeof(T) * n);
  149|  52.7k|   }
  150|  55.7k|}
_ZN5Botan13typecast_copyITkNS_6ranges23contiguous_output_rangeENSt3__14spanIjLm1EEETkNS1_16contiguous_rangeENS3_IKhLm4EEEQaasr3stdE23is_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|     80|inline constexpr void typecast_copy(ToR&& out /* NOLINT(*-std-forward) */, const FromR& in) {
  177|     80|   ranges::assert_equal_byte_lengths(out, in);
  178|     80|   std::memcpy(std::ranges::data(out), std::ranges::data(in), ranges::size_bytes(out));
  179|     80|}
_ZN5Botan13typecast_copyIjTkNS_6ranges16contiguous_rangeENSt3__14spanIKhLm4EEEQaaaasr3stdE23is_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|     80|inline constexpr void typecast_copy(ToT& out, const FromR& in) {
  189|     80|   typecast_copy(std::span<ToT, 1>(&out, 1), in);
  190|     80|}
_ZN5Botan13typecast_copyIjTkNS_6ranges16contiguous_rangeENSt3__14spanIKhLm4EEEQaaaasr3stdE26is_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|     80|inline constexpr ToT typecast_copy(const FromR& src) {
  211|     80|   ToT dst;  // NOLINT(*-member-init)
  212|     80|   typecast_copy(dst, src);
  213|     80|   return dst;
  214|     80|}
_ZN5Botan13typecast_copyItTkNS_6ranges16contiguous_rangeENSt3__14spanIKhLm2EEEQaaaasr3stdE26is_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|     91|inline constexpr ToT typecast_copy(const FromR& src) {
  211|     91|   ToT dst;  // NOLINT(*-member-init)
  212|     91|   typecast_copy(dst, src);
  213|     91|   return dst;
  214|     91|}
_ZN5Botan13typecast_copyItTkNS_6ranges16contiguous_rangeENSt3__14spanIKhLm2EEEQaaaasr3stdE23is_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|     91|inline constexpr void typecast_copy(ToT& out, const FromR& in) {
  189|     91|   typecast_copy(std::span<ToT, 1>(&out, 1), in);
  190|     91|}
_ZN5Botan13typecast_copyITkNS_6ranges23contiguous_output_rangeENSt3__14spanItLm1EEETkNS1_16contiguous_rangeENS3_IKhLm2EEEQaasr3stdE23is_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|     91|inline constexpr void typecast_copy(ToR&& out /* NOLINT(*-std-forward) */, const FromR& in) {
  177|     91|   ranges::assert_equal_byte_lengths(out, in);
  178|     91|   std::memcpy(std::ranges::data(out), std::ranges::data(in), ranges::size_bytes(out));
  179|     91|}

_ZN5Botan4OCSP6CertIDC2Ev:
   29|      2|      CertID() = default;

_ZN5Botan15Key_ConstraintsC2Ev:
  158|      1|      Key_Constraints() : m_value(0) {}

_ZNK5Botan7X509_DN5emptyEv:
   88|     11|      bool empty() const { return m_rdn.empty(); }
_ZN5Botan10ExtensionsC2Ev:
  720|    559|      Extensions() = default;
_ZN5Botan10ExtensionsD2Ev:
  728|    559|      ~Extensions() override = default;
_ZN5Botan7X509_DNC2Ev:
   45|  2.64k|      X509_DN() = default;
_ZN5Botan10ExtensionsaSERKS0_:
  723|     12|      Extensions& operator=(const Extensions&) = default;
_ZN5Botan15NameConstraintsC2Ev:
  479|      1|      NameConstraints() = default;
_ZN5Botan15AlternativeNameC2Ev:
  176|      2|      AlternativeName() = default;

_ZN5Botan6ranges24assert_exact_byte_lengthILm8ETkNS0_14spanable_rangeENSt3__14spanIhLm8EEEEEvRKT0_:
   77|  1.23k|inline constexpr void assert_exact_byte_length(const R& r) {
   78|  1.23k|   const std::span s{r};
   79|  1.23k|   if constexpr(statically_spanable_range<R>) {
   80|  1.23k|      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.23k|}
_ZN5Botan6ranges24assert_exact_byte_lengthILm8ETkNS0_14spanable_rangeENSt3__14spanIKhLm8EEEEEvRKT0_:
   77|  14.8k|inline constexpr void assert_exact_byte_length(const R& r) {
   78|  14.8k|   const std::span s{r};
   79|  14.8k|   if constexpr(statically_spanable_range<R>) {
   80|  14.8k|      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|  14.8k|}
_ZN5Botan6ranges25assert_equal_byte_lengthsITkNS0_14spanable_rangeENSt3__14spanImLm1EEETpTkNS0_14spanable_rangeEJNS3_IKhLm8EEEEEEvRKT_DpRKT0_QgtsZT0_Li0E:
  100|  7.41k|{
  101|  7.41k|   const std::span s0{r0};
  102|       |
  103|  7.41k|   if constexpr(statically_spanable_range<R0>) {
  104|  7.41k|      constexpr size_t expected_size = s0.size_bytes();
  105|  7.41k|      (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|  7.41k|}
_ZN5Botan6ranges10size_bytesITkNS0_14spanable_rangeENSt3__14spanImLm1EEEEEmRKT_:
   59|  8.65k|inline constexpr size_t size_bytes(const spanable_range auto& r) {
   60|  8.65k|   return std::span{r}.size_bytes();
   61|  8.65k|}
_ZN5Botan6ranges25assert_equal_byte_lengthsITkNS0_14spanable_rangeENSt3__14spanIhLm18446744073709551615EEETpTkNS0_14spanable_rangeEJNS3_IKhLm18446744073709551615EEEEEEvRKT_DpRKT0_QgtsZT0_Li0E:
  100|  1.23k|{
  101|  1.23k|   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.23k|   } else {
  107|  1.23k|      const size_t expected_size = s0.size_bytes();
  108|  1.23k|      const bool correct_size =
  109|  1.23k|         ((std::span<const std::ranges::range_value_t<Rs>>{rs}.size_bytes() == expected_size) && ...);
  110|       |
  111|  1.23k|      if(!correct_size) {
  ------------------
  |  Branch (111:10): [True: 0, False: 1.23k]
  ------------------
  112|      0|         memory_region_size_violation();
  113|      0|      }
  114|  1.23k|   }
  115|  1.23k|}
_ZN5Botan6ranges10size_bytesITkNS0_14spanable_rangeENSt3__14spanIhLm18446744073709551615EEEEEmRKT_:
   59|  2.47k|inline constexpr size_t size_bytes(const spanable_range auto& r) {
   60|  2.47k|   return std::span{r}.size_bytes();
   61|  2.47k|}
_ZN5Botan6ranges24assert_exact_byte_lengthILm8ETkNS0_14spanable_rangeENSt3__15arrayIhLm8EEEEEvRKT0_:
   77|  1.23k|inline constexpr void assert_exact_byte_length(const R& r) {
   78|  1.23k|   const std::span s{r};
   79|  1.23k|   if constexpr(statically_spanable_range<R>) {
   80|  1.23k|      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.23k|}
_ZN5Botan6ranges25assert_equal_byte_lengthsITkNS0_14spanable_rangeENSt3__14spanImLm1EEETpTkNS0_14spanable_rangeEJNS3_IhLm8EEEEEEvRKT_DpRKT0_QgtsZT0_Li0E:
  100|  1.23k|{
  101|  1.23k|   const std::span s0{r0};
  102|       |
  103|  1.23k|   if constexpr(statically_spanable_range<R0>) {
  104|  1.23k|      constexpr size_t expected_size = s0.size_bytes();
  105|  1.23k|      (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|  1.23k|}
_ZN5Botan6ranges10size_bytesITkNS0_14spanable_rangeENSt3__16vectorIhNS2_9allocatorIhEEEEEEmRKT_:
   59|  30.7k|inline constexpr size_t size_bytes(const spanable_range auto& r) {
   60|  30.7k|   return std::span{r}.size_bytes();
   61|  30.7k|}
_ZN5Botan6ranges24assert_exact_byte_lengthILm4ETkNS0_14spanable_rangeENSt3__14spanIKhLm4EEEEEvRKT0_:
   77|    160|inline constexpr void assert_exact_byte_length(const R& r) {
   78|    160|   const std::span s{r};
   79|    160|   if constexpr(statically_spanable_range<R>) {
   80|    160|      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|    160|}
_ZN5Botan6ranges25assert_equal_byte_lengthsITkNS0_14spanable_rangeENSt3__14spanIjLm1EEETpTkNS0_14spanable_rangeEJNS3_IKhLm4EEEEEEvRKT_DpRKT0_QgtsZT0_Li0E:
  100|     80|{
  101|     80|   const std::span s0{r0};
  102|       |
  103|     80|   if constexpr(statically_spanable_range<R0>) {
  104|     80|      constexpr size_t expected_size = s0.size_bytes();
  105|     80|      (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|     80|}
_ZN5Botan6ranges10size_bytesITkNS0_14spanable_rangeENSt3__14spanIjLm1EEEEEmRKT_:
   59|     80|inline constexpr size_t size_bytes(const spanable_range auto& r) {
   60|     80|   return std::span{r}.size_bytes();
   61|     80|}
_ZN5Botan6ranges24assert_exact_byte_lengthILm2ETkNS0_14spanable_rangeENSt3__14spanIKhLm2EEEEEvRKT0_:
   77|    182|inline constexpr void assert_exact_byte_length(const R& r) {
   78|    182|   const std::span s{r};
   79|    182|   if constexpr(statically_spanable_range<R>) {
   80|    182|      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|    182|}
_ZN5Botan6ranges25assert_equal_byte_lengthsITkNS0_14spanable_rangeENSt3__14spanItLm1EEETpTkNS0_14spanable_rangeEJNS3_IKhLm2EEEEEEvRKT_DpRKT0_QgtsZT0_Li0E:
  100|     91|{
  101|     91|   const std::span s0{r0};
  102|       |
  103|     91|   if constexpr(statically_spanable_range<R0>) {
  104|     91|      constexpr size_t expected_size = s0.size_bytes();
  105|     91|      (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|     91|}
_ZN5Botan6ranges10size_bytesITkNS0_14spanable_rangeENSt3__14spanItLm1EEEEEmRKT_:
   59|     91|inline constexpr size_t size_bytes(const spanable_range auto& r) {
   60|     91|   return std::span{r}.size_bytes();
   61|     91|}

_ZN5Botan16secure_allocatorImE10deallocateEPmm:
   54|  1.24k|      void deallocate(T* p, std::size_t n) { deallocate_memory(p, n, sizeof(T)); }
_ZN5Botan16secure_allocatorIhE10deallocateEPhm:
   54|  3.73k|      void deallocate(T* p, std::size_t n) { deallocate_memory(p, n, sizeof(T)); }
_ZN5Botan16secure_allocatorIhE8allocateEm:
   52|  3.73k|      T* allocate(std::size_t n) { return static_cast<T*>(allocate_memory(n, sizeof(T))); }
_ZN5Botan16secure_allocatorImE8allocateEm:
   52|  1.24k|      T* allocate(std::size_t n) { return static_cast<T*>(allocate_memory(n, sizeof(T))); }

_ZN5Botan16wrap_strong_typeImRmQoosr3stdE18constructible_fromIT_T0_Eaasr8conceptsE11strong_typeIS2_Esr3stdE18constructible_fromINS2_12wrapped_typeES3_EEEDcOS3_:
  268|  8.65k|[[nodiscard]] constexpr decltype(auto) wrap_strong_type(ParamT&& t) {
  269|  8.65k|   if constexpr(std::same_as<std::remove_cvref_t<ParamT>, T>) {
  270|       |      // Noop, if the parameter type already is the desired return type.
  271|  8.65k|      return std::forward<ParamT>(t);
  272|       |   } else if constexpr(std::constructible_from<T, ParamT>) {
  273|       |      // Implicit conversion from the parameter type to the return type.
  274|       |      return T{std::forward<ParamT>(t)};
  275|       |   } else {
  276|       |      // Explicitly calling the wrapped type's constructor to support
  277|       |      // implicit conversions on types that mark their constructors as explicit.
  278|       |      static_assert(concepts::strong_type<T> && std::constructible_from<typename T::wrapped_type, ParamT>);
  279|       |      return T{typename T::wrapped_type{std::forward<ParamT>(t)}};
  280|       |   }
  281|  8.65k|}
_ZN5Botan16wrap_strong_typeIjRjQoosr3stdE18constructible_fromIT_T0_Eaasr8conceptsE11strong_typeIS2_Esr3stdE18constructible_fromINS2_12wrapped_typeES3_EEEDcOS3_:
  268|     80|[[nodiscard]] constexpr decltype(auto) wrap_strong_type(ParamT&& t) {
  269|     80|   if constexpr(std::same_as<std::remove_cvref_t<ParamT>, T>) {
  270|       |      // Noop, if the parameter type already is the desired return type.
  271|     80|      return std::forward<ParamT>(t);
  272|       |   } else if constexpr(std::constructible_from<T, ParamT>) {
  273|       |      // Implicit conversion from the parameter type to the return type.
  274|       |      return T{std::forward<ParamT>(t)};
  275|       |   } else {
  276|       |      // Explicitly calling the wrapped type's constructor to support
  277|       |      // implicit conversions on types that mark their constructors as explicit.
  278|       |      static_assert(concepts::strong_type<T> && std::constructible_from<typename T::wrapped_type, ParamT>);
  279|       |      return T{typename T::wrapped_type{std::forward<ParamT>(t)}};
  280|       |   }
  281|     80|}
_ZN5Botan16wrap_strong_typeItRtQoosr3stdE18constructible_fromIT_T0_Eaasr8conceptsE11strong_typeIS2_Esr3stdE18constructible_fromINS2_12wrapped_typeES3_EEEDcOS3_:
  268|     91|[[nodiscard]] constexpr decltype(auto) wrap_strong_type(ParamT&& t) {
  269|     91|   if constexpr(std::same_as<std::remove_cvref_t<ParamT>, T>) {
  270|       |      // Noop, if the parameter type already is the desired return type.
  271|     91|      return std::forward<ParamT>(t);
  272|       |   } else if constexpr(std::constructible_from<T, ParamT>) {
  273|       |      // Implicit conversion from the parameter type to the return type.
  274|       |      return T{std::forward<ParamT>(t)};
  275|       |   } else {
  276|       |      // Explicitly calling the wrapped type's constructor to support
  277|       |      // implicit conversions on types that mark their constructors as explicit.
  278|       |      static_assert(concepts::strong_type<T> && std::constructible_from<typename T::wrapped_type, ParamT>);
  279|       |      return T{typename T::wrapped_type{std::forward<ParamT>(t)}};
  280|       |   }
  281|     91|}

_ZN5Botan11X509_ObjectC2Ev:
  120|      7|      X509_Object() = default;

_ZN5Botan16X509_CertificateC2Ev:
  475|      7|      X509_Certificate() = default;

LLVMFuzzerInitialize:
   28|      2|extern "C" int LLVMFuzzerInitialize(int* /*argc*/, char*** /*argv*/) {
   29|       |   /*
   30|       |   * This disables the mlock pool, as overwrites within the pool are
   31|       |   * opaque to ASan or other instrumentation.
   32|       |   */
   33|      2|   ::setenv("BOTAN_MLOCK_POOL_SIZE", "0", 1);
   34|      2|   return 0;
   35|      2|}
LLVMFuzzerTestOneInput:
   39|  1.77k|extern "C" int LLVMFuzzerTestOneInput(const uint8_t in[], size_t len) {
   40|  1.77k|   if(len <= max_fuzzer_input_size) {
  ------------------
  |  Branch (40:7): [True: 1.76k, False: 10]
  ------------------
   41|  1.76k|      try {
   42|  1.76k|         fuzz(std::span<const uint8_t>(in, len));
   43|  1.76k|      } catch(const std::exception& e) {
   44|      0|         std::cerr << "Uncaught exception from fuzzer driver " << e.what() << "\n";
   45|      0|         abort();
   46|      0|      } catch(...) {
   47|      0|         std::cerr << "Uncaught exception from fuzzer driver (unknown type)\n";
   48|      0|         abort();
   49|      0|      }
   50|  1.76k|   }
   51|  1.77k|   return 0;
   52|  1.77k|}

_Z4fuzzNSt3__14spanIKhLm18446744073709551615EEE:
   11|  1.76k|void fuzz(std::span<const uint8_t> in) {
   12|  1.76k|   try {
   13|  1.76k|      const Botan::OCSP::Response response(in.data(), in.size());
   14|  1.76k|   } catch(const Botan::Exception& e) {}
   15|  1.76k|}

_ZN5Botan19AlgorithmIdentifier11decode_fromERNS_11BER_DecoderE:
   82|    637|void AlgorithmIdentifier::decode_from(BER_Decoder& codec) {
   83|    637|   codec.start_sequence().decode(m_oid).raw_bytes(m_parameters).end_cons();
   84|    637|}

_ZN5Botan10BER_ObjectD2Ev:
   27|  30.7k|BER_Object::~BER_Object() {
   28|  30.7k|   secure_scrub_memory(m_value);
   29|  30.7k|}
_ZNK5Botan10BER_Object11assert_is_aENS_9ASN1_TypeENS_10ASN1_ClassENSt3__117basic_string_viewIcNS3_11char_traitsIcEEEE:
   34|  8.89k|void BER_Object::assert_is_a(ASN1_Type expected_type_tag, ASN1_Class expected_class_tag, std::string_view descr) const {
   35|  8.89k|   if(!this->is_a(expected_type_tag, expected_class_tag)) {
  ------------------
  |  Branch (35:7): [True: 204, False: 8.69k]
  ------------------
   36|    204|      std::stringstream msg;
   37|       |
   38|    204|      msg << "Tag mismatch when decoding " << descr << " got ";
   39|       |
   40|    204|      if(m_class_tag == ASN1_Class::NoObject && m_type_tag == ASN1_Type::NoObject) {
  ------------------
  |  Branch (40:10): [True: 18, False: 186]
  |  Branch (40:49): [True: 18, False: 0]
  ------------------
   41|     18|         msg << "EOF";
   42|    186|      } else {
   43|    186|         if(m_class_tag == ASN1_Class::Universal || m_class_tag == ASN1_Class::Constructed) {
  ------------------
  |  Branch (43:13): [True: 45, False: 141]
  |  Branch (43:53): [True: 103, False: 38]
  ------------------
   44|    148|            msg << asn1_tag_to_string(m_type_tag);
   45|    148|         } else {
   46|     38|            msg << std::to_string(static_cast<uint32_t>(m_type_tag));
   47|     38|         }
   48|       |
   49|    186|         msg << "/" << asn1_class_to_string(m_class_tag);
   50|    186|      }
   51|       |
   52|    204|      msg << " expected ";
   53|       |
   54|    204|      if(expected_class_tag == ASN1_Class::Universal || expected_class_tag == ASN1_Class::Constructed) {
  ------------------
  |  Branch (54:10): [True: 20, False: 184]
  |  Branch (54:57): [True: 178, False: 6]
  ------------------
   55|    198|         msg << asn1_tag_to_string(expected_type_tag);
   56|    198|      } else {
   57|      6|         msg << std::to_string(static_cast<uint32_t>(expected_type_tag));
   58|      6|      }
   59|       |
   60|    204|      msg << "/" << asn1_class_to_string(expected_class_tag);
   61|       |
   62|    204|      throw BER_Decoding_Error(msg.str());
   63|    204|   }
   64|  8.89k|}
_ZNK5Botan10BER_Object4is_aENS_9ASN1_TypeENS_10ASN1_ClassE:
   66|  10.9k|bool BER_Object::is_a(ASN1_Type expected_type_tag, ASN1_Class expected_class_tag) const {
   67|  10.9k|   return (m_type_tag == expected_type_tag && m_class_tag == expected_class_tag);
  ------------------
  |  Branch (67:12): [True: 9.07k, False: 1.84k]
  |  Branch (67:47): [True: 9.05k, False: 16]
  ------------------
   68|  10.9k|}
_ZN5Botan10BER_Object11set_taggingENS_9ASN1_TypeENS_10ASN1_ClassE:
   74|  12.8k|void BER_Object::set_tagging(ASN1_Type type_tag, ASN1_Class class_tag) {
   75|  12.8k|   m_type_tag = type_tag;
   76|  12.8k|   m_class_tag = class_tag;
   77|  12.8k|}
_ZN5Botan20asn1_class_to_stringENS_10ASN1_ClassE:
   79|    390|std::string asn1_class_to_string(ASN1_Class type) {
   80|    390|   switch(type) {
   81|     65|      case ASN1_Class::Universal:
  ------------------
  |  Branch (81:7): [True: 65, False: 325]
  ------------------
   82|     65|         return "UNIVERSAL";
   83|    281|      case ASN1_Class::Constructed:
  ------------------
  |  Branch (83:7): [True: 281, False: 109]
  ------------------
   84|    281|         return "CONSTRUCTED";
   85|      4|      case ASN1_Class::ContextSpecific:
  ------------------
  |  Branch (85:7): [True: 4, False: 386]
  ------------------
   86|      4|         return "CONTEXT_SPECIFIC";
   87|      5|      case ASN1_Class::Application:
  ------------------
  |  Branch (87:7): [True: 5, False: 385]
  ------------------
   88|      5|         return "APPLICATION";
   89|      3|      case ASN1_Class::Private:
  ------------------
  |  Branch (89:7): [True: 3, False: 387]
  ------------------
   90|      3|         return "PRIVATE";
   91|      0|      case ASN1_Class::NoObject:
  ------------------
  |  Branch (91:7): [True: 0, False: 390]
  ------------------
   92|      0|         return "NO_OBJECT";
   93|     32|      default:
  ------------------
  |  Branch (93:7): [True: 32, False: 358]
  ------------------
   94|     32|         return "CLASS(" + std::to_string(static_cast<size_t>(type)) + ")";
   95|    390|   }
   96|    390|}
_ZN5Botan18asn1_tag_to_stringENS_9ASN1_TypeE:
   98|    405|std::string asn1_tag_to_string(ASN1_Type type) {
   99|    405|   switch(type) {
  100|    178|      case ASN1_Type::Sequence:
  ------------------
  |  Branch (100:7): [True: 178, False: 227]
  ------------------
  101|    178|         return "SEQUENCE";
  102|       |
  103|      7|      case ASN1_Type::Set:
  ------------------
  |  Branch (103:7): [True: 7, False: 398]
  ------------------
  104|      7|         return "SET";
  105|       |
  106|      2|      case ASN1_Type::PrintableString:
  ------------------
  |  Branch (106:7): [True: 2, False: 403]
  ------------------
  107|      2|         return "PRINTABLE STRING";
  108|       |
  109|      2|      case ASN1_Type::NumericString:
  ------------------
  |  Branch (109:7): [True: 2, False: 403]
  ------------------
  110|      2|         return "NUMERIC STRING";
  111|       |
  112|      4|      case ASN1_Type::Ia5String:
  ------------------
  |  Branch (112:7): [True: 4, False: 401]
  ------------------
  113|      4|         return "IA5 STRING";
  114|       |
  115|      1|      case ASN1_Type::TeletexString:
  ------------------
  |  Branch (115:7): [True: 1, False: 404]
  ------------------
  116|      1|         return "T61 STRING";
  117|       |
  118|     55|      case ASN1_Type::Utf8String:
  ------------------
  |  Branch (118:7): [True: 55, False: 350]
  ------------------
  119|     55|         return "UTF8 STRING";
  120|       |
  121|      2|      case ASN1_Type::VisibleString:
  ------------------
  |  Branch (121:7): [True: 2, False: 403]
  ------------------
  122|      2|         return "VISIBLE STRING";
  123|       |
  124|      2|      case ASN1_Type::BmpString:
  ------------------
  |  Branch (124:7): [True: 2, False: 403]
  ------------------
  125|      2|         return "BMP STRING";
  126|       |
  127|      1|      case ASN1_Type::UniversalString:
  ------------------
  |  Branch (127:7): [True: 1, False: 404]
  ------------------
  128|      1|         return "UNIVERSAL STRING";
  129|       |
  130|      1|      case ASN1_Type::UtcTime:
  ------------------
  |  Branch (130:7): [True: 1, False: 404]
  ------------------
  131|      1|         return "UTC TIME";
  132|       |
  133|      2|      case ASN1_Type::GeneralizedTime:
  ------------------
  |  Branch (133:7): [True: 2, False: 403]
  ------------------
  134|      2|         return "GENERALIZED TIME";
  135|       |
  136|      6|      case ASN1_Type::OctetString:
  ------------------
  |  Branch (136:7): [True: 6, False: 399]
  ------------------
  137|      6|         return "OCTET STRING";
  138|       |
  139|      5|      case ASN1_Type::BitString:
  ------------------
  |  Branch (139:7): [True: 5, False: 400]
  ------------------
  140|      5|         return "BIT STRING";
  141|       |
  142|     13|      case ASN1_Type::Enumerated:
  ------------------
  |  Branch (142:7): [True: 13, False: 392]
  ------------------
  143|     13|         return "ENUMERATED";
  144|       |
  145|      5|      case ASN1_Type::Integer:
  ------------------
  |  Branch (145:7): [True: 5, False: 400]
  ------------------
  146|      5|         return "INTEGER";
  147|       |
  148|      3|      case ASN1_Type::Null:
  ------------------
  |  Branch (148:7): [True: 3, False: 402]
  ------------------
  149|      3|         return "NULL";
  150|       |
  151|      1|      case ASN1_Type::ObjectId:
  ------------------
  |  Branch (151:7): [True: 1, False: 404]
  ------------------
  152|      1|         return "OBJECT";
  153|       |
  154|      4|      case ASN1_Type::Boolean:
  ------------------
  |  Branch (154:7): [True: 4, False: 401]
  ------------------
  155|      4|         return "BOOLEAN";
  156|       |
  157|      0|      case ASN1_Type::NoObject:
  ------------------
  |  Branch (157:7): [True: 0, False: 405]
  ------------------
  158|      0|         return "NO_OBJECT";
  159|       |
  160|    111|      default:
  ------------------
  |  Branch (160:7): [True: 111, False: 294]
  ------------------
  161|    111|         return "TAG(" + std::to_string(static_cast<uint32_t>(type)) + ")";
  162|    405|   }
  163|    405|}
_ZN5Botan18BER_Decoding_ErrorC2ENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
  168|    850|BER_Decoding_Error::BER_Decoding_Error(std::string_view err) : Decoding_Error(fmt("BER: {}", err)) {}
_ZN5Botan11BER_Bad_TagC2ENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEj:
  170|     35|BER_Bad_Tag::BER_Bad_Tag(std::string_view str, uint32_t tagging) : BER_Decoding_Error(fmt("{}: {}", str, tagging)) {}
_ZN5Botan4ASN19to_stringERKNS_10BER_ObjectE:
  190|    243|std::string to_string(const BER_Object& obj) {
  191|    243|   return bytes_to_string(obj.data());
  192|    243|}

_ZN5Botan3OIDC2ESt16initializer_listIjE:
  104|    941|OID::OID(std::initializer_list<uint32_t> init) : m_id(init) {
  105|    941|   oid_valid_check(m_id);
  106|    941|}
_ZN5Botan3OID11decode_fromERNS_11BER_DecoderE:
  223|  1.89k|void OID::decode_from(BER_Decoder& decoder) {
  224|  1.89k|   const BER_Object obj = decoder.get_next_object();
  225|  1.89k|   if(obj.tagging() != (ASN1_Class::Universal | ASN1_Type::ObjectId)) {
  ------------------
  |  Branch (225:7): [True: 35, False: 1.85k]
  ------------------
  226|     35|      throw BER_Bad_Tag("Error decoding OID, unknown tag", obj.tagging());
  227|     35|   }
  228|       |
  229|  1.85k|   if(obj.length() == 0) {
  ------------------
  |  Branch (229:7): [True: 1, False: 1.85k]
  ------------------
  230|      1|      throw BER_Decoding_Error("OID encoding is too short");
  231|      1|   }
  232|       |
  233|  1.85k|   auto consume = [](BufferSlicer& data) -> uint32_t {
  234|  1.85k|      BOTAN_ASSERT_NOMSG(!data.empty());
  235|  1.85k|      uint32_t b = data.take_byte();
  236|       |
  237|  1.85k|      if(b > 0x7F) {
  238|  1.85k|         b &= 0x7F;
  239|       |
  240|       |         // Even BER requires that the OID have minimal length, ie that
  241|       |         // the first byte of a multibyte encoding cannot be zero
  242|       |         // See X.690 section 8.19.2
  243|  1.85k|         if(b == 0) {
  244|  1.85k|            throw Decoding_Error("Leading zero byte in multibyte OID encoding");
  245|  1.85k|         }
  246|       |
  247|  1.85k|         while(true) {
  248|  1.85k|            if(data.empty()) {
  249|  1.85k|               throw Decoding_Error("Truncated OID value");
  250|  1.85k|            }
  251|       |
  252|  1.85k|            const uint8_t next = data.take_byte();
  253|  1.85k|            const bool more = (next & 0x80) == 0x80;
  254|  1.85k|            const uint8_t value = next & 0x7F;
  255|       |
  256|  1.85k|            if((b >> (32 - 7)) != 0) {
  257|  1.85k|               throw Decoding_Error("OID component overflow");
  258|  1.85k|            }
  259|       |
  260|  1.85k|            b = (b << 7) | value;
  261|       |
  262|  1.85k|            if(!more) {
  263|  1.85k|               break;
  264|  1.85k|            }
  265|  1.85k|         }
  266|  1.85k|      }
  267|       |
  268|  1.85k|      return b;
  269|  1.85k|   };
  270|       |
  271|  1.85k|   BufferSlicer data(obj.data());
  272|  1.85k|   std::vector<uint32_t> parts;
  273|  11.2k|   while(!data.empty()) {
  ------------------
  |  Branch (273:10): [True: 9.41k, False: 1.85k]
  ------------------
  274|  9.41k|      const uint32_t comp = consume(data);
  275|       |
  276|  9.41k|      if(parts.empty()) {
  ------------------
  |  Branch (276:10): [True: 1.83k, False: 7.57k]
  ------------------
  277|       |         // divide into root and second arc
  278|       |
  279|  1.83k|         const uint32_t root_arc = [](uint32_t b0) -> uint32_t {
  280|  1.83k|            if(b0 < 40) {
  281|  1.83k|               return 0;
  282|  1.83k|            } else if(b0 < 80) {
  283|  1.83k|               return 1;
  284|  1.83k|            } else {
  285|  1.83k|               return 2;
  286|  1.83k|            }
  287|  1.83k|         }(comp);
  288|       |
  289|  1.83k|         parts.push_back(root_arc);
  290|  1.83k|         BOTAN_ASSERT_NOMSG(comp >= 40 * root_arc);
  ------------------
  |  |   77|  1.83k|   do {                                                                     \
  |  |   78|  1.83k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   79|  1.83k|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (79:10): [True: 0, False: 1.83k]
  |  |  ------------------
  |  |   80|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   81|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   82|      0|      }                                                                     \
  |  |   83|  1.83k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (83:12): [Folded, False: 1.83k]
  |  |  ------------------
  ------------------
  291|  1.83k|         parts.push_back(comp - 40 * root_arc);
  292|  7.57k|      } else {
  293|  7.57k|         parts.push_back(comp);
  294|  7.57k|      }
  295|  9.41k|   }
  296|       |
  297|  1.85k|   m_id = parts;
  298|  1.85k|}
asn1_oid.cpp:_ZN5Botan12_GLOBAL__N_115oid_valid_checkENSt3__14spanIKjLm18446744073709551615EEE:
   26|    941|void oid_valid_check(std::span<const uint32_t> oid) {
   27|    941|   BOTAN_ARG_CHECK(oid.size() >= 2, "OID too short to be valid");
  ------------------
  |  |   35|    941|   do {                                                          \
  |  |   36|    941|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */              \
  |  |   37|    941|      if(!(expr)) {                                              \
  |  |  ------------------
  |  |  |  Branch (37:10): [True: 0, False: 941]
  |  |  ------------------
  |  |   38|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */     \
  |  |   39|      0|         Botan::throw_invalid_argument(msg, __func__, __FILE__); \
  |  |   40|      0|      }                                                          \
  |  |   41|    941|   } while(0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 941]
  |  |  ------------------
  ------------------
   28|    941|   BOTAN_ARG_CHECK(oid[0] <= 2, "OID root out of range");
  ------------------
  |  |   35|    941|   do {                                                          \
  |  |   36|    941|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */              \
  |  |   37|    941|      if(!(expr)) {                                              \
  |  |  ------------------
  |  |  |  Branch (37:10): [True: 0, False: 941]
  |  |  ------------------
  |  |   38|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */     \
  |  |   39|      0|         Botan::throw_invalid_argument(msg, __func__, __FILE__); \
  |  |   40|      0|      }                                                          \
  |  |   41|    941|   } while(0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 941]
  |  |  ------------------
  ------------------
   29|    941|   BOTAN_ARG_CHECK(oid[1] <= 39 || oid[0] == 2, "OID second arc too large");
  ------------------
  |  |   35|    941|   do {                                                          \
  |  |   36|    941|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */              \
  |  |   37|    941|      if(!(expr)) {                                              \
  |  |  ------------------
  |  |  |  Branch (37:12): [True: 941, False: 0]
  |  |  |  Branch (37:12): [True: 0, False: 0]
  |  |  ------------------
  |  |   38|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */     \
  |  |   39|      0|         Botan::throw_invalid_argument(msg, __func__, __FILE__); \
  |  |   40|      0|      }                                                          \
  |  |   41|    941|   } while(0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 941]
  |  |  ------------------
  ------------------
   30|       |   // This last is a limitation of using 32 bit integers when decoding
   31|       |   // not a limitation of ASN.1 object identifiers in general
   32|    941|   BOTAN_ARG_CHECK(oid[1] <= 0xFFFFFFAF, "OID second arc too large");
  ------------------
  |  |   35|    941|   do {                                                          \
  |  |   36|    941|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */              \
  |  |   37|    941|      if(!(expr)) {                                              \
  |  |  ------------------
  |  |  |  Branch (37:10): [True: 0, False: 941]
  |  |  ------------------
  |  |   38|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */     \
  |  |   39|      0|         Botan::throw_invalid_argument(msg, __func__, __FILE__); \
  |  |   40|      0|      }                                                          \
  |  |   41|    941|   } while(0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 941]
  |  |  ------------------
  ------------------
   33|    941|}
asn1_oid.cpp:_ZZN5Botan3OID11decode_fromERNS_11BER_DecoderEENK3$_0clERNS_12BufferSlicerE:
  233|  9.41k|   auto consume = [](BufferSlicer& data) -> uint32_t {
  234|  9.41k|      BOTAN_ASSERT_NOMSG(!data.empty());
  ------------------
  |  |   77|  9.41k|   do {                                                                     \
  |  |   78|  9.41k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   79|  9.41k|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (79:10): [True: 0, False: 9.41k]
  |  |  ------------------
  |  |   80|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   81|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   82|      0|      }                                                                     \
  |  |   83|  9.41k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (83:12): [Folded, False: 9.41k]
  |  |  ------------------
  ------------------
  235|  9.41k|      uint32_t b = data.take_byte();
  236|       |
  237|  9.41k|      if(b > 0x7F) {
  ------------------
  |  Branch (237:10): [True: 687, False: 8.72k]
  ------------------
  238|    687|         b &= 0x7F;
  239|       |
  240|       |         // Even BER requires that the OID have minimal length, ie that
  241|       |         // the first byte of a multibyte encoding cannot be zero
  242|       |         // See X.690 section 8.19.2
  243|    687|         if(b == 0) {
  ------------------
  |  Branch (243:13): [True: 2, False: 685]
  ------------------
  244|      2|            throw Decoding_Error("Leading zero byte in multibyte OID encoding");
  245|      2|         }
  246|       |
  247|  1.35k|         while(true) {
  ------------------
  |  Branch (247:16): [True: 1.35k, Folded]
  ------------------
  248|  1.35k|            if(data.empty()) {
  ------------------
  |  Branch (248:16): [True: 16, False: 1.33k]
  ------------------
  249|     16|               throw Decoding_Error("Truncated OID value");
  250|     16|            }
  251|       |
  252|  1.33k|            const uint8_t next = data.take_byte();
  253|  1.33k|            const bool more = (next & 0x80) == 0x80;
  254|  1.33k|            const uint8_t value = next & 0x7F;
  255|       |
  256|  1.33k|            if((b >> (32 - 7)) != 0) {
  ------------------
  |  Branch (256:16): [True: 16, False: 1.32k]
  ------------------
  257|     16|               throw Decoding_Error("OID component overflow");
  258|     16|            }
  259|       |
  260|  1.32k|            b = (b << 7) | value;
  261|       |
  262|  1.32k|            if(!more) {
  ------------------
  |  Branch (262:16): [True: 653, False: 669]
  ------------------
  263|    653|               break;
  264|    653|            }
  265|  1.32k|         }
  266|    685|      }
  267|       |
  268|  9.37k|      return b;
  269|  9.41k|   };
asn1_oid.cpp:_ZZN5Botan3OID11decode_fromERNS_11BER_DecoderEENK3$_1clEj:
  279|  1.83k|         const uint32_t root_arc = [](uint32_t b0) -> uint32_t {
  280|  1.83k|            if(b0 < 40) {
  ------------------
  |  Branch (280:16): [True: 435, False: 1.40k]
  ------------------
  281|    435|               return 0;
  282|  1.40k|            } else if(b0 < 80) {
  ------------------
  |  Branch (282:23): [True: 962, False: 440]
  ------------------
  283|    962|               return 1;
  284|    962|            } else {
  285|    440|               return 2;
  286|    440|            }
  287|  1.83k|         }(comp);

_ZN5Botan11ASN1_StringC2ENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEENS_9ASN1_TypeE:
  135|    332|ASN1_String::ASN1_String(std::string_view str, ASN1_Type t) : m_utf8_str(str), m_tag(t) {
  136|    332|   if(!is_utf8_subset_string_type(m_tag)) {
  ------------------
  |  Branch (136:7): [True: 0, False: 332]
  ------------------
  137|      0|      throw Invalid_Argument("ASN1_String only supports encoding to UTF-8 or a UTF-8 subset");
  138|      0|   }
  139|       |
  140|    332|   if(!is_valid_asn1_string_content(m_utf8_str, m_tag)) {
  ------------------
  |  Branch (140:7): [True: 0, False: 332]
  ------------------
  141|      0|      throw Invalid_Argument(fmt("ASN1_String: Invalid {} encoding", asn1_tag_to_string(m_tag)));
  142|      0|   }
  143|    332|}
_ZN5Botan11ASN1_StringC2ENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
  145|    332|ASN1_String::ASN1_String(std::string_view str) : ASN1_String(str, choose_encoding(str)) {}
_ZN5Botan11ASN1_String11decode_fromERNS_11BER_DecoderE:
  162|    323|void ASN1_String::decode_from(BER_Decoder& source) {
  163|    323|   const BER_Object obj = source.get_next_object();
  164|       |
  165|    323|   if(obj.get_class() != ASN1_Class::Universal || !is_asn1_string_type(obj.type())) {
  ------------------
  |  Branch (165:7): [True: 4, False: 319]
  |  Branch (165:51): [True: 62, False: 257]
  ------------------
  166|     66|      auto typ = static_cast<uint32_t>(obj.type());
  167|     66|      auto cls = static_cast<uint32_t>(obj.get_class());
  168|     66|      throw Decoding_Error(fmt("ASN1_String: Unknown string type {}/{}", typ, cls));
  169|     66|   }
  170|       |
  171|    257|   m_tag = obj.type();
  172|    257|   m_data.assign(obj.bits(), obj.bits() + obj.length());
  173|       |
  174|    257|   if(m_tag == ASN1_Type::BmpString) {
  ------------------
  |  Branch (174:7): [True: 50, False: 207]
  ------------------
  175|     50|      m_utf8_str = ucs2_to_utf8(m_data.data(), m_data.size());
  176|    207|   } else if(m_tag == ASN1_Type::UniversalString) {
  ------------------
  |  Branch (176:14): [True: 83, False: 124]
  ------------------
  177|     83|      m_utf8_str = ucs4_to_utf8(m_data.data(), m_data.size());
  178|    124|   } else if(m_tag == ASN1_Type::TeletexString) {
  ------------------
  |  Branch (178:14): [True: 11, False: 113]
  ------------------
  179|       |      /*
  180|       |      TeletexString is nominally ITU T.61 not ISO-8859-1 but it seems
  181|       |      the majority of implementations actually used that charset here.
  182|       |      */
  183|     11|      m_utf8_str = latin1_to_utf8(m_data.data(), m_data.size());
  184|    113|   } else {
  185|       |      // All other supported string types are UTF-8 or some subset thereof
  186|    113|      m_utf8_str = ASN1::to_string(obj);
  187|       |
  188|    113|      if(!is_valid_asn1_string_content(m_utf8_str, m_tag)) {
  ------------------
  |  Branch (188:10): [True: 59, False: 54]
  ------------------
  189|     59|         throw Decoding_Error(fmt("ASN1_String: Invalid {} encoding", asn1_tag_to_string(m_tag)));
  190|     59|      }
  191|    113|   }
  192|    257|}
asn1_str.cpp:_ZN5Botan12_GLOBAL__N_119is_asn1_string_typeENS_9ASN1_TypeE:
   99|    319|bool is_asn1_string_type(ASN1_Type tag) {
  100|    319|   return (is_utf8_subset_string_type(tag) || tag == ASN1_Type::TeletexString || tag == ASN1_Type::BmpString ||
  ------------------
  |  Branch (100:12): [True: 113, False: 206]
  |  Branch (100:47): [True: 11, False: 195]
  |  Branch (100:82): [True: 50, False: 145]
  ------------------
  101|    145|           tag == ASN1_Type::UniversalString);
  ------------------
  |  Branch (101:12): [True: 83, False: 62]
  ------------------
  102|    319|}
asn1_str.cpp:_ZN5Botan12_GLOBAL__N_126is_utf8_subset_string_typeENS_9ASN1_TypeE:
   94|  1.09k|bool is_utf8_subset_string_type(ASN1_Type tag) {
   95|  1.09k|   return (tag == ASN1_Type::NumericString || tag == ASN1_Type::PrintableString || tag == ASN1_Type::VisibleString ||
  ------------------
  |  Branch (95:12): [True: 4, False: 1.09k]
  |  Branch (95:47): [True: 676, False: 416]
  |  Branch (95:84): [True: 2, False: 414]
  ------------------
   96|    414|           tag == ASN1_Type::Ia5String || tag == ASN1_Type::Utf8String);
  ------------------
  |  Branch (96:12): [True: 10, False: 404]
  |  Branch (96:43): [True: 198, False: 206]
  ------------------
   97|  1.09k|}
asn1_str.cpp:_ZN5Botan12_GLOBAL__N_128is_valid_asn1_string_contentERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS_9ASN1_TypeE:
  104|    445|bool is_valid_asn1_string_content(const std::string& str, ASN1_Type tag) {
  105|    445|   BOTAN_ASSERT_NOMSG(is_utf8_subset_string_type(tag));
  ------------------
  |  |   77|    445|   do {                                                                     \
  |  |   78|    445|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   79|    445|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (79:10): [True: 0, False: 445]
  |  |  ------------------
  |  |   80|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   81|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   82|      0|      }                                                                     \
  |  |   83|    445|   } while(0)
  |  |  ------------------
  |  |  |  Branch (83:12): [Folded, False: 445]
  |  |  ------------------
  ------------------
  106|       |
  107|    445|   switch(tag) {
  108|     99|      case ASN1_Type::Utf8String:
  ------------------
  |  Branch (108:7): [True: 99, False: 346]
  ------------------
  109|     99|         return is_valid_utf8(str);
  110|      2|      case ASN1_Type::NumericString:
  ------------------
  |  Branch (110:7): [True: 2, False: 443]
  ------------------
  111|    340|      case ASN1_Type::PrintableString:
  ------------------
  |  Branch (111:7): [True: 338, False: 107]
  ------------------
  112|    345|      case ASN1_Type::Ia5String:
  ------------------
  |  Branch (112:7): [True: 5, False: 440]
  ------------------
  113|    346|      case ASN1_Type::VisibleString:
  ------------------
  |  Branch (113:7): [True: 1, False: 444]
  ------------------
  114|    346|         return g_char_validator.valid_encoding(str, tag);
  115|      0|      default:
  ------------------
  |  Branch (115:7): [True: 0, False: 445]
  ------------------
  116|      0|         return false;
  117|    445|   }
  118|    445|}
asn1_str.cpp:_ZNK5Botan12_GLOBAL__N_131ASN1_String_Codepoint_Validator14valid_encodingENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEENS_9ASN1_TypeE:
   25|    678|      constexpr bool valid_encoding(std::string_view str, ASN1_Type tag) const {
   26|    678|         const uint8_t mask = mask_for(tag);
   27|    678|         for(const char c : str) {
  ------------------
  |  Branch (27:27): [True: 23, False: 672]
  ------------------
   28|     23|            const uint8_t codepoint = static_cast<uint8_t>(c);
   29|     23|            const bool is_valid = (m_table[codepoint] & mask) != 0;
   30|       |
   31|     23|            if(!is_valid) {
  ------------------
  |  Branch (31:16): [True: 6, False: 17]
  ------------------
   32|      6|               return false;
   33|      6|            }
   34|     23|         }
   35|       |
   36|    672|         return true;
   37|    678|      }
asn1_str.cpp:_ZN5Botan12_GLOBAL__N_131ASN1_String_Codepoint_Validator8mask_forENS_9ASN1_TypeE:
   45|    678|      static constexpr uint8_t mask_for(ASN1_Type tag) {
   46|    678|         switch(tag) {
   47|      2|            case ASN1_Type::NumericString:
  ------------------
  |  Branch (47:13): [True: 2, False: 676]
  ------------------
   48|      2|               return Numeric_String;
   49|    670|            case ASN1_Type::PrintableString:
  ------------------
  |  Branch (49:13): [True: 670, False: 8]
  ------------------
   50|    670|               return Printable_String;
   51|      5|            case ASN1_Type::Ia5String:
  ------------------
  |  Branch (51:13): [True: 5, False: 673]
  ------------------
   52|      5|               return IA5_String;
   53|      1|            case ASN1_Type::VisibleString:
  ------------------
  |  Branch (53:13): [True: 1, False: 677]
  ------------------
   54|      1|               return Visible_String;
   55|      0|            default:
  ------------------
  |  Branch (55:13): [True: 0, False: 678]
  ------------------
   56|      0|               return 0;
   57|    678|         }
   58|    678|      }
asn1_str.cpp:_ZN5Botan12_GLOBAL__N_115choose_encodingENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
  120|    332|ASN1_Type choose_encoding(std::string_view str) {
  121|    332|   if(g_char_validator.valid_encoding(str, ASN1_Type::PrintableString)) {
  ------------------
  |  Branch (121:7): [True: 332, False: 0]
  ------------------
  122|    332|      return ASN1_Type::PrintableString;
  123|    332|   } else {
  124|      0|      return ASN1_Type::Utf8String;
  125|      0|   }
  126|    332|}

_ZN5Botan9ASN1_Time11decode_fromERNS_11BER_DecoderE:
   59|    312|void ASN1_Time::decode_from(BER_Decoder& source) {
   60|    312|   const BER_Object ber_time = source.get_next_object();
   61|       |
   62|    312|   if(ber_time.get_class() != ASN1_Class::Universal ||
  ------------------
  |  Branch (62:7): [True: 129, False: 183]
  ------------------
   63|    183|      (ber_time.type() != ASN1_Type::UtcTime && ber_time.type() != ASN1_Type::GeneralizedTime)) {
  ------------------
  |  Branch (63:8): [True: 97, False: 86]
  |  Branch (63:49): [True: 53, False: 44]
  ------------------
   64|    181|      throw Decoding_Error(fmt("ASN1_Time: Unexpected tag {}/{}",
   65|    181|                               static_cast<uint32_t>(ber_time.type()),
   66|    181|                               static_cast<uint32_t>(ber_time.get_class())));
   67|    181|   }
   68|       |
   69|    131|   try {
   70|    131|      set_to(ASN1::to_string(ber_time), ber_time.type());
   71|    131|   } catch(Invalid_Argument& e) {
   72|    107|      throw Decoding_Error(fmt("Invalid ASN1_Time encoding: {}", e.what()));
   73|    107|   }
   74|    131|}
_ZN5Botan9ASN1_Time6set_toENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEENS_9ASN1_TypeE:
  176|    130|void ASN1_Time::set_to(std::string_view t_spec, ASN1_Type spec_tag) {
  177|    130|   BOTAN_ARG_CHECK(spec_tag == ASN1_Type::UtcTime || spec_tag == ASN1_Type::GeneralizedTime,
  ------------------
  |  |   35|    130|   do {                                                          \
  |  |   36|    130|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */              \
  |  |   37|    174|      if(!(expr)) {                                              \
  |  |  ------------------
  |  |  |  Branch (37:12): [True: 86, False: 44]
  |  |  |  Branch (37:12): [True: 44, False: 0]
  |  |  ------------------
  |  |   38|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */     \
  |  |   39|      0|         Botan::throw_invalid_argument(msg, __func__, __FILE__); \
  |  |   40|      0|      }                                                          \
  |  |   41|    130|   } while(0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 130]
  |  |  ------------------
  ------------------
  178|    130|                   "Invalid tag for ASN1_Time");
  179|       |
  180|    130|   if(spec_tag == ASN1_Type::GeneralizedTime) {
  ------------------
  |  Branch (180:7): [True: 44, False: 86]
  ------------------
  181|     44|      BOTAN_ARG_CHECK(t_spec.size() == 15, "Invalid GeneralizedTime input string");
  ------------------
  |  |   35|     44|   do {                                                          \
  |  |   36|     44|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */              \
  |  |   37|     44|      if(!(expr)) {                                              \
  |  |  ------------------
  |  |  |  Branch (37:10): [True: 4, False: 40]
  |  |  ------------------
  |  |   38|      4|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */     \
  |  |   39|      4|         Botan::throw_invalid_argument(msg, __func__, __FILE__); \
  |  |   40|      4|      }                                                          \
  |  |   41|     44|   } while(0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 44]
  |  |  ------------------
  ------------------
  182|     86|   } else if(spec_tag == ASN1_Type::UtcTime) {
  ------------------
  |  Branch (182:14): [True: 86, False: 0]
  ------------------
  183|     86|      BOTAN_ARG_CHECK(t_spec.size() == 13, "Invalid UTCTime input string");
  ------------------
  |  |   35|     86|   do {                                                          \
  |  |   36|     86|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */              \
  |  |   37|     86|      if(!(expr)) {                                              \
  |  |  ------------------
  |  |  |  Branch (37:10): [True: 8, False: 78]
  |  |  ------------------
  |  |   38|      8|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */     \
  |  |   39|      8|         Botan::throw_invalid_argument(msg, __func__, __FILE__); \
  |  |   40|      8|      }                                                          \
  |  |   41|     86|   } while(0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 86]
  |  |  ------------------
  ------------------
  184|     86|   }
  185|       |
  186|    130|   BOTAN_ARG_CHECK(t_spec.back() == 'Z', "Botan does not support ASN1 times with timezones other than Z");
  ------------------
  |  |   35|    130|   do {                                                          \
  |  |   36|    130|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */              \
  |  |   37|    130|      if(!(expr)) {                                              \
  |  |  ------------------
  |  |  |  Branch (37:10): [True: 11, False: 119]
  |  |  ------------------
  |  |   38|     11|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */     \
  |  |   39|     11|         Botan::throw_invalid_argument(msg, __func__, __FILE__); \
  |  |   40|     11|      }                                                          \
  |  |   41|    130|   } while(0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 130]
  |  |  ------------------
  ------------------
  187|       |
  188|    130|   const size_t field_len = 2;
  189|       |
  190|    130|   const size_t year_start = 0;
  191|    130|   const size_t year_len = (spec_tag == ASN1_Type::UtcTime) ? 2 : 4;
  ------------------
  |  Branch (191:28): [True: 70, False: 60]
  ------------------
  192|    130|   const size_t month_start = year_start + year_len;
  193|    130|   const size_t day_start = month_start + field_len;
  194|    130|   const size_t hour_start = day_start + field_len;
  195|    130|   const size_t min_start = hour_start + field_len;
  196|    130|   const size_t sec_start = min_start + field_len;
  197|       |
  198|    130|   m_year = to_u32bit(t_spec.substr(year_start, year_len));
  199|    130|   m_month = to_u32bit(t_spec.substr(month_start, field_len));
  200|    130|   m_day = to_u32bit(t_spec.substr(day_start, field_len));
  201|    130|   m_hour = to_u32bit(t_spec.substr(hour_start, field_len));
  202|    130|   m_minute = to_u32bit(t_spec.substr(min_start, field_len));
  203|    130|   m_second = to_u32bit(t_spec.substr(sec_start, field_len));
  204|    130|   m_tag = spec_tag;
  205|       |
  206|    130|   if(spec_tag == ASN1_Type::UtcTime) {
  ------------------
  |  Branch (206:7): [True: 55, False: 75]
  ------------------
  207|     55|      if(m_year >= 50) {
  ------------------
  |  Branch (207:10): [True: 12, False: 43]
  ------------------
  208|     12|         m_year += 1900;
  209|     43|      } else {
  210|     43|         m_year += 2000;
  211|     43|      }
  212|     55|   }
  213|       |
  214|    130|   if(!passes_sanity_check()) {
  ------------------
  |  Branch (214:7): [True: 64, False: 66]
  ------------------
  215|     64|      throw Invalid_Argument(fmt("ASN1_Time string '{}' does not seem to be valid", t_spec));
  216|     64|   }
  217|    130|}
_ZNK5Botan9ASN1_Time19passes_sanity_checkEv:
  222|     87|bool ASN1_Time::passes_sanity_check() const {
  223|       |   // AppVeyor's trust store includes a cert with expiration date in 3016 ...
  224|     87|   if(m_year < 1950 || m_year > 3100) {
  ------------------
  |  Branch (224:7): [True: 12, False: 75]
  |  Branch (224:24): [True: 7, False: 68]
  ------------------
  225|     19|      return false;
  226|     19|   }
  227|     68|   if(m_month == 0 || m_month > 12) {
  ------------------
  |  Branch (227:7): [True: 3, False: 65]
  |  Branch (227:23): [True: 10, False: 55]
  ------------------
  228|     13|      return false;
  229|     13|   }
  230|       |
  231|     55|   const uint32_t days_in_month[12] = {31, 28 + 1, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
  232|       |
  233|     55|   if(m_day == 0 || m_day > days_in_month[m_month - 1]) {
  ------------------
  |  Branch (233:7): [True: 3, False: 52]
  |  Branch (233:21): [True: 11, False: 41]
  ------------------
  234|     14|      return false;
  235|     14|   }
  236|       |
  237|     41|   if(m_month == 2 && m_day == 29) {
  ------------------
  |  Branch (237:7): [True: 17, False: 24]
  |  Branch (237:23): [True: 8, False: 9]
  ------------------
  238|      8|      if(m_year % 4 != 0) {
  ------------------
  |  Branch (238:10): [True: 2, False: 6]
  ------------------
  239|      2|         return false;  // not a leap year
  240|      2|      }
  241|       |
  242|      6|      if(m_year % 100 == 0 && m_year % 400 != 0) {
  ------------------
  |  Branch (242:10): [True: 3, False: 3]
  |  Branch (242:31): [True: 1, False: 2]
  ------------------
  243|      1|         return false;
  244|      1|      }
  245|      6|   }
  246|       |
  247|     38|   if(m_hour >= 24 || m_minute >= 60 || m_second > 60) {
  ------------------
  |  Branch (247:7): [True: 8, False: 30]
  |  Branch (247:23): [True: 3, False: 27]
  |  Branch (247:41): [True: 3, False: 24]
  ------------------
  248|     14|      return false;
  249|     14|   }
  250|       |
  251|     24|   if(m_tag == ASN1_Type::UtcTime) {
  ------------------
  |  Branch (251:7): [True: 20, False: 4]
  ------------------
  252|       |      /*
  253|       |      UTCTime limits the value of components such that leap seconds
  254|       |      are not covered. See "UNIVERSAL 23" in "Information technology
  255|       |      Abstract Syntax Notation One (ASN.1): Specification of basic notation"
  256|       |
  257|       |      http://www.itu.int/ITU-T/studygroups/com17/languages/
  258|       |      */
  259|     20|      if(m_second > 59) {
  ------------------
  |  Branch (259:10): [True: 1, False: 19]
  ------------------
  260|      1|         return false;
  261|      1|      }
  262|     20|   }
  263|       |
  264|     23|   return true;
  265|     24|}

_ZN5Botan11BER_DecoderD2Ev:
  366|  9.81k|BER_Decoder::~BER_Decoder() = default;
_ZNK5Botan11BER_Decoder10more_itemsEv:
  371|  1.93k|bool BER_Decoder::more_items() const {
  372|  1.93k|   if(m_source->end_of_data() && !m_pushed.is_set()) {
  ------------------
  |  Branch (372:7): [True: 285, False: 1.65k]
  |  Branch (372:34): [True: 285, False: 0]
  ------------------
  373|    285|      return false;
  374|    285|   }
  375|  1.65k|   return true;
  376|  1.93k|}
_ZN5Botan11BER_Decoder10verify_endEv:
  381|  1.31k|BER_Decoder& BER_Decoder::verify_end() {
  382|  1.31k|   return verify_end("BER_Decoder::verify_end called, but data remains");
  383|  1.31k|}
_ZN5Botan11BER_Decoder10verify_endENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
  388|  1.31k|BER_Decoder& BER_Decoder::verify_end(std::string_view err) {
  389|  1.31k|   if(!m_source->end_of_data() || m_pushed.is_set()) {
  ------------------
  |  Branch (389:7): [True: 26, False: 1.29k]
  |  Branch (389:35): [True: 48, False: 1.24k]
  ------------------
  390|     74|      throw Decoding_Error(err);
  391|     74|   }
  392|  1.24k|   return (*this);
  393|  1.31k|}
_ZN5Botan11BER_Decoder14read_next_byteEv:
  405|  16.9k|std::optional<uint8_t> BER_Decoder::read_next_byte() {
  406|  16.9k|   BOTAN_ASSERT_NOMSG(m_source != nullptr);
  ------------------
  |  |   77|  16.9k|   do {                                                                     \
  |  |   78|  16.9k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   79|  16.9k|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (79:10): [True: 0, False: 16.9k]
  |  |  ------------------
  |  |   80|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   81|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   82|      0|      }                                                                     \
  |  |   83|  16.9k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (83:12): [Folded, False: 16.9k]
  |  |  ------------------
  ------------------
  407|  16.9k|   uint8_t b = 0;
  408|  16.9k|   if(m_source->read_byte(b) != 0) {
  ------------------
  |  Branch (408:7): [True: 15.3k, False: 1.59k]
  ------------------
  409|  15.3k|      return b;
  410|  15.3k|   } else {
  411|  1.59k|      return {};
  412|  1.59k|   }
  413|  16.9k|}
_ZN5Botan11BER_Decoder15get_next_objectEv:
  426|  13.8k|BER_Object BER_Decoder::get_next_object() {
  427|  13.8k|   BER_Object next;
  428|       |
  429|  13.8k|   if(m_pushed.is_set()) {
  ------------------
  |  Branch (429:7): [True: 933, False: 12.8k]
  ------------------
  430|    933|      std::swap(next, m_pushed);
  431|    933|      return next;
  432|    933|   }
  433|       |
  434|  12.8k|   for(;;) {
  435|  12.8k|      ASN1_Type type_tag = ASN1_Type::NoObject;
  436|  12.8k|      ASN1_Class class_tag = ASN1_Class::NoObject;
  437|  12.8k|      decode_tag(m_source, type_tag, class_tag);
  438|  12.8k|      next.set_tagging(type_tag, class_tag);
  439|  12.8k|      if(next.is_set() == false) {  // no more objects
  ------------------
  |  Branch (439:10): [True: 799, False: 12.0k]
  ------------------
  440|    799|         return next;
  441|    799|      }
  442|       |
  443|  12.0k|      const size_t allow_indef = m_limits.allow_ber_encoding() ? m_limits.max_nested_indefinite_length() : 0;
  ------------------
  |  Branch (443:34): [True: 0, False: 12.0k]
  ------------------
  444|  12.0k|      const bool der_mode = m_limits.require_der_encoding();
  445|  12.0k|      const auto dl = decode_length(m_source, allow_indef, der_mode, is_constructed(class_tag));
  446|       |
  447|       |      // Per X.690 8.1.5 the only valid EOC encoding is the two-octet
  448|       |      // sequence 0x00 0x00. Reject any other length encoding on a tag of
  449|       |      // (Eoc, Universal) before we consume the "content" bytes.
  450|  12.0k|      if(type_tag == ASN1_Type::Eoc && class_tag == ASN1_Class::Universal &&
  ------------------
  |  Branch (450:10): [True: 1.02k, False: 11.0k]
  |  Branch (450:40): [True: 42, False: 986]
  ------------------
  451|     42|         (dl.content_length() != 0 || dl.indefinite_length())) {
  ------------------
  |  Branch (451:11): [True: 38, False: 4]
  |  Branch (451:39): [True: 0, False: 4]
  ------------------
  452|     38|         throw BER_Decoding_Error("EOC marker with non-zero length");
  453|     38|      }
  454|       |
  455|  12.0k|      if(!m_source->check_available(dl.total_length())) {
  ------------------
  |  Branch (455:10): [True: 157, False: 11.8k]
  ------------------
  456|    157|         throw BER_Decoding_Error("Value truncated");
  457|    157|      }
  458|       |
  459|  11.8k|      uint8_t* out = next.mutable_bits(dl.content_length());
  460|  11.8k|      if(m_source->read(out, dl.content_length()) != dl.content_length()) {
  ------------------
  |  Branch (460:10): [True: 0, False: 11.8k]
  ------------------
  461|      0|         throw BER_Decoding_Error("Value truncated");
  462|      0|      }
  463|       |
  464|  11.8k|      if(dl.indefinite_length()) {
  ------------------
  |  Branch (464:10): [True: 0, False: 11.8k]
  ------------------
  465|       |         // After reading the data consume the 2-byte EOC
  466|      0|         uint8_t eoc[2] = {0xFF, 0xFF};
  467|      0|         if(m_source->read(eoc, 2) != 2 || eoc[0] != 0x00 || eoc[1] != 0x00) {
  ------------------
  |  Branch (467:13): [True: 0, False: 0]
  |  Branch (467:44): [True: 0, False: 0]
  |  Branch (467:62): [True: 0, False: 0]
  ------------------
  468|      0|            throw BER_Decoding_Error("Missing or malformed EOC marker");
  469|      0|         }
  470|      0|      }
  471|       |
  472|  11.8k|      if(next.tagging() == static_cast<uint32_t>(ASN1_Type::Eoc)) {
  ------------------
  |  Branch (472:10): [True: 4, False: 11.8k]
  ------------------
  473|      4|         if(m_limits.require_der_encoding()) {
  ------------------
  |  Branch (473:13): [True: 4, False: 0]
  ------------------
  474|      4|            throw BER_Decoding_Error("Detected EOC marker in DER structure");
  475|      4|         }
  476|      0|         continue;
  477|  11.8k|      } else {
  478|  11.8k|         break;
  479|  11.8k|      }
  480|  11.8k|   }
  481|       |
  482|  11.8k|   return next;
  483|  12.8k|}
_ZN5Botan11BER_Decoder9push_backERKNS_10BER_ObjectE:
  500|    595|void BER_Decoder::push_back(const BER_Object& obj) {
  501|    595|   if(m_pushed.is_set()) {
  ------------------
  |  Branch (501:7): [True: 0, False: 595]
  ------------------
  502|      0|      throw Invalid_State("BER_Decoder: Only one push back is allowed");
  503|      0|   }
  504|    595|   m_pushed = obj;
  505|    595|}
_ZN5Botan11BER_Decoder9push_backEONS_10BER_ObjectE:
  507|  1.05k|void BER_Decoder::push_back(BER_Object&& obj) {
  508|  1.05k|   if(m_pushed.is_set()) {
  ------------------
  |  Branch (508:7): [True: 0, False: 1.05k]
  ------------------
  509|      0|      throw Invalid_State("BER_Decoder: Only one push back is allowed");
  510|      0|   }
  511|  1.05k|   m_pushed = std::move(obj);
  512|  1.05k|}
_ZN5Botan11BER_Decoder10start_consENS_9ASN1_TypeENS_10ASN1_ClassE:
  514|  6.65k|BER_Decoder BER_Decoder::start_cons(ASN1_Type type_tag, ASN1_Class class_tag) {
  515|  6.65k|   BER_Object obj = get_next_object();
  516|  6.65k|   obj.assert_is_a(type_tag, class_tag | ASN1_Class::Constructed);
  517|  6.65k|   BER_Decoder child(std::move(obj), this);
  518|  6.65k|   return child;
  519|  6.65k|}
_ZN5Botan11BER_Decoder8end_consEv:
  524|  1.74k|BER_Decoder& BER_Decoder::end_cons() {
  525|  1.74k|   if(m_parent == nullptr) {
  ------------------
  |  Branch (525:7): [True: 0, False: 1.74k]
  ------------------
  526|      0|      throw Invalid_State("BER_Decoder::end_cons called with null parent");
  527|      0|   }
  528|  1.74k|   if(!m_source->end_of_data() || m_pushed.is_set()) {
  ------------------
  |  Branch (528:7): [True: 7, False: 1.73k]
  |  Branch (528:35): [True: 0, False: 1.73k]
  ------------------
  529|      7|      throw Decoding_Error("BER_Decoder::end_cons called with data left");
  530|      7|   }
  531|  1.73k|   return (*m_parent);
  532|  1.74k|}
_ZN5Botan11BER_DecoderC2EONS_10BER_ObjectEPS0_:
  535|  6.16k|      m_limits(parent != nullptr ? parent->limits() : BER_Decoder::Limits::BER()), m_parent(parent) {
  ------------------
  |  Branch (535:16): [True: 6.16k, False: 0]
  ------------------
  536|  6.16k|   m_data_src = std::make_unique<DataSource_BERObject>(std::move(obj));
  537|  6.16k|   m_source = m_data_src.get();
  538|  6.16k|}
_ZN5Botan11BER_DecoderC2ENSt3__14spanIKhLm18446744073709551615EEENS0_6LimitsE:
  548|  3.64k|BER_Decoder::BER_Decoder(std::span<const uint8_t> buf, Limits limits) : m_limits(limits) {
  549|  3.64k|   m_data_src = std::make_unique<DataSource_Memory>(buf);
  550|  3.64k|   m_source = m_data_src.get();
  551|  3.64k|}
_ZN5Botan11BER_Decoder6decodeERNS_11ASN1_ObjectENS_9ASN1_TypeENS_10ASN1_ClassE:
  560|  3.50k|BER_Decoder& BER_Decoder::decode(ASN1_Object& obj, ASN1_Type /*unused*/, ASN1_Class /*unused*/) {
  561|  3.50k|   obj.decode_from(*this);
  562|  3.50k|   return (*this);
  563|  3.50k|}
_ZN5Botan11BER_Decoder6decodeERmNS_9ASN1_TypeENS_10ASN1_ClassE:
  610|  1.34k|BER_Decoder& BER_Decoder::decode(size_t& out, ASN1_Type type_tag, ASN1_Class class_tag) {
  611|  1.34k|   BigInt integer;
  612|  1.34k|   decode(integer, type_tag, class_tag);
  613|       |
  614|  1.34k|   if(integer.signum() < 0) {
  ------------------
  |  Branch (614:7): [True: 106, False: 1.24k]
  ------------------
  615|    106|      throw BER_Decoding_Error("Decoded small integer value was negative");
  616|    106|   }
  617|       |
  618|  1.24k|   if(integer.bits() > 32) {
  ------------------
  |  Branch (618:7): [True: 90, False: 1.15k]
  ------------------
  619|     90|      throw BER_Decoding_Error("Decoded integer value larger than expected");
  620|     90|   }
  621|       |
  622|  1.15k|   out = 0;
  623|  5.35k|   for(size_t i = 0; i != 4; ++i) {
  ------------------
  |  Branch (623:22): [True: 4.20k, False: 1.15k]
  ------------------
  624|  4.20k|      out = (out << 8) | integer.byte_at(3 - i);
  625|  4.20k|   }
  626|       |
  627|  1.15k|   return (*this);
  628|  1.24k|}
_ZN5Botan11BER_Decoder6decodeERNS_6BigIntENS_9ASN1_TypeENS_10ASN1_ClassE:
  660|  1.34k|BER_Decoder& BER_Decoder::decode(BigInt& out, ASN1_Type type_tag, ASN1_Class class_tag) {
  661|  1.34k|   const BER_Object obj = get_next_object();
  662|  1.34k|   obj.assert_is_a(type_tag, class_tag);
  663|       |
  664|       |   // DER requires minimal INTEGER encoding (X.690 section 8.3.2)
  665|  1.34k|   if(m_limits.require_der_encoding()) {
  ------------------
  |  Branch (665:7): [True: 1.26k, False: 82]
  ------------------
  666|  1.26k|      if(obj.length() == 0) {
  ------------------
  |  Branch (666:10): [True: 4, False: 1.26k]
  ------------------
  667|      4|         throw BER_Decoding_Error("Detected empty INTEGER encoding in DER structure");
  668|      4|      }
  669|  1.26k|      if(obj.length() > 1) {
  ------------------
  |  Branch (669:10): [True: 259, False: 1.00k]
  ------------------
  670|    259|         if(obj.bits()[0] == 0x00 && (obj.bits()[1] & 0x80) == 0) {
  ------------------
  |  Branch (670:13): [True: 54, False: 205]
  |  Branch (670:38): [True: 5, False: 49]
  ------------------
  671|      5|            throw BER_Decoding_Error("Detected non-minimal INTEGER encoding in DER structure");
  672|      5|         }
  673|    254|         if(obj.bits()[0] == 0xFF && (obj.bits()[1] & 0x80) != 0) {
  ------------------
  |  Branch (673:13): [True: 23, False: 231]
  |  Branch (673:38): [True: 9, False: 14]
  ------------------
  674|      9|            throw BER_Decoding_Error("Detected non-minimal INTEGER encoding in DER structure");
  675|      9|         }
  676|    254|      }
  677|  1.26k|   }
  678|       |
  679|  1.32k|   if(obj.length() == 0) {
  ------------------
  |  Branch (679:7): [True: 0, False: 1.32k]
  ------------------
  680|      0|      out.clear();
  681|  1.32k|   } else {
  682|  1.32k|      const uint8_t first = obj.bits()[0];
  683|  1.32k|      const bool negative = (first & 0x80) == 0x80;
  684|       |
  685|  1.32k|      if(negative) {
  ------------------
  |  Branch (685:10): [True: 106, False: 1.22k]
  ------------------
  686|    106|         secure_vector<uint8_t> vec(obj.bits(), obj.bits() + obj.length());
  687|    411|         for(size_t i = obj.length(); i > 0; --i) {
  ------------------
  |  Branch (687:39): [True: 411, False: 0]
  ------------------
  688|    411|            const bool gt0 = (vec[i - 1] > 0);
  689|    411|            vec[i - 1] -= 1;
  690|    411|            if(gt0) {
  ------------------
  |  Branch (690:16): [True: 106, False: 305]
  ------------------
  691|    106|               break;
  692|    106|            }
  693|    411|         }
  694|  28.1k|         for(size_t i = 0; i != obj.length(); ++i) {
  ------------------
  |  Branch (694:28): [True: 28.0k, False: 106]
  ------------------
  695|  28.0k|            vec[i] = ~vec[i];
  696|  28.0k|         }
  697|    106|         out._assign_from_bytes(vec);
  698|    106|         out.flip_sign();
  699|  1.22k|      } else {
  700|  1.22k|         out._assign_from_bytes(obj.data());
  701|  1.22k|      }
  702|  1.32k|   }
  703|       |
  704|  1.32k|   return (*this);
  705|  1.34k|}
_ZN5Botan11BER_Decoder6decodeERNSt3__16vectorIhNS1_9allocatorIhEEEENS_9ASN1_TypeES7_NS_10ASN1_ClassE:
  782|  1.26k|                                 ASN1_Class class_tag) {
  783|  1.26k|   if(real_type != ASN1_Type::OctetString && real_type != ASN1_Type::BitString) {
  ------------------
  |  Branch (783:7): [True: 624, False: 645]
  |  Branch (783:46): [True: 0, False: 624]
  ------------------
  784|      0|      throw BER_Bad_Tag("Bad tag for {BIT,OCTET} STRING", static_cast<uint32_t>(real_type));
  785|      0|   }
  786|       |
  787|  1.26k|   asn1_decode_binary_string(
  788|  1.26k|      buffer, get_next_object(), real_type, type_tag, class_tag, m_limits.require_der_encoding());
  789|  1.26k|   return (*this);
  790|  1.26k|}
ber_dec.cpp:_ZN5Botan12_GLOBAL__N_110decode_tagEPNS_10DataSourceERNS_9ASN1_TypeERNS_10ASN1_ClassE:
   27|  12.8k|size_t decode_tag(DataSource* ber, ASN1_Type& type_tag, ASN1_Class& class_tag) {
   28|  12.8k|   auto b = ber->read_byte();
   29|       |
   30|  12.8k|   if(!b) {
  ------------------
  |  Branch (30:7): [True: 799, False: 12.0k]
  ------------------
   31|    799|      type_tag = ASN1_Type::NoObject;
   32|    799|      class_tag = ASN1_Class::NoObject;
   33|    799|      return 0;
   34|    799|   }
   35|       |
   36|  12.0k|   if((*b & 0x1F) != 0x1F) {
  ------------------
  |  Branch (36:7): [True: 11.6k, False: 428]
  ------------------
   37|  11.6k|      type_tag = ASN1_Type(*b & 0x1F);
   38|  11.6k|      class_tag = ASN1_Class(*b & 0xE0);
   39|  11.6k|      return 1;
   40|  11.6k|   }
   41|       |
   42|    428|   size_t tag_bytes = 1;
   43|    428|   class_tag = ASN1_Class(*b & 0xE0);
   44|       |
   45|    428|   uint32_t tag_buf = 0;
   46|  1.45k|   while(true) {
  ------------------
  |  Branch (46:10): [True: 1.45k, Folded]
  ------------------
   47|  1.45k|      b = ber->read_byte();
   48|  1.45k|      if(!b) {
  ------------------
  |  Branch (48:10): [True: 15, False: 1.43k]
  ------------------
   49|     15|         throw BER_Decoding_Error("Long-form tag truncated");
   50|     15|      }
   51|  1.43k|      if((tag_buf >> 24) != 0) {
  ------------------
  |  Branch (51:10): [True: 9, False: 1.42k]
  ------------------
   52|      9|         throw BER_Decoding_Error("Long-form tag overflowed 32 bits");
   53|      9|      }
   54|       |      // This is required even by BER (see X.690 section 8.1.2.4.2 sentence c).
   55|       |      // Bits 7-1 of the first subsequent octet must not be all zero; this rules
   56|       |      // out both 0x80 (continuation with no data) and 0x00 (a long-form encoding
   57|       |      // of tag value 0, which collides with the EOC marker).
   58|  1.42k|      if(tag_bytes == 1 && (*b & 0x7F) == 0) {
  ------------------
  |  Branch (58:10): [True: 425, False: 1.00k]
  |  Branch (58:28): [True: 1, False: 424]
  ------------------
   59|      1|         throw BER_Decoding_Error("Long form tag with leading zero");
   60|      1|      }
   61|  1.42k|      ++tag_bytes;
   62|  1.42k|      tag_buf = (tag_buf << 7) | (*b & 0x7F);
   63|  1.42k|      if((*b & 0x80) == 0) {
  ------------------
  |  Branch (63:10): [True: 403, False: 1.02k]
  ------------------
   64|    403|         break;
   65|    403|      }
   66|  1.42k|   }
   67|       |   // Per X.690 8.1.2.2, tag values 0-30 shall be encoded in the short form.
   68|       |   // Long-form encoding is reserved for tag values >= 31 (X.690 8.1.2.3).
   69|       |   // This is unconditional and applies to BER as well as DER.
   70|    403|   if(tag_buf <= 30) {
  ------------------
  |  Branch (70:7): [True: 6, False: 397]
  ------------------
   71|      6|      throw BER_Decoding_Error("Long-form tag encoding used for small tag value");
   72|      6|   }
   73|       |
   74|    397|   if(tag_buf == static_cast<uint32_t>(ASN1_Type::NoObject)) {
  ------------------
  |  Branch (74:7): [True: 1, False: 396]
  ------------------
   75|      1|      throw BER_Decoding_Error("Tag value collides with internal sentinel");
   76|      1|   }
   77|       |
   78|       |   // NOLINTNEXTLINE(clang-analyzer-optin.core.EnumCastOutOfRange)
   79|    396|   type_tag = ASN1_Type(tag_buf);
   80|    396|   return tag_bytes;
   81|    397|}
ber_dec.cpp:_ZN5Botan12_GLOBAL__N_113decode_lengthEPNS_10DataSourceEmbb:
  126|  12.0k|BerDecodedLength decode_length(DataSource* ber, size_t allow_indef, bool der_mode, bool constructed) {
  127|  12.0k|   uint8_t b = 0;
  128|  12.0k|   if(ber->read_byte(b) == 0) {
  ------------------
  |  Branch (128:7): [True: 110, False: 11.9k]
  ------------------
  129|    110|      throw BER_Decoding_Error("Length field not found");
  130|    110|   }
  131|  11.9k|   if((b & 0x80) == 0) {
  ------------------
  |  Branch (131:7): [True: 11.6k, False: 299]
  ------------------
  132|  11.6k|      return BerDecodedLength(b, 1);
  133|  11.6k|   }
  134|       |
  135|    299|   const size_t num_length_bytes = (b & 0x7F);
  136|    299|   if(num_length_bytes > 4) {
  ------------------
  |  Branch (136:7): [True: 14, False: 285]
  ------------------
  137|     14|      throw BER_Decoding_Error("Length field is too large");
  138|     14|   }
  139|       |
  140|    285|   const size_t field_size = 1 + num_length_bytes;
  141|       |
  142|    285|   if(num_length_bytes == 0) {
  ------------------
  |  Branch (142:7): [True: 5, False: 280]
  ------------------
  143|      5|      if(der_mode) {
  ------------------
  |  Branch (143:10): [True: 5, False: 0]
  ------------------
  144|      5|         throw BER_Decoding_Error("Detected indefinite-length encoding in DER structure");
  145|      5|      } else if(!constructed) {
  ------------------
  |  Branch (145:17): [True: 0, False: 0]
  ------------------
  146|       |         // Indefinite length is only valid for constructed types (X.690 8.1.3.2)
  147|      0|         throw BER_Decoding_Error("Indefinite-length encoding used with non-constructed type");
  148|      0|      } else if(allow_indef == 0) {
  ------------------
  |  Branch (148:17): [True: 0, False: 0]
  ------------------
  149|      0|         throw BER_Decoding_Error("Nested EOC markers too deep, rejecting to avoid stack exhaustion");
  150|      0|      } else {
  151|       |         // find_eoc returns bytes up to and including the EOC marker.
  152|       |         // Return the content length; the caller consumes the EOC separately.
  153|      0|         const size_t eoc_len = find_eoc(ber, /*base_offset=*/0, allow_indef - 1);
  154|      0|         if(eoc_len < 2) {
  ------------------
  |  Branch (154:13): [True: 0, False: 0]
  ------------------
  155|      0|            throw BER_Decoding_Error("Invalid EOC encoding");
  156|      0|         }
  157|      0|         return BerDecodedLength::indefinite(eoc_len - 2, field_size);
  158|      0|      }
  159|      5|   }
  160|       |
  161|    280|   size_t length = 0;
  162|       |
  163|    933|   for(size_t i = 0; i != num_length_bytes; ++i) {
  ------------------
  |  Branch (163:22): [True: 662, False: 271]
  ------------------
  164|    662|      if(ber->read_byte(b) == 0) {
  ------------------
  |  Branch (164:10): [True: 9, False: 653]
  ------------------
  165|      9|         throw BER_Decoding_Error("Corrupted length field");
  166|      9|      }
  167|       |      // Can't overflow since we already checked that num_length_bytes <= 4
  168|    653|      length = (length << 8) | b;
  169|    653|   }
  170|       |
  171|       |   // DER requires shortest possible length encoding
  172|    271|   if(der_mode) {
  ------------------
  |  Branch (172:7): [True: 271, False: 0]
  ------------------
  173|    271|      if(length < 128) {
  ------------------
  |  Branch (173:10): [True: 10, False: 261]
  ------------------
  174|     10|         throw BER_Decoding_Error("Detected non-canonical length encoding in DER structure");
  175|     10|      }
  176|    261|      if(num_length_bytes > 1 && length < (size_t(1) << ((num_length_bytes - 1) * 8))) {
  ------------------
  |  Branch (176:10): [True: 230, False: 31]
  |  Branch (176:34): [True: 3, False: 227]
  ------------------
  177|      3|         throw BER_Decoding_Error("Detected non-canonical length encoding in DER structure");
  178|      3|      }
  179|    261|   }
  180|       |
  181|    258|   return BerDecodedLength(length, field_size);
  182|    271|}
ber_dec.cpp:_ZN5Botan12_GLOBAL__N_116BerDecodedLengthC2Emm:
   99|  11.9k|            BerDecodedLength(content_length, field_length, false) {}
ber_dec.cpp:_ZN5Botan12_GLOBAL__N_116BerDecodedLengthC2Emmb:
  116|  11.9k|            m_content_length(content_length), m_field_length(field_length), m_indefinite(indefinite) {}
ber_dec.cpp:_ZN5Botan12_GLOBAL__N_114is_constructedENS_10ASN1_ClassE:
   20|  13.3k|bool is_constructed(ASN1_Class class_tag) {
   21|  13.3k|   return (static_cast<uint32_t>(class_tag) & static_cast<uint32_t>(ASN1_Class::Constructed)) != 0;
   22|  13.3k|}
ber_dec.cpp:_ZNK5Botan12_GLOBAL__N_116BerDecodedLength14content_lengthEv:
  105|  35.1k|      size_t content_length() const { return m_content_length; }
ber_dec.cpp:_ZNK5Botan12_GLOBAL__N_116BerDecodedLength17indefinite_lengthEv:
  112|  11.7k|      bool indefinite_length() const { return m_indefinite; }
ber_dec.cpp:_ZNK5Botan12_GLOBAL__N_116BerDecodedLength12total_lengthEv:
  108|  11.8k|      size_t total_length() const { return m_indefinite ? m_content_length + 2 : m_content_length; }
  ------------------
  |  Branch (108:44): [True: 0, False: 11.8k]
  ------------------
ber_dec.cpp:_ZN5Botan12_GLOBAL__N_120DataSource_BERObjectC2EONS_10BER_ObjectE:
  357|  6.16k|      explicit DataSource_BERObject(BER_Object&& obj) : m_obj(std::move(obj)) {}
ber_dec.cpp:_ZN5Botan12_GLOBAL__N_120DataSource_BERObject4readEPhm:
  327|  43.2k|      size_t read(uint8_t out[], size_t length) override {
  328|  43.2k|         BOTAN_ASSERT_NOMSG(m_offset <= m_obj.length());
  ------------------
  |  |   77|  43.2k|   do {                                                                     \
  |  |   78|  43.2k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   79|  43.2k|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (79:10): [True: 0, False: 43.2k]
  |  |  ------------------
  |  |   80|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   81|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   82|      0|      }                                                                     \
  |  |   83|  43.2k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (83:12): [Folded, False: 43.2k]
  |  |  ------------------
  ------------------
  329|  43.2k|         const size_t got = std::min<size_t>(m_obj.length() - m_offset, length);
  330|  43.2k|         copy_mem(out, m_obj.bits() + m_offset, got);
  331|  43.2k|         m_offset += got;
  332|  43.2k|         return got;
  333|  43.2k|      }
ber_dec.cpp:_ZN5Botan12_GLOBAL__N_120DataSource_BERObject15check_availableEm:
  348|  8.37k|      bool check_available(size_t n) override {
  349|  8.37k|         BOTAN_ASSERT_NOMSG(m_offset <= m_obj.length());
  ------------------
  |  |   77|  8.37k|   do {                                                                     \
  |  |   78|  8.37k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   79|  8.37k|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (79:10): [True: 0, False: 8.37k]
  |  |  ------------------
  |  |   80|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   81|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   82|      0|      }                                                                     \
  |  |   83|  8.37k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (83:12): [Folded, False: 8.37k]
  |  |  ------------------
  ------------------
  350|  8.37k|         return (n <= (m_obj.length() - m_offset));
  351|  8.37k|      }
ber_dec.cpp:_ZNK5Botan12_GLOBAL__N_120DataSource_BERObject11end_of_dataEv:
  353|  3.82k|      bool end_of_data() const override { return get_bytes_read() == m_obj.length(); }
ber_dec.cpp:_ZNK5Botan12_GLOBAL__N_120DataSource_BERObject14get_bytes_readEv:
  355|  3.82k|      size_t get_bytes_read() const override { return m_offset; }
ber_dec.cpp:_ZN5Botan12_GLOBAL__N_114is_constructedERKNS_10BER_ObjectE:
  709|  1.26k|bool is_constructed(const BER_Object& obj) {
  710|  1.26k|   return is_constructed(obj.class_tag());
  711|  1.26k|}
ber_dec.cpp:_ZN5Botan12_GLOBAL__N_125asn1_decode_binary_stringINSt3__19allocatorIhEEEEvRNS2_6vectorIhT_EERKNS_10BER_ObjectENS_9ASN1_TypeESC_NS_10ASN1_ClassEb:
  719|  1.26k|                               bool require_der) {
  720|  1.26k|   obj.assert_is_a(type_tag, class_tag);
  721|       |
  722|       |   // DER requires BIT STRING and OCTET STRING to use primitive encoding
  723|  1.26k|   if(require_der && is_constructed(obj)) {
  ------------------
  |  Branch (723:7): [True: 1.26k, False: 6]
  |  Branch (723:22): [True: 0, False: 1.26k]
  ------------------
  724|      0|      throw BER_Decoding_Error("Detected constructed string encoding in DER structure");
  725|      0|   }
  726|       |
  727|  1.26k|   if(real_type == ASN1_Type::OctetString) {
  ------------------
  |  Branch (727:7): [True: 642, False: 627]
  ------------------
  728|    642|      buffer.assign(obj.bits(), obj.bits() + obj.length());
  729|    642|   } else {
  730|    627|      if(obj.length() == 0) {
  ------------------
  |  Branch (730:10): [True: 1, False: 626]
  ------------------
  731|      1|         throw BER_Decoding_Error("Invalid BIT STRING");
  732|      1|      }
  733|       |
  734|    626|      const uint8_t unused_bits = obj.bits()[0];
  735|       |
  736|    626|      if(unused_bits >= 8) {
  ------------------
  |  Branch (736:10): [True: 5, False: 621]
  ------------------
  737|      5|         throw BER_Decoding_Error("Bad number of unused bits in BIT STRING");
  738|      5|      }
  739|       |
  740|       |      // Empty BIT STRING with unused bits > 0 ...
  741|    621|      if(unused_bits > 0 && obj.length() < 2) {
  ------------------
  |  Branch (741:10): [True: 17, False: 604]
  |  Branch (741:29): [True: 1, False: 16]
  ------------------
  742|      1|         throw BER_Decoding_Error("Invalid BIT STRING");
  743|      1|      }
  744|       |
  745|       |      // DER requires unused bits in BIT STRING to be zero (X.690 section 11.2.2)
  746|    620|      if(require_der && unused_bits > 0) {
  ------------------
  |  Branch (746:10): [True: 614, False: 6]
  |  Branch (746:25): [True: 16, False: 598]
  ------------------
  747|     16|         const uint8_t last_byte = obj.bits()[obj.length() - 1];
  748|     16|         if((last_byte & ((1 << unused_bits) - 1)) != 0) {
  ------------------
  |  Branch (748:13): [True: 7, False: 9]
  ------------------
  749|      7|            throw BER_Decoding_Error("Detected non-zero padding bits in BIT STRING in DER structure");
  750|      7|         }
  751|     16|      }
  752|       |
  753|    613|      buffer.resize(obj.length() - 1);
  754|       |
  755|    613|      if(obj.length() > 1) {
  ------------------
  |  Branch (755:10): [True: 51, False: 562]
  ------------------
  756|     51|         copy_mem(buffer.data(), obj.bits() + 1, obj.length() - 1);
  757|     51|      }
  758|    613|   }
  759|  1.26k|}

_ZNK5Botan6BigInt7byte_atEm:
  118|  4.20k|uint8_t BigInt::byte_at(size_t n) const {
  119|  4.20k|   return get_byte_var(sizeof(word) - (n % sizeof(word)) - 1, word_at(n / sizeof(word)));
  120|  4.20k|}
_ZN5Botan6BigInt4Data11set_to_zeroEv:
  191|  1.24k|void BigInt::Data::set_to_zero() {
  192|  1.24k|   m_reg.resize(m_reg.capacity());
  193|  1.24k|   clear_mem(m_reg.data(), m_reg.size());
  194|  1.24k|   m_sig_words = 0;
  195|  1.24k|}
_ZNK5Botan6BigInt4Data14calc_sig_wordsEv:
  215|  1.24k|size_t BigInt::Data::calc_sig_words() const {
  216|  1.24k|   const size_t sz = m_reg.size();
  217|  1.24k|   size_t sig = sz;
  218|       |
  219|  1.24k|   word sub = 1;
  220|       |
  221|  18.2k|   for(size_t i = 0; i != sz; ++i) {
  ------------------
  |  Branch (221:22): [True: 16.9k, False: 1.24k]
  ------------------
  222|  16.9k|      const word w = m_reg[sz - i - 1];
  223|  16.9k|      sub &= ct_is_zero(w);
  224|  16.9k|      sig -= sub;
  225|  16.9k|   }
  226|       |
  227|       |   /*
  228|       |   * This depends on the data so is poisoned, but unpoison it here as
  229|       |   * later conditionals are made on the size.
  230|       |   */
  231|  1.24k|   CT::unpoison(sig);
  232|       |
  233|  1.24k|   return sig;
  234|  1.24k|}
_ZNK5Botan6BigInt13top_bits_freeEv:
  298|    174|size_t BigInt::top_bits_free() const {
  299|    174|   const size_t words = sig_words();
  300|       |
  301|    174|   const word top_word = word_at(words - 1);
  302|    174|   const size_t bits_used = high_bit(CT::value_barrier(top_word));
  303|    174|   CT::unpoison(bits_used);
  304|    174|   return WordInfo<word>::bits - bits_used;
  305|    174|}
_ZNK5Botan6BigInt4bitsEv:
  307|  1.14k|size_t BigInt::bits() const {
  308|  1.14k|   const size_t words = sig_words();
  309|       |
  310|  1.14k|   if(words == 0) {
  ------------------
  |  Branch (310:7): [True: 967, False: 174]
  ------------------
  311|    967|      return 0;
  312|    967|   }
  313|       |
  314|    174|   const size_t full_words = (words - 1) * WordInfo<word>::bits;
  315|    174|   const size_t top_bits = WordInfo<word>::bits - top_bits_free();
  316|       |
  317|    174|   return full_words + top_bits;
  318|  1.14k|}
_ZN5Botan6BigInt17assign_from_bytesENSt3__14spanIKhLm18446744073709551615EEE:
  425|  1.24k|void BigInt::assign_from_bytes(std::span<const uint8_t> bytes) {
  426|  1.24k|   clear();
  427|       |
  428|  1.24k|   const size_t length = bytes.size();
  429|  1.24k|   const size_t full_words = length / sizeof(word);
  430|  1.24k|   const size_t extra_bytes = length % sizeof(word);
  431|       |
  432|  1.24k|   secure_vector<word> reg((round_up(full_words + (extra_bytes > 0 ? 1 : 0), 8)));
  ------------------
  |  Branch (432:52): [True: 1.23k, False: 11]
  ------------------
  433|       |
  434|  8.66k|   for(size_t i = 0; i != full_words; ++i) {
  ------------------
  |  Branch (434:22): [True: 7.41k, False: 1.24k]
  ------------------
  435|  7.41k|      reg[i] = load_be<word>(bytes.last<sizeof(word)>());
  436|  7.41k|      bytes = bytes.first(bytes.size() - sizeof(word));
  437|  7.41k|   }
  438|       |
  439|  1.24k|   if(!bytes.empty()) {
  ------------------
  |  Branch (439:7): [True: 1.23k, False: 11]
  ------------------
  440|  1.23k|      BOTAN_ASSERT_NOMSG(extra_bytes == bytes.size());
  ------------------
  |  |   77|  1.23k|   do {                                                                     \
  |  |   78|  1.23k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   79|  1.23k|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (79:10): [True: 0, False: 1.23k]
  |  |  ------------------
  |  |   80|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   81|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   82|      0|      }                                                                     \
  |  |   83|  1.23k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (83:12): [Folded, False: 1.23k]
  |  |  ------------------
  ------------------
  441|  1.23k|      std::array<uint8_t, sizeof(word)> last_partial_word = {0};
  442|  1.23k|      copy_mem(std::span{last_partial_word}.last(extra_bytes), bytes);
  443|  1.23k|      reg[full_words] = load_be<word>(last_partial_word);
  444|  1.23k|   }
  445|       |
  446|  1.24k|   m_data.swap(reg);
  447|  1.24k|}
_ZNK5Botan6BigInt20_const_time_unpoisonEv:
  559|  1.34k|void BigInt::_const_time_unpoison() const {
  560|  1.34k|   CT::unpoison(m_data.const_data(), m_data.size());
  561|  1.34k|}

_ZN5Botan15allocate_memoryEmm:
   21|  4.98k|BOTAN_MALLOC_FN void* allocate_memory(size_t elems, size_t elem_size) {
   22|  4.98k|   if(elems == 0 || elem_size == 0) {
  ------------------
  |  Branch (22:7): [True: 0, False: 4.98k]
  |  Branch (22:21): [True: 0, False: 4.98k]
  ------------------
   23|      0|      return nullptr;
   24|      0|   }
   25|       |
   26|       |   // Some calloc implementations do not check for overflow (?!?)
   27|  4.98k|   if(!checked_mul(elems, elem_size).has_value()) {
  ------------------
  |  Branch (27:7): [True: 0, False: 4.98k]
  ------------------
   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|  4.98k|   void* ptr = std::calloc(elems, elem_size);  // NOLINT(*-no-malloc,*-owning-memory)
   43|  4.98k|#endif
   44|  4.98k|   if(ptr == nullptr) {
  ------------------
  |  Branch (44:7): [True: 0, False: 4.98k]
  ------------------
   45|      0|      [[unlikely]] throw std::bad_alloc();
   46|      0|   }
   47|  4.98k|   return ptr;
   48|  4.98k|}
_ZN5Botan17deallocate_memoryEPvmm:
   50|  4.98k|void deallocate_memory(void* p, size_t elems, size_t elem_size) {
   51|  4.98k|   if(p == nullptr) {
  ------------------
  |  Branch (51:7): [True: 0, False: 4.98k]
  ------------------
   52|      0|      [[unlikely]] return;
   53|      0|   }
   54|       |
   55|  4.98k|   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|  4.98k|   std::free(p);  // NOLINT(*-no-malloc,*-owning-memory)
   64|  4.98k|}

_ZN5Botan22throw_invalid_argumentEPKcS1_S1_:
   23|     23|void throw_invalid_argument(const char* message, const char* func, const char* file) {
   24|     23|   throw Invalid_Argument(fmt("{} in {}:{}", message, func, file));
   25|     23|}

_ZN5Botan13is_valid_utf8ERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
  106|     99|bool is_valid_utf8(const std::string& utf8) {
  107|     99|   try {
  108|     99|      size_t pos = 0;
  109|    241|      while(pos < utf8.size()) {
  ------------------
  |  Branch (109:13): [True: 142, False: 99]
  ------------------
  110|    142|         const uint32_t c = next_utf8_codepoint(utf8, pos);
  111|    142|         BOTAN_UNUSED(c);
  ------------------
  |  |  144|    142|#define BOTAN_UNUSED Botan::ignore_params
  ------------------
  112|    142|      }
  113|     99|   } catch(Decoding_Error&) {
  114|     53|      return false;
  115|     53|   }
  116|     46|   return true;
  117|     99|}
_ZN5Botan12ucs2_to_utf8EPKhm:
  119|     50|std::string ucs2_to_utf8(const uint8_t ucs2[], size_t len) {
  120|     50|   if(len % 2 != 0) {
  ------------------
  |  Branch (120:7): [True: 1, False: 49]
  ------------------
  121|      1|      throw Decoding_Error("Invalid length for UCS-2 string");
  122|      1|   }
  123|       |
  124|     49|   const size_t chars = len / 2;
  125|       |
  126|     49|   std::string s;
  127|    140|   for(size_t i = 0; i != chars; ++i) {
  ------------------
  |  Branch (127:22): [True: 91, False: 49]
  ------------------
  128|     91|      const uint32_t c = load_be<uint16_t>(ucs2, i);
  129|     91|      append_utf8_for(s, c);
  130|     91|   }
  131|       |
  132|     49|   return s;
  133|     50|}
_ZN5Botan12ucs4_to_utf8EPKhm:
  153|     83|std::string ucs4_to_utf8(const uint8_t ucs4[], size_t len) {
  154|     83|   if(len % 4 != 0) {
  ------------------
  |  Branch (154:7): [True: 2, False: 81]
  ------------------
  155|      2|      throw Decoding_Error("Invalid length for UCS-4 string");
  156|      2|   }
  157|       |
  158|     81|   const size_t chars = len / 4;
  159|       |
  160|     81|   std::string s;
  161|    161|   for(size_t i = 0; i != chars; ++i) {
  ------------------
  |  Branch (161:22): [True: 80, False: 81]
  ------------------
  162|     80|      const uint32_t c = load_be<uint32_t>(ucs4, i);
  163|     80|      append_utf8_for(s, c);
  164|     80|   }
  165|       |
  166|     81|   return s;
  167|     83|}
_ZN5Botan14latin1_to_utf8EPKhm:
  188|     11|std::string latin1_to_utf8(const uint8_t chars[], size_t len) {
  189|     11|   std::string s;
  190|     39|   for(size_t i = 0; i != len; ++i) {
  ------------------
  |  Branch (190:22): [True: 28, False: 11]
  ------------------
  191|     28|      const uint32_t c = static_cast<uint8_t>(chars[i]);
  192|     28|      append_utf8_for(s, c);
  193|     28|   }
  194|     11|   return s;
  195|     11|}
charset.cpp:_ZN5Botan12_GLOBAL__N_119next_utf8_codepointERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERm:
   52|    142|uint32_t next_utf8_codepoint(const std::string& utf8, size_t& pos) {
   53|    142|   auto read_continuation = [&]() -> uint32_t {
   54|    142|      if(pos >= utf8.size()) {
   55|    142|         throw Decoding_Error("Invalid UTF-8 sequence");
   56|    142|      }
   57|    142|      const uint8_t b = static_cast<uint8_t>(utf8[pos++]);
   58|    142|      if((b & 0xC0) != 0x80) {
   59|    142|         throw Decoding_Error("Invalid UTF-8 sequence");
   60|    142|      }
   61|    142|      return b & 0x3F;
   62|    142|   };
   63|       |
   64|    142|   const uint8_t lead = static_cast<uint8_t>(utf8[pos++]);
   65|    142|   uint32_t c = 0;
   66|       |
   67|    142|   if(lead <= 0x7F) {
  ------------------
  |  Branch (67:7): [True: 27, False: 115]
  ------------------
   68|     27|      c = lead;
   69|    115|   } else if((lead & 0xE0) == 0xC0) {
  ------------------
  |  Branch (69:14): [True: 15, False: 100]
  ------------------
   70|     15|      c = (lead & 0x1F) << 6;
   71|     15|      c |= read_continuation();
   72|     15|      if(c < 0x80) {
  ------------------
  |  Branch (72:10): [True: 2, False: 13]
  ------------------
   73|      2|         throw Decoding_Error("Overlong UTF-8 sequence");
   74|      2|      }
   75|    100|   } else if((lead & 0xF0) == 0xE0) {
  ------------------
  |  Branch (75:14): [True: 37, False: 63]
  ------------------
   76|     37|      c = (lead & 0x0F) << 12;
   77|     37|      c |= read_continuation() << 6;
   78|     37|      c |= read_continuation();
   79|     37|      if(c < 0x800) {
  ------------------
  |  Branch (79:10): [True: 6, False: 31]
  ------------------
   80|      6|         throw Decoding_Error("Overlong UTF-8 sequence");
   81|      6|      }
   82|     63|   } else if((lead & 0xF8) == 0xF0) {
  ------------------
  |  Branch (82:14): [True: 44, False: 19]
  ------------------
   83|     44|      c = (lead & 0x07) << 18;
   84|     44|      c |= read_continuation() << 12;
   85|     44|      c |= read_continuation() << 6;
   86|     44|      c |= read_continuation();
   87|     44|      if(c < 0x10000) {
  ------------------
  |  Branch (87:10): [True: 5, False: 39]
  ------------------
   88|      5|         throw Decoding_Error("Overlong UTF-8 sequence");
   89|      5|      }
   90|     44|   } else {
   91|     19|      throw Decoding_Error("Invalid UTF-8 sequence");
   92|     19|   }
   93|       |
   94|    110|   if(c > 0x10FFFF) {
  ------------------
  |  Branch (94:7): [True: 3, False: 107]
  ------------------
   95|      3|      throw Decoding_Error("UTF-8 sequence encodes value outside Unicode range");
   96|      3|   }
   97|    107|   if(c >= 0xD800 && c < 0xE000) {
  ------------------
  |  Branch (97:7): [True: 52, False: 55]
  |  Branch (97:22): [True: 12, False: 40]
  ------------------
   98|     12|      throw Decoding_Error("UTF-8 sequence encodes surrogate code point");
   99|     12|   }
  100|       |
  101|     95|   return c;
  102|    107|}
charset.cpp:_ZZN5Botan12_GLOBAL__N_119next_utf8_codepointERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERmENK3$_0clEv:
   53|    221|   auto read_continuation = [&]() -> uint32_t {
   54|    221|      if(pos >= utf8.size()) {
  ------------------
  |  Branch (54:10): [True: 3, False: 218]
  ------------------
   55|      3|         throw Decoding_Error("Invalid UTF-8 sequence");
   56|      3|      }
   57|    218|      const uint8_t b = static_cast<uint8_t>(utf8[pos++]);
   58|    218|      if((b & 0xC0) != 0x80) {
  ------------------
  |  Branch (58:10): [True: 3, False: 215]
  ------------------
   59|      3|         throw Decoding_Error("Invalid UTF-8 sequence");
   60|      3|      }
   61|    215|      return b & 0x3F;
   62|    218|   };
charset.cpp:_ZN5Botan12_GLOBAL__N_115append_utf8_forERNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEj:
   18|    199|void append_utf8_for(std::string& s, uint32_t c) {
   19|    199|   if(c >= 0xD800 && c < 0xE000) {
  ------------------
  |  Branch (19:7): [True: 121, False: 78]
  |  Branch (19:22): [True: 14, False: 107]
  ------------------
   20|     14|      throw Decoding_Error("Invalid Unicode character");
   21|     14|   }
   22|       |
   23|    185|   if(c <= 0x7F) {
  ------------------
  |  Branch (23:7): [True: 19, False: 166]
  ------------------
   24|     19|      const uint8_t b0 = static_cast<uint8_t>(c);
   25|     19|      s.push_back(static_cast<char>(b0));
   26|    166|   } else if(c <= 0x7FF) {
  ------------------
  |  Branch (26:14): [True: 28, False: 138]
  ------------------
   27|     28|      const uint8_t b0 = 0xC0 | static_cast<uint8_t>(c >> 6);
   28|     28|      const uint8_t b1 = 0x80 | static_cast<uint8_t>(c & 0x3F);
   29|     28|      s.push_back(static_cast<char>(b0));
   30|     28|      s.push_back(static_cast<char>(b1));
   31|    138|   } else if(c <= 0xFFFF) {
  ------------------
  |  Branch (31:14): [True: 60, False: 78]
  ------------------
   32|     60|      const uint8_t b0 = 0xE0 | static_cast<uint8_t>(c >> 12);
   33|     60|      const uint8_t b1 = 0x80 | static_cast<uint8_t>((c >> 6) & 0x3F);
   34|     60|      const uint8_t b2 = 0x80 | static_cast<uint8_t>(c & 0x3F);
   35|     60|      s.push_back(static_cast<char>(b0));
   36|     60|      s.push_back(static_cast<char>(b1));
   37|     60|      s.push_back(static_cast<char>(b2));
   38|     78|   } else if(c <= 0x10FFFF) {
  ------------------
  |  Branch (38:14): [True: 23, False: 55]
  ------------------
   39|     23|      const uint8_t b0 = 0xF0 | static_cast<uint8_t>(c >> 18);
   40|     23|      const uint8_t b1 = 0x80 | static_cast<uint8_t>((c >> 12) & 0x3F);
   41|     23|      const uint8_t b2 = 0x80 | static_cast<uint8_t>((c >> 6) & 0x3F);
   42|     23|      const uint8_t b3 = 0x80 | static_cast<uint8_t>(c & 0x3F);
   43|     23|      s.push_back(static_cast<char>(b0));
   44|     23|      s.push_back(static_cast<char>(b1));
   45|     23|      s.push_back(static_cast<char>(b2));
   46|     23|      s.push_back(static_cast<char>(b3));
   47|     55|   } else {
   48|     55|      throw Decoding_Error("Invalid Unicode character");
   49|     55|   }
   50|    185|}

_ZN5Botan10DataSource9read_byteERh:
   27|  29.6k|size_t DataSource::read_byte(uint8_t& out) {
   28|  29.6k|   return read(&out, 1);
   29|  29.6k|}
_ZN5Botan10DataSource9read_byteEv:
   34|  14.3k|std::optional<uint8_t> DataSource::read_byte() {
   35|  14.3k|   uint8_t b = 0;
   36|  14.3k|   if(this->read(&b, 1) == 1) {
  ------------------
  |  Branch (36:7): [True: 13.5k, False: 814]
  ------------------
   37|  13.5k|      return b;
   38|  13.5k|   } else {
   39|    814|      return {};
   40|    814|   }
   41|  14.3k|}
_ZN5Botan17DataSource_Memory4readEPhm:
   73|  12.3k|size_t DataSource_Memory::read(uint8_t out[], size_t length) {
   74|  12.3k|   const size_t got = std::min<size_t>(m_source.size() - m_offset, length);
   75|  12.3k|   copy_mem(out, m_source.data() + m_offset, got);
   76|  12.3k|   m_offset += got;
   77|  12.3k|   return got;
   78|  12.3k|}
_ZN5Botan17DataSource_Memory15check_availableEm:
   80|  3.48k|bool DataSource_Memory::check_available(size_t n) {
   81|  3.48k|   return (n <= (m_source.size() - m_offset));
   82|  3.48k|}
_ZNK5Botan17DataSource_Memory11end_of_dataEv:
  101|  1.17k|bool DataSource_Memory::end_of_data() const {
  102|  1.17k|   return (m_offset == m_source.size());
  103|  1.17k|}

_ZN5Botan9ExceptionC2ENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
   71|  1.91k|Exception::Exception(std::string_view msg) : m_msg(msg) {}
_ZN5Botan16Invalid_ArgumentC2ENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
   77|    107|Invalid_Argument::Invalid_Argument(std::string_view msg) : Exception(msg) {}
_ZN5Botan14Decoding_ErrorC2ENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
  125|  1.81k|Decoding_Error::Decoding_Error(std::string_view name) : Exception(name) {}

_ZN5Botan19secure_scrub_memoryEPvm:
   25|  35.7k|void secure_scrub_memory(void* ptr, size_t n) {
   26|  35.7k|   return secure_zeroize_buffer(ptr, n);
   27|  35.7k|}
_ZN5Botan21secure_zeroize_bufferEPvm:
   29|  35.7k|void secure_zeroize_buffer(void* ptr, size_t n) {
   30|  35.7k|   if(n == 0) {
  ------------------
  |  Branch (30:7): [True: 19.4k, False: 16.2k]
  ------------------
   31|  19.4k|      return;
   32|  19.4k|   }
   33|       |
   34|       |#if defined(BOTAN_TARGET_OS_HAS_RTLSECUREZEROMEMORY)
   35|       |   ::RtlSecureZeroMemory(ptr, n);
   36|       |
   37|       |#elif defined(BOTAN_TARGET_OS_HAS_EXPLICIT_BZERO)
   38|  16.2k|   ::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|  16.2k|}

_ZN5Botan9to_u32bitENSt3__117basic_string_viewIcNS0_11char_traitsIcEEEE:
   30|    579|uint32_t to_u32bit(std::string_view str_view) {
   31|    579|   const std::string str(str_view);
   32|       |
   33|       |   // std::stoul is not strict enough. Ensure that str is digit only [0-9]*
   34|  1.21k|   for(const char chr : str) {
  ------------------
  |  Branch (34:23): [True: 1.21k, False: 559]
  ------------------
   35|  1.21k|      if(chr < '0' || chr > '9') {
  ------------------
  |  Branch (35:10): [True: 16, False: 1.20k]
  |  Branch (35:23): [True: 4, False: 1.19k]
  ------------------
   36|     20|         throw Invalid_Argument("to_u32bit invalid decimal string '" + str + "'");
   37|     20|      }
   38|  1.21k|   }
   39|       |
   40|    559|   const unsigned long int x = std::stoul(str);
   41|       |
   42|    559|   if constexpr(sizeof(unsigned long int) > 4) {
   43|       |      // x might be uint64
   44|    559|      if(x > std::numeric_limits<uint32_t>::max()) {
  ------------------
  |  Branch (44:10): [True: 0, False: 559]
  ------------------
   45|      0|         throw Invalid_Argument("Integer value of " + str + " exceeds 32 bit range");
   46|      0|      }
   47|    559|   }
   48|       |
   49|    559|   return static_cast<uint32_t>(x);
   50|    579|}

_ZN5Botan4OCSP6CertID11decode_fromERNS_11BER_DecoderE:
   80|      1|void CertID::decode_from(BER_Decoder& from) {
   81|       |   /*
   82|       |   * RFC 6960 Section 4.1.1
   83|       |   *
   84|       |   * CertID ::= SEQUENCE {
   85|       |   *    hashAlgorithm       AlgorithmIdentifier,
   86|       |   *    issuerNameHash      OCTET STRING,
   87|       |   *    issuerKeyHash       OCTET STRING,
   88|       |   *    serialNumber        CertificateSerialNumber }
   89|       |   */
   90|      1|   from.start_sequence()
   91|      1|      .decode(m_hash_id)
   92|      1|      .decode(m_issuer_dn_hash, ASN1_Type::OctetString)
   93|      1|      .decode(m_issuer_key_hash, ASN1_Type::OctetString)
   94|      1|      .decode(m_subject_serial)
   95|      1|      .end_cons();
   96|      1|}
_ZN5Botan4OCSP14SingleResponse11decode_fromERNS_11BER_DecoderE:
  102|      2|void SingleResponse::decode_from(BER_Decoder& from) {
  103|       |   /*
  104|       |   * RFC 6960 Section 4.2.1
  105|       |   *
  106|       |   * SingleResponse ::= SEQUENCE {
  107|       |   *    certID                       CertID,
  108|       |   *    certStatus                   CertStatus,
  109|       |   *    thisUpdate                   GeneralizedTime,
  110|       |   *    nextUpdate         [0]       EXPLICIT GeneralizedTime OPTIONAL,
  111|       |   *    singleExtensions   [1]       EXPLICIT Extensions OPTIONAL }
  112|       |   *
  113|       |   * CertStatus ::= CHOICE {
  114|       |   *    good        [0]     IMPLICIT NULL,
  115|       |   *    revoked     [1]     IMPLICIT RevokedInfo,
  116|       |   *    unknown     [2]     IMPLICIT UnknownInfo }
  117|       |   *
  118|       |   * RevokedInfo ::= SEQUENCE {
  119|       |   *    revocationTime              GeneralizedTime,
  120|       |   *    revocationReason    [0]     EXPLICIT CRLReason OPTIONAL }
  121|       |   */
  122|      2|   BER_Object cert_status;
  123|      2|   Extensions extensions;
  124|       |
  125|      2|   from.start_sequence()
  126|      2|      .decode(m_certid)
  127|      2|      .get_next(cert_status)
  128|      2|      .decode(m_thisupdate)
  129|      2|      .decode_optional(m_nextupdate, ASN1_Type(0), ASN1_Class::ContextSpecific | ASN1_Class::Constructed)
  130|      2|      .decode_optional(extensions, ASN1_Type(1), ASN1_Class::ContextSpecific | ASN1_Class::Constructed)
  131|      2|      .end_cons();
  132|       |
  133|      2|   const auto cert_status_class = cert_status.get_class();
  134|      2|   if(cert_status_class != ASN1_Class::ContextSpecific &&
  ------------------
  |  Branch (134:7): [True: 0, False: 2]
  ------------------
  135|      0|      cert_status_class != (ASN1_Class::ContextSpecific | ASN1_Class::Constructed)) {
  ------------------
  |  Branch (135:7): [True: 0, False: 0]
  ------------------
  136|      0|      throw Decoding_Error("OCSP::SingleResponse: certStatus has unexpected class tag");
  137|      0|   }
  138|       |
  139|       |   // TODO: should verify the cert_status body and decode RevokedInfo
  140|      2|   m_cert_status = static_cast<uint32_t>(cert_status.type());
  141|      2|   if(m_cert_status > 2) {
  ------------------
  |  Branch (141:7): [True: 0, False: 2]
  ------------------
  142|      0|      throw Decoding_Error("Unknown OCSP CertStatus tag");
  143|      0|   }
  144|       |
  145|       |   // We don't currently recognize any extensions here so if any are critical we should reject
  146|      2|   m_has_unknown_critical_ext = !extensions.critical_extensions().empty();
  147|      2|}
_ZN5Botan4OCSP8ResponseC2EPKhm:
  226|  1.76k|      m_response_bits(response_bits, response_bits + response_bits_len) {
  227|       |   /*
  228|       |   * RFC 6960 Section 4.2.1
  229|       |   *
  230|       |   * OCSPResponse ::= SEQUENCE {
  231|       |   *    responseStatus         OCSPResponseStatus,
  232|       |   *    responseBytes      [0] EXPLICIT ResponseBytes OPTIONAL }
  233|       |   *
  234|       |   * OCSPResponseStatus ::= ENUMERATED { ... }
  235|       |   *
  236|       |   * ResponseBytes ::= SEQUENCE {
  237|       |   *    responseType   OBJECT IDENTIFIER,
  238|       |   *    response       OCTET STRING }
  239|       |   */
  240|  1.76k|   BER_Decoder outer_decoder(m_response_bits, BER_Decoder::Limits::DER());
  241|  1.76k|   BER_Decoder response_outer = outer_decoder.start_sequence();
  242|       |
  243|  1.76k|   size_t resp_status = 0;
  244|       |
  245|  1.76k|   response_outer.decode(resp_status, ASN1_Type::Enumerated, ASN1_Class::Universal);
  246|       |
  247|       |   /*
  248|       |   RFC 6960 4.2.1
  249|       |
  250|       |   OCSPResponseStatus ::= ENUMERATED {
  251|       |       successful            (0),  -- Response has valid confirmations
  252|       |       malformedRequest      (1),  -- Illegal confirmation request
  253|       |       internalError         (2),  -- Internal error in issuer
  254|       |       tryLater              (3),  -- Try again later
  255|       |                                   -- (4) is not used
  256|       |       sigRequired           (5),  -- Must sign the request
  257|       |       unauthorized          (6)   -- Request unauthorized
  258|       |   }
  259|       |   */
  260|  1.76k|   if(resp_status == 4 || resp_status >= 7) {
  ------------------
  |  Branch (260:7): [True: 718, False: 1.04k]
  |  Branch (260:27): [True: 62, False: 983]
  ------------------
  261|     63|      throw Decoding_Error("Unknown OCSPResponseStatus code");
  262|     63|   }
  263|       |
  264|  1.70k|   m_status = static_cast<Response_Status_Code>(resp_status);
  265|       |
  266|       |   /*
  267|       |   * RFC 6960 4.2.1: "If the value of responseStatus is one of the error
  268|       |   * conditions, the responseBytes field is not set."
  269|       |   */
  270|  1.70k|   const bool successful = (m_status == Response_Status_Code::Successful);
  271|  1.70k|   const bool has_response_bytes = response_outer.more_items();
  272|       |
  273|  1.70k|   if(successful && !has_response_bytes) {
  ------------------
  |  Branch (273:7): [True: 964, False: 736]
  |  Branch (273:21): [True: 3, False: 961]
  ------------------
  274|      3|      throw Decoding_Error("OCSP response with successful status is missing responseBytes");
  275|      3|   }
  276|  1.69k|   if(!successful && has_response_bytes) {
  ------------------
  |  Branch (276:7): [True: 19, False: 1.67k]
  |  Branch (276:22): [True: 1, False: 18]
  ------------------
  277|      1|      throw Decoding_Error("OCSP response with non-successful status includes responseBytes");
  278|      1|   }
  279|       |
  280|  1.69k|   if(successful) {
  ------------------
  |  Branch (280:7): [True: 961, False: 735]
  ------------------
  281|    961|      BER_Decoder response_bytes_ctx = response_outer.start_context_specific(0);
  282|    961|      BER_Decoder response_bytes = response_bytes_ctx.start_sequence();
  283|       |
  284|    961|      response_bytes.decode_and_check(OID({1, 3, 6, 1, 5, 5, 7, 48, 1, 1}), "Unknown response type in OCSP response");
  285|       |
  286|       |      /*
  287|       |      * RFC 6960 Section 4.2.1
  288|       |      *
  289|       |      * BasicOCSPResponse ::= SEQUENCE {
  290|       |      *    tbsResponseData      ResponseData,
  291|       |      *    signatureAlgorithm   AlgorithmIdentifier,
  292|       |      *    signature            BIT STRING,
  293|       |      *    certs            [0] EXPLICIT SEQUENCE OF Certificate OPTIONAL }
  294|       |      */
  295|    961|      BER_Decoder basic_response_decoder(response_bytes.get_next_octet_string(), BER_Decoder::Limits::DER());
  296|    961|      BER_Decoder basicresponse = basic_response_decoder.start_sequence();
  297|       |
  298|    961|      basicresponse.start_sequence()
  299|    961|         .raw_bytes(m_tbs_bits)
  300|    961|         .end_cons()
  301|    961|         .decode(m_sig_algo)
  302|    961|         .decode(m_signature, ASN1_Type::BitString);
  303|    961|      decode_optional_list(basicresponse, ASN1_Type(0), m_certs);
  304|       |
  305|    961|      basicresponse.verify_end();
  306|    961|      basic_response_decoder.verify_end();
  307|       |
  308|       |      /*
  309|       |      * RFC 6960 Section 4.2.1
  310|       |      *
  311|       |      * ResponseData ::= SEQUENCE {
  312|       |      *    version              [0] EXPLICIT Version DEFAULT v1,
  313|       |      *    responderID              ResponderID,
  314|       |      *    producedAt               GeneralizedTime,
  315|       |      *    responses                SEQUENCE OF SingleResponse,
  316|       |      *    responseExtensions   [1] EXPLICIT Extensions OPTIONAL }
  317|       |      *
  318|       |      * ResponderID ::= CHOICE {
  319|       |      *    byName   [1] Name,
  320|       |      *    byKey    [2] KeyHash }
  321|       |      */
  322|    961|      size_t responsedata_version = 0;
  323|    961|      Extensions extensions;
  324|       |
  325|    961|      BER_Decoder(m_tbs_bits, BER_Decoder::Limits::DER())
  326|    961|         .decode_optional(responsedata_version, ASN1_Type(0), ASN1_Class::ContextSpecific | ASN1_Class::Constructed)
  327|       |
  328|    961|         .decode_optional(m_signer_name, ASN1_Type(1), ASN1_Class::ContextSpecific | ASN1_Class::Constructed)
  329|       |
  330|    961|         .decode_optional_string(
  331|    961|            m_key_hash, ASN1_Type::OctetString, 2, ASN1_Class::ContextSpecific | ASN1_Class::Constructed)
  332|       |
  333|    961|         .decode(m_produced_at)
  334|       |
  335|    961|         .decode_list(m_responses)
  336|       |
  337|    961|         .decode_optional(extensions, ASN1_Type(1), ASN1_Class::ContextSpecific | ASN1_Class::Constructed)
  338|       |
  339|    961|         .verify_end();
  340|       |
  341|    961|      const bool has_signer = !m_signer_name.empty();
  342|    961|      const bool has_key_hash = !m_key_hash.empty();
  343|       |
  344|    961|      if(has_signer && has_key_hash) {
  ------------------
  |  Branch (344:10): [True: 0, False: 961]
  |  Branch (344:24): [True: 0, False: 0]
  ------------------
  345|      0|         throw Decoding_Error("OCSP response includes both byName and byKey in responderID field");
  346|      0|      }
  347|    961|      if(!has_signer && !has_key_hash) {
  ------------------
  |  Branch (347:10): [True: 11, False: 950]
  |  Branch (347:25): [True: 11, False: 0]
  ------------------
  348|     11|         throw Decoding_Error("OCSP response contains neither byName nor byKey in responderID field");
  349|     11|      }
  350|    950|      if(has_key_hash && m_key_hash.size() != 20) {
  ------------------
  |  Branch (350:10): [True: 0, False: 950]
  |  Branch (350:26): [True: 0, False: 0]
  ------------------
  351|       |         // KeyHash ::= OCTET STRING -- SHA-1 hash of responder's public key
  352|      0|         throw Decoding_Error("OCSP response contains a byKey with invalid length");
  353|      0|      }
  354|       |
  355|    950|      response_bytes.verify_end();
  356|    950|      response_bytes_ctx.verify_end();
  357|       |
  358|       |      // We don't currently recognize any extensions here so if any are critical we should reject
  359|    950|      m_has_unknown_critical_ext = !extensions.critical_extensions().empty();
  360|    950|   }
  361|       |
  362|  1.68k|   response_outer.verify_end();
  363|  1.68k|   outer_decoder.verify_end();
  364|       |
  365|  1.68k|   if(m_has_unknown_critical_ext == false) {
  ------------------
  |  Branch (365:7): [True: 5, False: 1.68k]
  ------------------
  366|       |      // Check all of the SingleResponse extensions
  367|      5|      for(const auto& sr : m_responses) {
  ------------------
  |  Branch (367:26): [True: 0, False: 5]
  ------------------
  368|      0|         if(sr.has_unknown_critical_extension()) {
  ------------------
  |  Branch (368:13): [True: 0, False: 0]
  ------------------
  369|      0|            m_has_unknown_critical_ext = true;
  370|      0|            break;
  371|      0|         }
  372|      0|      }
  373|      5|   }
  374|  1.68k|}
ocsp.cpp:_ZN5Botan4OCSP12_GLOBAL__N_120decode_optional_listERNS_11BER_DecoderENS_9ASN1_TypeERNSt3__16vectorINS_16X509_CertificateENS5_9allocatorIS7_EEEE:
  152|    606|void decode_optional_list(BER_Decoder& ber, ASN1_Type tag, std::vector<X509_Certificate>& output) {
  153|    606|   const BER_Object obj = ber.get_next_object();
  154|       |
  155|    606|   if(!obj.is_a(tag, ASN1_Class::ContextSpecific | ASN1_Class::Constructed)) {
  ------------------
  |  Branch (155:7): [True: 595, False: 11]
  ------------------
  156|    595|      ber.push_back(obj);
  157|    595|      return;
  158|    595|   }
  159|       |
  160|     11|   BER_Decoder list(obj, BER_Decoder::Limits::DER());
  161|     11|   auto seq = list.start_sequence();
  162|     18|   while(seq.more_items()) {
  ------------------
  |  Branch (162:10): [True: 7, False: 11]
  ------------------
  163|      7|      output.push_back([&] {
  164|      7|         X509_Certificate cert;
  165|      7|         cert.decode_from(seq);
  166|      7|         return cert;
  167|      7|      }());
  168|      7|   }
  169|     11|   seq.end_cons();
  170|     11|   list.verify_end();
  171|     11|}
ocsp.cpp:_ZZN5Botan4OCSP12_GLOBAL__N_120decode_optional_listERNS_11BER_DecoderENS_9ASN1_TypeERNSt3__16vectorINS_16X509_CertificateENS5_9allocatorIS7_EEEEENK3$_0clEv:
  163|      7|      output.push_back([&] {
  164|      7|         X509_Certificate cert;
  165|      7|         cert.decode_from(seq);
  166|      7|         return cert;
  167|      7|      }());

_ZN5Botan7X509_DN13add_attributeERKNS_3OIDERKNS_11ASN1_StringE:
  109|    119|void X509_DN::add_attribute(const OID& oid, const ASN1_String& str) {
  110|    119|   if(str.empty()) {
  ------------------
  |  Branch (110:7): [True: 6, False: 113]
  ------------------
  111|      6|      return;
  112|      6|   }
  113|       |
  114|    113|   m_rdn.push_back(std::make_pair(oid, str));
  115|    113|   m_dn_bits.clear();
  116|    113|}
_ZN5Botan7X509_DN11decode_fromERNS_11BER_DecoderE:
  338|    339|void X509_DN::decode_from(BER_Decoder& source) {
  339|    339|   std::vector<uint8_t> bits;
  340|       |
  341|    339|   source.start_sequence().raw_bytes(bits).end_cons();
  342|       |
  343|    339|   BER_Decoder sequence(bits, source.limits());
  344|       |
  345|    339|   m_rdn.clear();
  346|       |
  347|    690|   while(sequence.more_items()) {
  ------------------
  |  Branch (347:10): [True: 351, False: 339]
  ------------------
  348|    351|      BER_Decoder rdn = sequence.start_set();
  349|       |
  350|    683|      while(rdn.more_items()) {
  ------------------
  |  Branch (350:13): [True: 332, False: 351]
  ------------------
  351|    332|         OID oid;
  352|    332|         ASN1_String str;
  353|       |
  354|    332|         rdn.start_sequence()
  355|    332|            .decode(oid)
  356|    332|            .decode(str)  // TODO support Any
  357|    332|            .end_cons();
  358|       |
  359|    332|         add_attribute(oid, str);
  360|    332|      }
  361|    351|   }
  362|       |
  363|       |   // Have to assign last as add_attribute zaps m_dn_bits
  364|    339|   m_dn_bits = bits;
  365|    339|}

_ZN5Botan10Extensions11decode_fromERNS_11BER_DecoderE:
  290|      1|void Extensions::decode_from(BER_Decoder& from_source) {
  291|      1|   m_extension_oids.clear();
  292|      1|   m_extension_info.clear();
  293|       |
  294|      1|   BER_Decoder sequence = from_source.start_sequence();
  295|       |
  296|      1|   while(sequence.more_items()) {
  ------------------
  |  Branch (296:10): [True: 0, False: 1]
  ------------------
  297|      0|      OID oid;
  298|      0|      bool critical = false;
  299|      0|      std::vector<uint8_t> bits;
  300|       |
  301|      0|      sequence.start_sequence()
  302|      0|         .decode(oid)
  303|      0|         .decode_optional(critical, ASN1_Type::Boolean, ASN1_Class::Universal, false)
  304|      0|         .decode(bits, ASN1_Type::OctetString)
  305|      0|         .end_cons();
  306|       |
  307|      0|      auto obj = create_extn_obj(oid, critical, bits);
  308|      0|      Extensions_Info info(critical, bits, std::move(obj));
  309|       |
  310|       |      // RFC 5280 4.2: "A certificate MUST NOT include more than one
  311|       |      // instance of a particular extension."
  312|      0|      if(!m_extension_info.emplace(oid, info).second) {
  ------------------
  |  Branch (312:10): [True: 0, False: 0]
  ------------------
  313|      0|         throw Decoding_Error("Duplicate certificate extension encountered");
  314|      0|      }
  315|      0|      m_extension_oids.push_back(oid);
  316|      0|   }
  317|      1|   sequence.verify_end();
  318|      1|}

_ZNK5Botan11X509_Object11signed_bodyEv:
   66|      1|const std::vector<uint8_t>& X509_Object::signed_body() const {
   67|      1|   if(!m_signed_data) {
  ------------------
  |  Branch (67:7): [True: 0, False: 1]
  ------------------
   68|      0|      throw Invalid_State("X509_Object uninitialized");
   69|      0|   }
   70|      1|   return m_signed_data->m_tbs_bits;
   71|      1|}
_ZN5Botan11X509_Object11decode_fromERNS_11BER_DecoderE:
   93|      7|void X509_Object::decode_from(BER_Decoder& from) {
   94|      7|   auto data = std::make_shared<Signed_Data>();
   95|       |
   96|      7|   from.start_sequence()
   97|      7|      .start_sequence()
   98|      7|      .raw_bytes(data->m_tbs_bits)
   99|      7|      .end_cons()
  100|      7|      .decode(data->m_sig_algo)
  101|      7|      .decode(data->m_sig, ASN1_Type::BitString)
  102|      7|      .end_cons();
  103|       |
  104|      7|   m_signed_data = std::move(data);
  105|      7|   force_decode();
  106|      7|}

_ZN5Botan16X509_CertificateD2Ev:
   76|      7|X509_Certificate::~X509_Certificate() = default;
_ZN5Botan16X509_Certificate12force_decodeEv:
  338|      1|void X509_Certificate::force_decode() {
  339|      1|   m_data.reset();
  340|      1|   m_data = parse_x509_cert_body(*this);
  341|      1|}
x509cert.cpp:_ZN5Botan12_GLOBAL__N_120parse_x509_cert_bodyERKNS_11X509_ObjectE:
  104|      1|std::unique_ptr<X509_Certificate_Data> parse_x509_cert_body(const X509_Object& obj) {
  105|      1|   auto data = std::make_unique<X509_Certificate_Data>();
  106|       |
  107|      1|   BigInt serial_bn;
  108|      1|   BER_Object public_key;
  109|      1|   BER_Object v3_exts_data;
  110|       |
  111|      1|   BER_Decoder(obj.signed_body(), BER_Decoder::Limits::DER())
  112|      1|      .decode_optional(data->m_version, ASN1_Type(0), ASN1_Class::Constructed | ASN1_Class::ContextSpecific)
  113|      1|      .decode(serial_bn)
  114|      1|      .decode(data->m_sig_algo_inner)
  115|      1|      .decode(data->m_issuer_dn)
  116|      1|      .start_sequence()
  117|      1|      .decode(data->m_not_before)
  118|      1|      .decode(data->m_not_after)
  119|      1|      .end_cons()
  120|      1|      .decode(data->m_subject_dn)
  121|      1|      .get_next(public_key)
  122|      1|      .decode_optional_string(data->m_v2_issuer_key_id, ASN1_Type::BitString, 1)
  123|      1|      .decode_optional_string(data->m_v2_subject_key_id, ASN1_Type::BitString, 2)
  124|      1|      .get_next(v3_exts_data)
  125|      1|      .verify_end("TBSCertificate has extra data after extensions block");
  126|       |
  127|      1|   if(data->m_version > 2) {
  ------------------
  |  Branch (127:7): [True: 0, False: 1]
  ------------------
  128|      0|      throw Decoding_Error("Unknown X.509 cert version " + std::to_string(data->m_version));
  129|      0|   }
  130|      1|   if(obj.signature_algorithm() != data->m_sig_algo_inner) {
  ------------------
  |  Branch (130:7): [True: 0, False: 1]
  ------------------
  131|      0|      throw Decoding_Error("X.509 Certificate had differing algorithm identifiers in inner and outer ID fields");
  132|      0|   }
  133|       |
  134|      1|   public_key.assert_is_a(ASN1_Type::Sequence, ASN1_Class::Constructed, "X.509 certificate public key");
  135|       |
  136|       |   // for general sanity convert wire version (0 based) to standards version (v1 .. v3)
  137|      1|   data->m_version += 1;
  138|       |
  139|      1|   data->m_serial = serial_bn.serialize();
  140|       |   // crude method to save the serial's sign; will get lost during decoding, otherwise
  141|      1|   data->m_serial_negative = serial_bn.signum() < 0;
  142|      1|   data->m_subject_dn_bits = ASN1::put_in_sequence(data->m_subject_dn.get_bits());
  143|      1|   data->m_issuer_dn_bits = ASN1::put_in_sequence(data->m_issuer_dn.get_bits());
  144|       |
  145|      1|   data->m_subject_public_key_bits.assign(public_key.bits(), public_key.bits() + public_key.length());
  146|       |
  147|      1|   data->m_subject_public_key_bits_seq = ASN1::put_in_sequence(data->m_subject_public_key_bits);
  148|       |
  149|      1|   BER_Decoder(data->m_subject_public_key_bits, BER_Decoder::Limits::DER())
  150|      1|      .decode(data->m_subject_public_key_algid)
  151|      1|      .decode(data->m_subject_public_key_bitstring, ASN1_Type::BitString)
  152|      1|      .verify_end();
  153|       |
  154|      1|   if(v3_exts_data.is_a(3, ASN1_Class::Constructed | ASN1_Class::ContextSpecific)) {
  ------------------
  |  Branch (154:7): [True: 0, False: 1]
  ------------------
  155|       |      // Path validation will reject a v1/v2 cert with v3 extensions
  156|      0|      BER_Decoder(v3_exts_data, BER_Decoder::Limits::DER()).decode(data->m_v3_extensions).verify_end();
  157|      1|   } else if(v3_exts_data.is_set()) {
  ------------------
  |  Branch (157:14): [True: 0, False: 1]
  ------------------
  158|      0|      throw BER_Bad_Tag("Unknown tag in X.509 cert", v3_exts_data.tagging());
  159|      0|   }
  160|       |
  161|       |   // Now cache some fields from the extensions
  162|      1|   if(const auto* ext = data->m_v3_extensions.get_extension_object_as<Cert_Extension::Key_Usage>()) {
  ------------------
  |  Branch (162:19): [True: 0, False: 1]
  ------------------
  163|      0|      data->m_key_constraints = ext->get_constraints();
  164|       |      /*
  165|       |      RFC 5280: When the keyUsage extension appears in a certificate,
  166|       |      at least one of the bits MUST be set to 1.
  167|       |      */
  168|      0|      if(data->m_key_constraints.empty()) {
  ------------------
  |  Branch (168:10): [True: 0, False: 0]
  ------------------
  169|      0|         throw Decoding_Error("Certificate has invalid encoding for KeyUsage");
  170|      0|      }
  171|      0|   }
  172|       |
  173|      1|   if(const auto* ext = data->m_v3_extensions.get_extension_object_as<Cert_Extension::Subject_Key_ID>()) {
  ------------------
  |  Branch (173:19): [True: 0, False: 1]
  ------------------
  174|      0|      data->m_subject_key_id = ext->get_key_id();
  175|      0|   }
  176|       |
  177|      1|   if(const auto* ext = data->m_v3_extensions.get_extension_object_as<Cert_Extension::Authority_Key_ID>()) {
  ------------------
  |  Branch (177:19): [True: 0, False: 1]
  ------------------
  178|      0|      data->m_authority_key_id = ext->get_key_id();
  179|      0|   }
  180|       |
  181|      1|   if(const auto* ext = data->m_v3_extensions.get_extension_object_as<Cert_Extension::Name_Constraints>()) {
  ------------------
  |  Branch (181:19): [True: 0, False: 1]
  ------------------
  182|      0|      data->m_name_constraints = ext->get_name_constraints();
  183|      0|   }
  184|       |
  185|      1|   if(const auto* ext = data->m_v3_extensions.get_extension_object_as<Cert_Extension::Extended_Key_Usage>()) {
  ------------------
  |  Branch (185:19): [True: 0, False: 1]
  ------------------
  186|      0|      data->m_extended_key_usage = ext->object_identifiers();
  187|       |      /*
  188|       |      RFC 5280 section 4.2.1.12
  189|       |
  190|       |      "This extension indicates one or more purposes ..."
  191|       |
  192|       |      "If the extension is present, then the certificate MUST only be
  193|       |      used for one of the purposes indicated."
  194|       |
  195|       |      Thus we reject an EKU extension which is empty, since this indicates
  196|       |      the certificate cannot be used for any purpose.
  197|       |      */
  198|      0|      if(data->m_extended_key_usage.empty()) {
  ------------------
  |  Branch (198:10): [True: 0, False: 0]
  ------------------
  199|      0|         throw Decoding_Error("Certificate has invalid empty EKU extension");
  200|      0|      }
  201|      0|   }
  202|       |
  203|      1|   if(const auto* ext = data->m_v3_extensions.get_extension_object_as<Cert_Extension::Basic_Constraints>()) {
  ------------------
  |  Branch (203:19): [True: 0, False: 1]
  ------------------
  204|       |      /*
  205|       |      * RFC 5280 4.2.1.9 requires that conforming CAs "MUST mark the
  206|       |      * extension [basicConstraints] as critical in such certificates"
  207|       |      * but places no such requirement on validators.
  208|       |      */
  209|      0|      if(ext->is_ca() == true) {
  ------------------
  |  Branch (209:10): [True: 0, False: 0]
  ------------------
  210|       |         /*
  211|       |         * RFC 5280 section 4.2.1.3 requires that CAs include KeyUsage in all
  212|       |         * intermediate CA certificates they issue. Currently we accept it being
  213|       |         * missing, as do most other implementations. But it may be worth
  214|       |         * removing this entirely, or alternately adding a warning level
  215|       |         * validation failure for it.
  216|       |         */
  217|      0|         const bool allowed_by_ku =
  218|      0|            data->m_key_constraints.includes(Key_Constraints::KeyCertSign) || data->m_key_constraints.empty();
  ------------------
  |  Branch (218:13): [True: 0, False: 0]
  |  Branch (218:79): [True: 0, False: 0]
  ------------------
  219|       |
  220|       |         /*
  221|       |         * If the extended key usages are set then we must restrict the usage in
  222|       |         * accordance with it as well.
  223|       |         *
  224|       |         * RFC 5280 does not define any extended key usages compatible with certificate
  225|       |         * signing, but some CAs use serverAuth, clientAuth, OCSPSigning, or AnyExtendedKeyUsage
  226|       |         * for this purpose, even though clearly all of these (besides AEKU) are invalid.
  227|       |         * This check at least allows excluding a certificate which is set for only eg
  228|       |         * timestamping or code signing, and that seems about the best we can possibly enforce.
  229|       |         * OpenSSL, BoringSSL, and Go all completely ignore EKUs in determining ability to
  230|       |         * issue certs.
  231|       |         */
  232|      0|         const bool allowed_by_ext_ku = [](const std::vector<OID>& ext_ku) -> bool {
  233|      0|            if(ext_ku.empty()) {
  234|      0|               return true;
  235|      0|            }
  236|       |
  237|      0|            const auto server_auth = OID::from_name("PKIX.ServerAuth");
  238|      0|            const auto client_auth = OID::from_name("PKIX.ClientAuth");
  239|      0|            const auto ocsp_sign = OID::from_name("PKIX.OCSPSigning");
  240|      0|            const auto any_eku = OID::from_name("X509v3.AnyExtendedKeyUsage");
  241|       |
  242|      0|            for(const auto& oid : ext_ku) {
  243|      0|               if(oid == any_eku || oid == server_auth || oid == client_auth || oid == ocsp_sign) {
  244|      0|                  return true;
  245|      0|               }
  246|      0|            }
  247|       |
  248|      0|            return false;
  249|      0|         }(data->m_extended_key_usage);
  250|       |
  251|      0|         if(allowed_by_ku && allowed_by_ext_ku) {
  ------------------
  |  Branch (251:13): [True: 0, False: 0]
  |  Branch (251:30): [True: 0, False: 0]
  ------------------
  252|      0|            data->m_is_ca_certificate = true;
  253|      0|            data->m_path_len_constraint = ext->path_length_constraint();
  254|      0|         }
  255|      0|      }
  256|      0|   }
  257|       |
  258|      1|   if(const auto* ext = data->m_v3_extensions.get_extension_object_as<Cert_Extension::Issuer_Alternative_Name>()) {
  ------------------
  |  Branch (258:19): [True: 0, False: 1]
  ------------------
  259|      0|      data->m_issuer_alt_name = ext->get_alt_name();
  260|      0|   }
  261|       |
  262|      1|   if(const auto* ext = data->m_v3_extensions.get_extension_object_as<Cert_Extension::Subject_Alternative_Name>()) {
  ------------------
  |  Branch (262:19): [True: 0, False: 1]
  ------------------
  263|      0|      data->m_subject_alt_name = ext->get_alt_name();
  264|      0|   }
  265|       |
  266|       |   // This will be set even if SAN parsing failed entirely eg due to a decoding error
  267|       |   // or if the SAN is empty. This is used to guard against using the CN for domain
  268|       |   // name checking.
  269|      1|   const auto san_oid = OID::from_string("X509v3.SubjectAlternativeName");
  270|      1|   data->m_subject_alt_name_exists = data->m_v3_extensions.extension_set(san_oid);
  271|       |
  272|      1|   if(const auto* ext = data->m_v3_extensions.get_extension_object_as<Cert_Extension::Certificate_Policies>()) {
  ------------------
  |  Branch (272:19): [True: 0, False: 1]
  ------------------
  273|      0|      data->m_cert_policies = ext->get_policy_oids();
  274|      0|   }
  275|       |
  276|      1|   if(const auto* ext = data->m_v3_extensions.get_extension_object_as<Cert_Extension::Authority_Information_Access>()) {
  ------------------
  |  Branch (276:19): [True: 0, False: 1]
  ------------------
  277|      0|      data->m_ocsp_responders = ext->ocsp_responders();
  278|      0|      data->m_ca_issuers = ext->ca_issuers();
  279|      0|   }
  280|       |
  281|      1|   if(const auto* ext = data->m_v3_extensions.get_extension_object_as<Cert_Extension::CRL_Distribution_Points>()) {
  ------------------
  |  Branch (281:19): [True: 0, False: 1]
  ------------------
  282|      0|      data->m_crl_distribution_points = ext->crl_distribution_urls();
  283|      0|   }
  284|       |
  285|       |   /*
  286|       |   Determine if this certificate appears to be self-issued (subject == issuer).
  287|       |   This is only a heuristic used for path building so it's ok it is not precise.
  288|       |   The self-signature is verified during path validation.
  289|       |   */
  290|      1|   if(data->m_subject_dn == data->m_issuer_dn) {
  ------------------
  |  Branch (290:7): [True: 0, False: 1]
  ------------------
  291|      0|      if(!data->m_subject_key_id.empty() && !data->m_authority_key_id.empty()) {
  ------------------
  |  Branch (291:10): [True: 0, False: 0]
  |  Branch (291:45): [True: 0, False: 0]
  ------------------
  292|       |         /*
  293|       |         Both SKID and AKID are set so we can reliably determine self-signed vs
  294|       |         self-issued by comparing the two
  295|       |         */
  296|      0|         data->m_self_signed = (data->m_subject_key_id == data->m_authority_key_id);
  297|      0|      } else {
  298|       |         /*
  299|       |         Without both SKID and AKID we can't determine with certainty. Assume
  300|       |         self-signed since that's by far the common case.
  301|       |         */
  302|      0|         data->m_self_signed = true;
  303|      0|      }
  304|      0|   }
  305|       |
  306|      1|   const std::vector<uint8_t> full_encoding = obj.BER_encode();
  307|       |
  308|      1|   if(auto sha1 = HashFunction::create("SHA-1")) {
  ------------------
  |  Branch (308:12): [True: 0, False: 1]
  ------------------
  309|      0|      sha1->update(data->m_subject_public_key_bitstring);
  310|      0|      data->m_subject_public_key_bitstring_sha1 = sha1->final_stdvec();
  311|       |      // otherwise left as empty, and we will throw if subject_public_key_bitstring_sha1 is called
  312|       |
  313|      0|      sha1->update(full_encoding);
  314|      0|      sha1->final(data->m_cert_data_sha1);
  315|      0|      data->m_fingerprint_sha1 = format_hex_fingerprint(data->m_cert_data_sha1);
  316|      0|   }
  317|       |
  318|       |   // SHA-256 is a hard dependency of this module
  319|      1|   auto sha256 = HashFunction::create_or_throw("SHA-256");
  320|      1|   sha256->update(data->m_issuer_dn_bits);
  321|      1|   data->m_issuer_dn_bits_sha256 = sha256->final_stdvec();
  322|       |
  323|      1|   sha256->update(data->m_subject_dn_bits);
  324|      1|   data->m_subject_dn_bits_sha256 = sha256->final_stdvec();
  325|       |
  326|      1|   sha256->update(full_encoding);
  327|      1|   sha256->final(data->m_cert_data_sha256);
  328|      1|   data->m_fingerprint_sha256 = format_hex_fingerprint(data->m_cert_data_sha256);
  329|       |
  330|      1|   return data;
  331|      1|}

