_ZN5Botan17ct_expand_top_bitITkNSt3__117unsigned_integralEmEET_S2_:
   28|  16.7k|BOTAN_FORCE_INLINE constexpr T ct_expand_top_bit(T a) {
   29|  16.7k|   const T top = CT::value_barrier<T>(a >> (sizeof(T) * 8 - 1));
   30|  16.7k|   return static_cast<T>(0) - top;
   31|  16.7k|}
_ZN5Botan10ct_is_zeroITkNSt3__117unsigned_integralEmEET_S2_:
   37|  16.7k|BOTAN_FORCE_INLINE constexpr T ct_is_zero(T x) {
   38|  16.7k|   return ct_expand_top_bit<T>(~x & (x - 1));
   39|  16.7k|}
_ZN5Botan8high_bitITkNSt3__117unsigned_integralEmEEmT_:
   73|    183|BOTAN_FORCE_INLINE constexpr size_t high_bit(T n) {
   74|    183|   size_t hb = 0;
   75|       |
   76|  1.28k|   for(size_t s = 8 * sizeof(T) / 2; s > 0; s /= 2) {
  ------------------
  |  Branch (76:38): [True: 1.09k, False: 183]
  ------------------
   77|       |      // Equivalent to: ((n >> s) == 0) ? 0 : s;
   78|  1.09k|      const size_t z = s - ct_if_is_zero_ret<T>(n >> s, s);
   79|  1.09k|      hb += z;
   80|  1.09k|      n >>= z;
   81|  1.09k|   }
   82|       |
   83|    183|   hb += n;
   84|       |
   85|    183|   return hb;
   86|    183|}
_ZN5Botan17ct_if_is_zero_retITkNSt3__117unsigned_integralEmEEmT_m:
   45|  1.09k|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.09k|   const T a = ~x & (x - 1);
   51|  1.09k|   const size_t a_top = static_cast<size_t>(CT::value_barrier<T>(a >> (sizeof(T) * 8 - 1)));
   52|  1.09k|   const size_t mask = static_cast<size_t>(0) - a_top;
   53|  1.09k|   return mask & s;
   54|  1.09k|}
_ZN5Botan17ct_if_is_zero_retITkNSt3__117unsigned_integralEjEEmT_m:
   45|      5|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|      5|   const T a = ~x & (x - 1);
   51|      5|   const size_t a_top = static_cast<size_t>(CT::value_barrier<T>(a >> (sizeof(T) * 8 - 1)));
   52|      5|   const size_t mask = static_cast<size_t>(0) - a_top;
   53|      5|   return mask & s;
   54|      5|}
_ZN5Botan8high_bitITkNSt3__117unsigned_integralEjEEmT_:
   73|      1|BOTAN_FORCE_INLINE constexpr size_t high_bit(T n) {
   74|      1|   size_t hb = 0;
   75|       |
   76|      6|   for(size_t s = 8 * sizeof(T) / 2; s > 0; s /= 2) {
  ------------------
  |  Branch (76:38): [True: 5, False: 1]
  ------------------
   77|       |      // Equivalent to: ((n >> s) == 0) ? 0 : s;
   78|      5|      const size_t z = s - ct_if_is_zero_ret<T>(n >> s, s);
   79|      5|      hb += z;
   80|      5|      n >>= z;
   81|      5|   }
   82|       |
   83|      1|   hb += n;
   84|       |
   85|      1|   return hb;
   86|      1|}

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

_ZN5Botan12BufferSlicerC2ENSt3__14spanIKhLm18446744073709551615EEE:
   25|  1.84k|      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|     25|std::string fmt(std::string_view format, const T&... args) {
   54|     25|   std::ostringstream oss;
   55|     25|   oss.imbue(std::locale::classic());
   56|     25|   fmt_detail::do_fmt(oss, format, args...);
   57|     25|   return oss.str();
   58|     25|}
_ZN5Botan10fmt_detail6do_fmtIPKcJS3_S3_EEEvRNSt3__119basic_ostringstreamIcNS4_11char_traitsIcEENS4_9allocatorIcEEEENS4_17basic_string_viewIcS7_EERKT_DpRKT0_:
   25|     25|void do_fmt(std::ostringstream& oss, std::string_view format, const T& val, const Ts&... rest) {
   26|     25|   size_t i = 0;
   27|       |
   28|     25|   while(i < format.size()) {
  ------------------
  |  Branch (28:10): [True: 25, False: 0]
  ------------------
   29|     25|      if(format[i] == '{' && (format.size() > (i + 1)) && format.at(i + 1) == '}') {
  ------------------
  |  Branch (29:10): [True: 25, False: 0]
  |  Branch (29:30): [True: 25, False: 0]
  |  Branch (29:59): [True: 25, False: 0]
  ------------------
   30|     25|         oss << val;
   31|     25|         return do_fmt(oss, format.substr(i + 2), rest...);
   32|     25|      } else {
   33|      0|         oss << format[i];
   34|      0|      }
   35|       |
   36|      0|      i += 1;
   37|      0|   }
   38|     25|}
_ZN5Botan10fmt_detail6do_fmtIPKcJS3_EEEvRNSt3__119basic_ostringstreamIcNS4_11char_traitsIcEENS4_9allocatorIcEEEENS4_17basic_string_viewIcS7_EERKT_DpRKT0_:
   25|     25|void do_fmt(std::ostringstream& oss, std::string_view format, const T& val, const Ts&... rest) {
   26|     25|   size_t i = 0;
   27|       |
   28|    125|   while(i < format.size()) {
  ------------------
  |  Branch (28:10): [True: 125, False: 0]
  ------------------
   29|    125|      if(format[i] == '{' && (format.size() > (i + 1)) && format.at(i + 1) == '}') {
  ------------------
  |  Branch (29:10): [True: 25, False: 100]
  |  Branch (29:30): [True: 25, False: 0]
  |  Branch (29:59): [True: 25, False: 0]
  ------------------
   30|     25|         oss << val;
   31|     25|         return do_fmt(oss, format.substr(i + 2), rest...);
   32|    100|      } else {
   33|    100|         oss << format[i];
   34|    100|      }
   35|       |
   36|    100|      i += 1;
   37|    100|   }
   38|     25|}
_ZN5Botan10fmt_detail6do_fmtIPKcJEEEvRNSt3__119basic_ostringstreamIcNS4_11char_traitsIcEENS4_9allocatorIcEEEENS4_17basic_string_viewIcS7_EERKT_DpRKT0_:
   25|    129|void do_fmt(std::ostringstream& oss, std::string_view format, const T& val, const Ts&... rest) {
   26|    129|   size_t i = 0;
   27|       |
   28|  3.06k|   while(i < format.size()) {
  ------------------
  |  Branch (28:10): [True: 3.06k, False: 0]
  ------------------
   29|  3.06k|      if(format[i] == '{' && (format.size() > (i + 1)) && format.at(i + 1) == '}') {
  ------------------
  |  Branch (29:10): [True: 129, False: 2.93k]
  |  Branch (29:30): [True: 129, False: 0]
  |  Branch (29:59): [True: 129, False: 0]
  ------------------
   30|    129|         oss << val;
   31|    129|         return do_fmt(oss, format.substr(i + 2), rest...);
   32|  2.93k|      } else {
   33|  2.93k|         oss << format[i];
   34|  2.93k|      }
   35|       |
   36|  2.93k|      i += 1;
   37|  2.93k|   }
   38|    129|}
_ZN5Botan10fmt_detail6do_fmtERNSt3__119basic_ostringstreamIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS1_17basic_string_viewIcS4_EE:
   20|  1.42k|inline void do_fmt(std::ostringstream& oss, std::string_view format) {
   21|  1.42k|   oss << format;
   22|  1.42k|}
_ZN5Botan10fmt_detail6do_fmtINSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEJEEEvRNS2_19basic_ostringstreamIcS5_NS2_9allocatorIcEEEES6_RKT_DpRKT0_:
   25|    944|void do_fmt(std::ostringstream& oss, std::string_view format, const T& val, const Ts&... rest) {
   26|    944|   size_t i = 0;
   27|       |
   28|  6.76k|   while(i < format.size()) {
  ------------------
  |  Branch (28:10): [True: 6.76k, False: 0]
  ------------------
   29|  6.76k|      if(format[i] == '{' && (format.size() > (i + 1)) && format.at(i + 1) == '}') {
  ------------------
  |  Branch (29:10): [True: 944, False: 5.81k]
  |  Branch (29:30): [True: 944, False: 0]
  |  Branch (29:59): [True: 944, False: 0]
  ------------------
   30|    944|         oss << val;
   31|    944|         return do_fmt(oss, format.substr(i + 2), rest...);
   32|  5.81k|      } else {
   33|  5.81k|         oss << format[i];
   34|  5.81k|      }
   35|       |
   36|  5.81k|      i += 1;
   37|  5.81k|   }
   38|    944|}
_ZN5Botan3fmtIJNSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEEEENS1_12basic_stringIcS4_NS1_9allocatorIcEEEES5_DpRKT_:
   53|    944|std::string fmt(std::string_view format, const T&... args) {
   54|    944|   std::ostringstream oss;
   55|    944|   oss.imbue(std::locale::classic());
   56|    944|   fmt_detail::do_fmt(oss, format, args...);
   57|    944|   return oss.str();
   58|    944|}
_ZN5Botan3fmtIJPKcEEENSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEENS3_17basic_string_viewIcS6_EEDpRKT_:
   53|    104|std::string fmt(std::string_view format, const T&... args) {
   54|    104|   std::ostringstream oss;
   55|    104|   oss.imbue(std::locale::classic());
   56|    104|   fmt_detail::do_fmt(oss, format, args...);
   57|    104|   return oss.str();
   58|    104|}
_ZN5Botan3fmtIJNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEEEES7_NS1_17basic_string_viewIcS4_EEDpRKT_:
   53|     57|std::string fmt(std::string_view format, const T&... args) {
   54|     57|   std::ostringstream oss;
   55|     57|   oss.imbue(std::locale::classic());
   56|     57|   fmt_detail::do_fmt(oss, format, args...);
   57|     57|   return oss.str();
   58|     57|}
_ZN5Botan10fmt_detail6do_fmtINSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEJEEEvRNS2_19basic_ostringstreamIcS5_S7_EENS2_17basic_string_viewIcS5_EERKT_DpRKT0_:
   25|     57|void do_fmt(std::ostringstream& oss, std::string_view format, const T& val, const Ts&... rest) {
   26|     57|   size_t i = 0;
   27|       |
   28|  1.25k|   while(i < format.size()) {
  ------------------
  |  Branch (28:10): [True: 1.25k, False: 0]
  ------------------
   29|  1.25k|      if(format[i] == '{' && (format.size() > (i + 1)) && format.at(i + 1) == '}') {
  ------------------
  |  Branch (29:10): [True: 57, False: 1.19k]
  |  Branch (29:30): [True: 57, False: 0]
  |  Branch (29:59): [True: 57, False: 0]
  ------------------
   30|     57|         oss << val;
   31|     57|         return do_fmt(oss, format.substr(i + 2), rest...);
   32|  1.19k|      } else {
   33|  1.19k|         oss << format[i];
   34|  1.19k|      }
   35|       |
   36|  1.19k|      i += 1;
   37|  1.19k|   }
   38|     57|}
_ZN5Botan10fmt_detail6do_fmtIjJEEEvRNSt3__119basic_ostringstreamIcNS2_11char_traitsIcEENS2_9allocatorIcEEEENS2_17basic_string_viewIcS5_EERKT_DpRKT0_:
   25|    290|void do_fmt(std::ostringstream& oss, std::string_view format, const T& val, const Ts&... rest) {
   26|    290|   size_t i = 0;
   27|       |
   28|    616|   while(i < format.size()) {
  ------------------
  |  Branch (28:10): [True: 616, False: 0]
  ------------------
   29|    616|      if(format[i] == '{' && (format.size() > (i + 1)) && format.at(i + 1) == '}') {
  ------------------
  |  Branch (29:10): [True: 290, False: 326]
  |  Branch (29:30): [True: 290, False: 0]
  |  Branch (29:59): [True: 290, False: 0]
  ------------------
   30|    290|         oss << val;
   31|    290|         return do_fmt(oss, format.substr(i + 2), rest...);
   32|    326|      } else {
   33|    326|         oss << format[i];
   34|    326|      }
   35|       |
   36|    326|      i += 1;
   37|    326|   }
   38|    290|}
_ZN5Botan3fmtIJNSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEjEEENS1_12basic_stringIcS4_NS1_9allocatorIcEEEES5_DpRKT_:
   53|     36|std::string fmt(std::string_view format, const T&... args) {
   54|     36|   std::ostringstream oss;
   55|     36|   oss.imbue(std::locale::classic());
   56|     36|   fmt_detail::do_fmt(oss, format, args...);
   57|     36|   return oss.str();
   58|     36|}
_ZN5Botan10fmt_detail6do_fmtINSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEJjEEEvRNS2_19basic_ostringstreamIcS5_NS2_9allocatorIcEEEES6_RKT_DpRKT0_:
   25|     36|void do_fmt(std::ostringstream& oss, std::string_view format, const T& val, const Ts&... rest) {
   26|     36|   size_t i = 0;
   27|       |
   28|     36|   while(i < format.size()) {
  ------------------
  |  Branch (28:10): [True: 36, False: 0]
  ------------------
   29|     36|      if(format[i] == '{' && (format.size() > (i + 1)) && format.at(i + 1) == '}') {
  ------------------
  |  Branch (29:10): [True: 36, False: 0]
  |  Branch (29:30): [True: 36, False: 0]
  |  Branch (29:59): [True: 36, False: 0]
  ------------------
   30|     36|         oss << val;
   31|     36|         return do_fmt(oss, format.substr(i + 2), rest...);
   32|     36|      } else {
   33|      0|         oss << format[i];
   34|      0|      }
   35|       |
   36|      0|      i += 1;
   37|      0|   }
   38|     36|}
_ZN5Botan3fmtIJjjEEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS1_17basic_string_viewIcS4_EEDpRKT_:
   53|    254|std::string fmt(std::string_view format, const T&... args) {
   54|    254|   std::ostringstream oss;
   55|    254|   oss.imbue(std::locale::classic());
   56|    254|   fmt_detail::do_fmt(oss, format, args...);
   57|    254|   return oss.str();
   58|    254|}
_ZN5Botan10fmt_detail6do_fmtIjJjEEEvRNSt3__119basic_ostringstreamIcNS2_11char_traitsIcEENS2_9allocatorIcEEEENS2_17basic_string_viewIcS5_EERKT_DpRKT0_:
   25|    254|void do_fmt(std::ostringstream& oss, std::string_view format, const T& val, const Ts&... rest) {
   26|    254|   size_t i = 0;
   27|       |
   28|  7.33k|   while(i < format.size()) {
  ------------------
  |  Branch (28:10): [True: 7.33k, False: 0]
  ------------------
   29|  7.33k|      if(format[i] == '{' && (format.size() > (i + 1)) && format.at(i + 1) == '}') {
  ------------------
  |  Branch (29:10): [True: 254, False: 7.08k]
  |  Branch (29:30): [True: 254, False: 0]
  |  Branch (29:59): [True: 254, False: 0]
  ------------------
   30|    254|         oss << val;
   31|    254|         return do_fmt(oss, format.substr(i + 2), rest...);
   32|  7.08k|      } else {
   33|  7.08k|         oss << format[i];
   34|  7.08k|      }
   35|       |
   36|  7.08k|      i += 1;
   37|  7.08k|   }
   38|    254|}

_ZN5Botan11checked_mulITkNSt3__117unsigned_integralEmEENS1_8optionalIT_EES3_S3_:
   46|  4.97k|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.97k|   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.97k|   if(a != 0 && r / a != b) {
  ------------------
  |  Branch (53:7): [True: 4.97k, False: 0]
  |  Branch (53:17): [True: 0, False: 4.97k]
  ------------------
   54|      0|      return {};
   55|      0|   }
   56|  4.97k|   return r;
   57|  4.97k|}
_ZN5Botan11checked_addITkNSt3__117unsigned_integralEjEENS1_8optionalIT_EES3_S3_:
   19|    118|constexpr inline std::optional<T> checked_add(T a, T b) {
   20|    118|   const T r = a + b;
   21|    118|   if(r < a || r < b) {
  ------------------
  |  Branch (21:7): [True: 0, False: 118]
  |  Branch (21:16): [True: 0, False: 118]
  ------------------
   22|      0|      return {};
   23|      0|   }
   24|    118|   return r;
   25|    118|}

_ZN5Botan12get_byte_varImEEhmT_:
   69|  4.18k|inline constexpr uint8_t get_byte_var(size_t byte_num, T input) {
   70|  4.18k|   return static_cast<uint8_t>(input >> (((~byte_num) & (sizeof(T) - 1)) << 3));
   71|  4.18k|}
_ZN5Botan7load_beImJNSt3__14spanIKhLm8EEEEEEDaDpOT0_:
  504|  7.25k|inline constexpr auto load_be(ParamTs&&... params) {
  505|  7.25k|   return detail::load_any<std::endian::big, OutT>(std::forward<ParamTs>(params)...);
  506|  7.25k|}
_ZN5Botan6detail8load_anyILNSt3__16endianE64206ETkNS0_20unsigned_integralishEmTkNS_6ranges16contiguous_rangeIhEENS2_4spanIKhLm8EEEQnt15custom_loadableINS0_19wrapped_type_helperIu14__remove_cvrefIT0_EE4typeEEEESA_OT1_:
  278|  7.25k|inline constexpr WrappedOutT load_any(InR&& in_range) {
  279|  7.25k|   using OutT = detail::wrapped_type<WrappedOutT>;
  280|  7.25k|   ranges::assert_exact_byte_length<sizeof(OutT)>(in_range);
  281|       |
  282|  7.25k|   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.25k|      if(std::is_constant_evaluated()) /* TODO: C++23: if consteval {} */ {
  287|  7.25k|         return fallback_load_any<endianness, OutT>(std::forward<InR>(in_range));
  288|  7.25k|      } else {
  289|  7.25k|         const std::span in{in_range};
  290|  7.25k|         if constexpr(sizeof(OutT) == 1) {
  291|  7.25k|            return static_cast<OutT>(in[0]);
  292|  7.25k|         } else if constexpr(endianness == std::endian::native) {
  293|  7.25k|            return typecast_copy<OutT>(in);
  294|  7.25k|         } else {
  295|  7.25k|            static_assert(opposite(endianness) == std::endian::native);
  296|  7.25k|            return reverse_bytes(typecast_copy<OutT>(in));
  297|  7.25k|         }
  298|  7.25k|      }
  299|  7.25k|   }());
  300|  7.25k|}
_ZN5Botan6detail24wrap_strong_type_or_enumITkNS0_20unsigned_integralishEmTkNSt3__117unsigned_integralEmEEDaT0_:
  200|  8.48k|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.48k|   } else {
  204|  8.48k|      return Botan::wrap_strong_type<OutT>(t);
  205|  8.48k|   }
  206|  8.48k|}
_ZZN5Botan6detail8load_anyILNSt3__16endianE64206ETkNS0_20unsigned_integralishEmTkNS_6ranges16contiguous_rangeIhEENS2_4spanIKhLm8EEEQnt15custom_loadableINS0_19wrapped_type_helperIu14__remove_cvrefIT0_EE4typeEEEESA_OT1_ENKUlvE_clEv:
  282|  7.25k|   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.25k|      if(std::is_constant_evaluated()) /* TODO: C++23: if consteval {} */ {
  ------------------
  |  Branch (286:10): [Folded, False: 7.25k]
  ------------------
  287|      0|         return fallback_load_any<endianness, OutT>(std::forward<InR>(in_range));
  288|  7.25k|      } else {
  289|  7.25k|         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.25k|         } else {
  295|  7.25k|            static_assert(opposite(endianness) == std::endian::native);
  296|  7.25k|            return reverse_bytes(typecast_copy<OutT>(in));
  297|  7.25k|         }
  298|  7.25k|      }
  299|  7.25k|   }());
_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|   }());
_ZN5Botan8store_leINS_6detail10AutoDetectEJmEEEDaDpOT0_:
  736|    354|inline constexpr auto store_le(ParamTs&&... params) {
  737|    354|   return detail::store_any<std::endian::little, ModifierT>(std::forward<ParamTs>(params)...);
  738|    354|}
_ZN5Botan6detail9store_anyILNSt3__16endianE57005ENS0_10AutoDetectETpTkNS0_20unsigned_integralishEJmEQ10all_same_vIDpT1_EEEDaS6_:
  696|    354|inline constexpr auto store_any(Ts... ins) {
  697|    354|   return store_any<endianness, OutR>(std::array{ins...});
  698|    354|}
_ZN5Botan6detail9store_anyILNSt3__16endianE57005ENS0_10AutoDetectETkNS_6ranges14spanable_rangeENS2_5arrayImLm1EEEQoooosr3stdE7same_asIS4_T0_Eaasr6rangesE25statically_spanable_rangeIS8_Esr3stdE21default_initializableIS8_Esr8conceptsE21resizable_byte_bufferIS8_EEEDaOT1_:
  663|    354|inline constexpr auto store_any(InR&& in_range) {
  664|    354|   auto out = []([[maybe_unused]] const auto& in) {
  665|    354|      if constexpr(std::same_as<AutoDetect, OutR>) {
  666|    354|         if constexpr(ranges::statically_spanable_range<InR>) {
  667|    354|            constexpr size_t bytes = decltype(std::span{in})::extent * sizeof(std::ranges::range_value_t<InR>);
  668|    354|            return std::array<uint8_t, bytes>();
  669|    354|         } else {
  670|    354|            static_assert(
  671|    354|               !std::same_as<AutoDetect, OutR>,
  672|    354|               "cannot infer a suitable result container type from the given parameters at compile time, please specify it explicitly");
  673|    354|         }
  674|    354|      } else if constexpr(concepts::resizable_byte_buffer<OutR>) {
  675|    354|         return OutR(std::span{in}.size_bytes());
  676|    354|      } else {
  677|    354|         return OutR{};
  678|    354|      }
  679|    354|   }(in_range);
  680|       |
  681|    354|   store_any<endianness, std::ranges::range_value_t<InR>>(out, std::forward<InR>(in_range));
  682|    354|   return out;
  683|    354|}
_ZZN5Botan6detail9store_anyILNSt3__16endianE57005ENS0_10AutoDetectETkNS_6ranges14spanable_rangeENS2_5arrayImLm1EEEQoooosr3stdE7same_asIS4_T0_Eaasr6rangesE25statically_spanable_rangeIS8_Esr3stdE21default_initializableIS8_Esr8conceptsE21resizable_byte_bufferIS8_EEEDaOT1_ENKUlRKT_E_clIS7_EEDaSD_:
  664|    354|   auto out = []([[maybe_unused]] const auto& in) {
  665|    354|      if constexpr(std::same_as<AutoDetect, OutR>) {
  666|    354|         if constexpr(ranges::statically_spanable_range<InR>) {
  667|    354|            constexpr size_t bytes = decltype(std::span{in})::extent * sizeof(std::ranges::range_value_t<InR>);
  668|    354|            return std::array<uint8_t, bytes>();
  669|       |         } else {
  670|       |            static_assert(
  671|       |               !std::same_as<AutoDetect, OutR>,
  672|       |               "cannot infer a suitable result container type from the given parameters at compile time, please specify it explicitly");
  673|       |         }
  674|       |      } else if constexpr(concepts::resizable_byte_buffer<OutR>) {
  675|       |         return OutR(std::span{in}.size_bytes());
  676|       |      } else {
  677|       |         return OutR{};
  678|       |      }
  679|    354|   }(in_range);
_ZN5Botan6detail9store_anyILNSt3__16endianE57005EmTkNS_6ranges23contiguous_output_rangeIhEERNS2_5arrayIhLm8EEETkNS4_14spanable_rangeENS6_ImLm1EEEQoosr3stdE7same_asINS0_10AutoDetectET0_Esr3stdE7same_asISB_NS2_11conditionalIXsr21__is_primary_templateINS2_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS2_6ranges5__cpo5beginEEclsr3stdE7declvalIRT2_EEEEEEEEE5valueENS2_26indirectly_readable_traitsISJ_EESK_E4type10value_typeEEEEvOT1_RKSG_:
  603|    354|inline constexpr void store_any(OutR&& out /* NOLINT(*-std-forward) */, const InR& in) {
  604|    354|   ranges::assert_equal_byte_lengths(out, in);
  605|    354|   using element_type = std::ranges::range_value_t<InR>;
  606|       |
  607|    354|   auto store_elementwise = [&] {
  608|    354|      constexpr size_t bytes_per_element = sizeof(element_type);
  609|    354|      std::span<uint8_t> out_s(out);
  610|    354|      for(auto in_elem : in) {
  611|    354|         store_any<endianness, element_type>(out_s.template first<bytes_per_element>(), in_elem);
  612|    354|         out_s = out_s.subspan(bytes_per_element);
  613|    354|      }
  614|    354|   };
  615|       |
  616|       |   // At compile time we cannot use `typecast_copy` as it uses `std::memcpy`
  617|       |   // internally to copy ranges on a byte-by-byte basis, which is not allowed
  618|       |   // in a `constexpr` context.
  619|    354|   if(std::is_constant_evaluated()) /* TODO: C++23: if consteval {} */ {
  ------------------
  |  Branch (619:7): [Folded, False: 354]
  ------------------
  620|      0|      store_elementwise();
  621|    354|   } else {
  622|    354|      if constexpr(endianness == std::endian::native && !custom_storable<element_type>) {
  623|    354|         typecast_copy(out, in);
  624|       |      } else {
  625|       |         store_elementwise();
  626|       |      }
  627|    354|   }
  628|    354|}
_ZN5Botan6detail24wrap_strong_type_or_enumITkNS0_20unsigned_integralishEjTkNSt3__117unsigned_integralEjEEDaT0_:
  200|     86|constexpr auto wrap_strong_type_or_enum(T t) {
  201|       |   if constexpr(std::is_enum_v<OutT>) {
  202|       |      return static_cast<OutT>(t);
  203|     86|   } else {
  204|     86|      return Botan::wrap_strong_type<OutT>(t);
  205|     86|   }
  206|     86|}
_ZN5Botan6detail8load_anyILNSt3__16endianE64206ETkNS0_20unsigned_integralishEjTkNS_6ranges16contiguous_rangeIhEENS2_4spanIKhLm4EEEQnt15custom_loadableINS0_19wrapped_type_helperIu14__remove_cvrefIT0_EE4typeEEEESA_OT1_:
  278|     86|inline constexpr WrappedOutT load_any(InR&& in_range) {
  279|     86|   using OutT = detail::wrapped_type<WrappedOutT>;
  280|     86|   ranges::assert_exact_byte_length<sizeof(OutT)>(in_range);
  281|       |
  282|     86|   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|     86|      if(std::is_constant_evaluated()) /* TODO: C++23: if consteval {} */ {
  287|     86|         return fallback_load_any<endianness, OutT>(std::forward<InR>(in_range));
  288|     86|      } else {
  289|     86|         const std::span in{in_range};
  290|     86|         if constexpr(sizeof(OutT) == 1) {
  291|     86|            return static_cast<OutT>(in[0]);
  292|     86|         } else if constexpr(endianness == std::endian::native) {
  293|     86|            return typecast_copy<OutT>(in);
  294|     86|         } else {
  295|     86|            static_assert(opposite(endianness) == std::endian::native);
  296|     86|            return reverse_bytes(typecast_copy<OutT>(in));
  297|     86|         }
  298|     86|      }
  299|     86|   }());
  300|     86|}
_ZZN5Botan6detail8load_anyILNSt3__16endianE64206ETkNS0_20unsigned_integralishEjTkNS_6ranges16contiguous_rangeIhEENS2_4spanIKhLm4EEEQnt15custom_loadableINS0_19wrapped_type_helperIu14__remove_cvrefIT0_EE4typeEEEESA_OT1_ENKUlvE_clEv:
  282|     86|   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|     86|      if(std::is_constant_evaluated()) /* TODO: C++23: if consteval {} */ {
  ------------------
  |  Branch (286:10): [Folded, False: 86]
  ------------------
  287|      0|         return fallback_load_any<endianness, OutT>(std::forward<InR>(in_range));
  288|     86|      } else {
  289|     86|         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|     86|         } else {
  295|     86|            static_assert(opposite(endianness) == std::endian::native);
  296|     86|            return reverse_bytes(typecast_copy<OutT>(in));
  297|     86|         }
  298|     86|      }
  299|     86|   }());
_ZN5Botan7load_beItJPKhRmEEEDaDpOT0_:
  504|     87|inline constexpr auto load_be(ParamTs&&... params) {
  505|     87|   return detail::load_any<std::endian::big, OutT>(std::forward<ParamTs>(params)...);
  506|     87|}
_ZN5Botan6detail8load_anyILNSt3__16endianE64206ETkNS0_20unsigned_integralishEtEET0_PKhm:
  454|     87|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|     87|   constexpr size_t out_size = sizeof(OutT);
  457|     87|   return load_any<endianness, OutT>(std::span<const uint8_t, out_size>(in + off * out_size, out_size));
  458|     87|}
_ZN5Botan6detail8load_anyILNSt3__16endianE64206ETkNS0_20unsigned_integralishEtTkNS_6ranges16contiguous_rangeIhEENS2_4spanIKhLm2EEEQnt15custom_loadableINS0_19wrapped_type_helperIu14__remove_cvrefIT0_EE4typeEEEESA_OT1_:
  278|     87|inline constexpr WrappedOutT load_any(InR&& in_range) {
  279|     87|   using OutT = detail::wrapped_type<WrappedOutT>;
  280|     87|   ranges::assert_exact_byte_length<sizeof(OutT)>(in_range);
  281|       |
  282|     87|   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|     87|      if(std::is_constant_evaluated()) /* TODO: C++23: if consteval {} */ {
  287|     87|         return fallback_load_any<endianness, OutT>(std::forward<InR>(in_range));
  288|     87|      } else {
  289|     87|         const std::span in{in_range};
  290|     87|         if constexpr(sizeof(OutT) == 1) {
  291|     87|            return static_cast<OutT>(in[0]);
  292|     87|         } else if constexpr(endianness == std::endian::native) {
  293|     87|            return typecast_copy<OutT>(in);
  294|     87|         } else {
  295|     87|            static_assert(opposite(endianness) == std::endian::native);
  296|     87|            return reverse_bytes(typecast_copy<OutT>(in));
  297|     87|         }
  298|     87|      }
  299|     87|   }());
  300|     87|}
_ZN5Botan6detail24wrap_strong_type_or_enumITkNS0_20unsigned_integralishEtTkNSt3__117unsigned_integralEtEEDaT0_:
  200|     87|constexpr auto wrap_strong_type_or_enum(T t) {
  201|       |   if constexpr(std::is_enum_v<OutT>) {
  202|       |      return static_cast<OutT>(t);
  203|     87|   } else {
  204|     87|      return Botan::wrap_strong_type<OutT>(t);
  205|     87|   }
  206|     87|}
_ZZN5Botan6detail8load_anyILNSt3__16endianE64206ETkNS0_20unsigned_integralishEtTkNS_6ranges16contiguous_rangeIhEENS2_4spanIKhLm2EEEQnt15custom_loadableINS0_19wrapped_type_helperIu14__remove_cvrefIT0_EE4typeEEEESA_OT1_ENKUlvE_clEv:
  282|     87|   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|     87|      if(std::is_constant_evaluated()) /* TODO: C++23: if consteval {} */ {
  ------------------
  |  Branch (286:10): [Folded, False: 87]
  ------------------
  287|      0|         return fallback_load_any<endianness, OutT>(std::forward<InR>(in_range));
  288|     87|      } else {
  289|     87|         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|     87|         } else {
  295|     87|            static_assert(opposite(endianness) == std::endian::native);
  296|     87|            return reverse_bytes(typecast_copy<OutT>(in));
  297|     87|         }
  298|     87|      }
  299|     87|   }());
_ZN5Botan7load_beIjJPKhRmEEEDaDpOT0_:
  504|     86|inline constexpr auto load_be(ParamTs&&... params) {
  505|     86|   return detail::load_any<std::endian::big, OutT>(std::forward<ParamTs>(params)...);
  506|     86|}
_ZN5Botan6detail8load_anyILNSt3__16endianE64206ETkNS0_20unsigned_integralishEjEET0_PKhm:
  454|     86|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|     86|   constexpr size_t out_size = sizeof(OutT);
  457|     86|   return load_any<endianness, OutT>(std::span<const uint8_t, out_size>(in + off * out_size, out_size));
  458|     86|}

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

_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.21k, False: 29]
  ------------------
   31|  1.21k|      const size_t adj = align_to - (n % align_to);
   32|  1.21k|      BOTAN_ARG_CHECK(n + adj >= n, "Integer overflow during rounding");
  ------------------
  |  |   35|  1.21k|   do {                                                          \
  |  |   36|  1.21k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */              \
  |  |   37|  1.21k|      if(!(expr)) {                                              \
  |  |  ------------------
  |  |  |  Branch (37:10): [True: 0, False: 1.21k]
  |  |  ------------------
  |  |   38|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */     \
  |  |   39|      0|         Botan::throw_invalid_argument(msg, __func__, __FILE__); \
  |  |   40|      0|      }                                                          \
  |  |   41|  1.21k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 1.21k]
  |  |  ------------------
  ------------------
   33|  1.21k|      n += adj;
   34|  1.21k|   }
   35|  1.24k|   return n;
   36|  1.24k|}

_ZN5Botan2CT13value_barrierITkNSt3__117unsigned_integralEmQntsr3stdE7same_asIbT_EEES3_S3_:
   43|  18.0k|constexpr inline T value_barrier(T x) {
   44|  18.0k|   if(std::is_constant_evaluated()) {
  ------------------
  |  Branch (44:7): [Folded, False: 18.0k]
  ------------------
   45|      0|      return x;
   46|  18.0k|   } else {
   47|  18.0k|#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.0k|      asm("" : "+r"(x) : /* no input */);  // NOLINT(*-no-assembler)
   56|  18.0k|      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.0k|   }
   64|  18.0k|}
_ZN5Botan2CT13value_barrierITkNSt3__117unsigned_integralEjQntsr3stdE7same_asIbT_EEES3_S3_:
   43|      5|constexpr inline T value_barrier(T x) {
   44|      5|   if(std::is_constant_evaluated()) {
  ------------------
  |  Branch (44:7): [Folded, False: 5]
  ------------------
   45|      0|      return x;
   46|      5|   } else {
   47|      5|#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|      5|      asm("" : "+r"(x) : /* no input */);  // NOLINT(*-no-assembler)
   56|      5|      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|      5|   }
   64|      5|}

_ZN5Botan11ASN1_ObjectD2Ev:
  122|  11.8k|      virtual ~ASN1_Object() = default;
_ZNK5Botan10BER_Object6is_setEv:
  138|  31.3k|      bool is_set() const { return m_type_tag != ASN1_Type::NoObject; }
_ZNK5Botan10BER_Object7taggingEv:
  140|  13.5k|      uint32_t tagging() const { return type_tag() | class_tag(); }
_ZNK5Botan10BER_Object8type_tagEv:
  142|  13.5k|      ASN1_Type type_tag() const { return m_type_tag; }
_ZNK5Botan10BER_Object9class_tagEv:
  144|  14.7k|      ASN1_Class class_tag() const { return m_class_tag; }
_ZNK5Botan10BER_Object4typeEv:
  146|  1.25k|      ASN1_Type type() const { return m_type_tag; }
_ZNK5Botan10BER_Object9get_classEv:
  148|    898|      ASN1_Class get_class() const { return m_class_tag; }
_ZNK5Botan10BER_Object4bitsEv:
  150|  47.3k|      const uint8_t* bits() const { return m_value.data(); }
_ZNK5Botan10BER_Object6lengthEv:
  152|   139k|      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.6k|      uint8_t* mutable_bits(size_t length) {
  172|  11.6k|         m_value.resize(length);
  173|  11.6k|         return m_value.data();
  174|  11.6k|      }
_ZNK5Botan3OIDeqERKS0_:
  301|    866|      bool operator==(const OID& other) const { return m_id == other.m_id; }
_ZNK5Botan11ASN1_String5valueEv:
  365|    118|      const std::string& value() const { return m_utf8_str; }
_ZN5BotanorENS_10ASN1_ClassES0_:
   78|  8.29k|inline ASN1_Class operator|(ASN1_Class x, ASN1_Class y) {
   79|  8.29k|   return static_cast<ASN1_Class>(static_cast<uint32_t>(x) | static_cast<uint32_t>(y));
   80|  8.29k|}
_ZN5BotanorENS_9ASN1_TypeENS_10ASN1_ClassE:
   82|  13.5k|inline uint32_t operator|(ASN1_Type x, ASN1_Class y) {
   83|  13.5k|   return static_cast<uint32_t>(x) | static_cast<uint32_t>(y);
   84|  13.5k|}
_ZN5BotanorENS_10ASN1_ClassENS_9ASN1_TypeE:
   86|  1.87k|inline uint32_t operator|(ASN1_Class x, ASN1_Type y) {
   87|  1.87k|   return static_cast<uint32_t>(x) | static_cast<uint32_t>(y);
   88|  1.87k|}
_ZN5BotanneERKNS_3OIDES2_:
  342|    866|inline bool operator!=(const OID& a, const OID& b) {
  343|    866|   return !(a == b);
  344|    866|}
_ZN5Botan11ASN1_ObjectC2Ev:
  117|  11.0k|      ASN1_Object() = default;
_ZN5Botan19AlgorithmIdentifierC2Ev:
  399|  1.77k|      AlgorithmIdentifier() = default;
_ZN5Botan3OIDC2Ev:
  220|  3.05k|      explicit OID() = default;
_ZN5Botan10BER_ObjectC2Ev:
  130|  23.4k|      BER_Object() = default;
_ZN5Botan10BER_ObjectaSEOS0_:
  135|  2.86k|      BER_Object& operator=(BER_Object&& other) = default;
_ZN5Botan11ASN1_ObjectC2ERKS0_:
  118|    354|      ASN1_Object(const ASN1_Object&) = default;
_ZN5Botan11ASN1_ObjectC2EOS0_:
  120|    370|      ASN1_Object(ASN1_Object&&) = default;
_ZN5Botan11ASN1_ObjectaSERKS0_:
  119|    314|      ASN1_Object& operator=(const ASN1_Object&) = default;
_ZN5Botan10BER_ObjectaSERKS0_:
  134|    580|      BER_Object& operator=(const BER_Object& other) = default;
_ZN5Botan10BER_ObjectC2EOS0_:
  133|  7.02k|      BER_Object(BER_Object&& other) = default;

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

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

_ZN5Botan11BER_Decoder14start_sequenceEv:
  160|  5.29k|      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.94k|            static Limits DER() { return Limits(false, 0); }
_ZN5Botan11BER_Decoder6LimitsC2Ebm:
   54|  2.94k|                  m_allow_ber(allow_ber), m_max_nested_indef(max_nested_indef) {}
_ZN5Botan11BER_DecoderC2ERKNS_10BER_ObjectENS0_6LimitsE:
   81|    365|            BER_Decoder(obj.data(), limits) {}
_ZN5Botan11BER_Decoder22start_context_specificEj:
  164|    960|      BER_Decoder start_context_specific(uint32_t tag) {
  165|    960|         return start_cons(ASN1_Type(tag), ASN1_Class::ContextSpecific);
  166|    960|      }
_ZN5Botan11BER_Decoder21get_next_octet_stringEv:
  232|    631|      std::vector<uint8_t> get_next_octet_string() {
  233|    631|         std::vector<uint8_t> out_vec;
  234|    631|         decode(out_vec, ASN1_Type::OctetString);
  235|    631|         return out_vec;
  236|    631|      }
_ZN5Botan11BER_Decoder6decodeINSt3__19allocatorIhEEEERS0_RNS2_6vectorIhT_EENS_9ASN1_TypeE:
  242|  1.24k|      BER_Decoder& decode(std::vector<uint8_t, Alloc>& out, ASN1_Type real_type) {
  243|  1.24k|         return decode(out, real_type, real_type, ASN1_Class::Universal);
  244|  1.24k|      }
_ZN5Botan11BER_Decoder16decode_and_checkINS_3OIDEEERS0_RKT_NSt3__117basic_string_viewIcNS7_11char_traitsIcEEEE:
  327|    934|      BER_Decoder& decode_and_check(const T& expected, std::string_view error_msg) {
  328|    934|         T actual;
  329|    934|         decode(actual);
  330|       |
  331|    934|         if(actual != expected) {
  ------------------
  |  Branch (331:13): [True: 235, False: 699]
  ------------------
  332|    235|            throw Decoding_Error(error_msg);
  333|    235|         }
  334|       |
  335|    699|         return (*this);
  336|    934|      }
_ZN5Botan11BER_Decoder9raw_bytesINSt3__19allocatorIhEEEERS0_RNS2_6vectorIhT_EE:
  203|  1.57k|      BER_Decoder& raw_bytes(std::vector<uint8_t, Alloc>& out) {
  204|  1.57k|         out.clear();
  205|  16.6k|         for(;;) {
  206|  16.6k|            if(auto next = this->read_next_byte()) {
  ------------------
  |  Branch (206:21): [True: 15.0k, False: 1.57k]
  ------------------
  207|  15.0k|               out.push_back(*next);
  208|  15.0k|            } else {
  209|  1.57k|               break;
  210|  1.57k|            }
  211|  16.6k|         }
  212|  1.57k|         return (*this);
  213|  1.57k|      }
_ZN5Botan11BER_Decoder15decode_optionalImEERS0_RT_NS_9ASN1_TypeENS_10ASN1_ClassERKS3_:
  285|    540|      BER_Decoder& decode_optional(T& out, ASN1_Type type_tag, ASN1_Class class_tag, const T& default_value = T()) {
  286|    540|         std::optional<T> optval;
  287|    540|         this->decode_optional(optval, type_tag, class_tag);
  288|    540|         out = optval ? *optval : default_value;
  ------------------
  |  Branch (288:16): [True: 3, False: 537]
  ------------------
  289|    540|         return (*this);
  290|    540|      }
_ZN5Botan11BER_Decoder15decode_optionalImEERS0_RNSt3__18optionalIT_EENS_9ASN1_TypeENS_10ASN1_ClassE:
  394|    540|BER_Decoder& BER_Decoder::decode_optional(std::optional<T>& optval, ASN1_Type type_tag, ASN1_Class class_tag) {
  395|    540|   BER_Object obj = get_next_object();
  396|       |
  397|    540|   if(obj.is_a(type_tag, class_tag)) {
  ------------------
  |  Branch (397:7): [True: 6, False: 534]
  ------------------
  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|    534|   } else {
  407|    534|      this->push_back(std::move(obj));
  408|    534|      optval = std::nullopt;
  409|    534|   }
  410|       |
  411|    540|   return (*this);
  412|    540|}
_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|    535|      BER_Decoder& decode_optional(T& out, ASN1_Type type_tag, ASN1_Class class_tag, const T& default_value = T()) {
  286|    535|         std::optional<T> optval;
  287|    535|         this->decode_optional(optval, type_tag, class_tag);
  288|    535|         out = optval ? *optval : default_value;
  ------------------
  |  Branch (288:16): [True: 122, False: 413]
  ------------------
  289|    535|         return (*this);
  290|    535|      }
_ZN5Botan11BER_Decoder15decode_optionalINS_7X509_DNEEERS0_RNSt3__18optionalIT_EENS_9ASN1_TypeENS_10ASN1_ClassE:
  394|    535|BER_Decoder& BER_Decoder::decode_optional(std::optional<T>& optval, ASN1_Type type_tag, ASN1_Class class_tag) {
  395|    535|   BER_Object obj = get_next_object();
  396|       |
  397|    535|   if(obj.is_a(type_tag, class_tag)) {
  ------------------
  |  Branch (397:7): [True: 343, False: 192]
  ------------------
  398|    343|      T out{};
  399|    343|      if(class_tag == ASN1_Class::ExplicitContextSpecific) {
  ------------------
  |  Branch (399:10): [True: 343, False: 0]
  ------------------
  400|    343|         BER_Decoder(obj, m_limits).decode(out).verify_end();
  401|    343|      } else {
  402|      0|         this->push_back(std::move(obj));
  403|      0|         this->decode(out, type_tag, class_tag);
  404|      0|      }
  405|    343|      optval = std::move(out);
  406|    343|   } else {
  407|    192|      this->push_back(std::move(obj));
  408|    192|      optval = std::nullopt;
  409|    192|   }
  410|       |
  411|    535|   return (*this);
  412|    535|}
_ZN5Botan11BER_Decoder22decode_optional_stringINSt3__19allocatorIhEEEERS0_RNS2_6vectorIhT_EENS_9ASN1_TypeEjNS_10ASN1_ClassE:
  345|    314|                                          ASN1_Class class_tag = ASN1_Class::ContextSpecific) {
  346|    314|         BER_Object obj = get_next_object();
  347|       |
  348|    314|         const ASN1_Type type_tag = static_cast<ASN1_Type>(expected_tag);
  349|       |
  350|    314|         if(obj.is_a(type_tag, class_tag)) {
  ------------------
  |  Branch (350:13): [True: 5, False: 309]
  ------------------
  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|    309|         } else {
  358|    309|            out.clear();
  359|    309|            push_back(std::move(obj));
  360|    309|         }
  361|       |
  362|    314|         return (*this);
  363|    314|      }
_ZN5Botan11BER_Decoder11decode_listINS_4OCSP14SingleResponseEEERS0_RNSt3__16vectorIT_NS5_9allocatorIS7_EEEENS_9ASN1_TypeENS_10ASN1_ClassE:
  443|     21|BER_Decoder& BER_Decoder::decode_list(std::vector<T>& vec, ASN1_Type type_tag, ASN1_Class class_tag) {
  444|     21|   BER_Decoder list = start_cons(type_tag, class_tag);
  445|       |
  446|     23|   while(list.more_items()) {
  ------------------
  |  Branch (446:10): [True: 2, False: 21]
  ------------------
  447|      2|      T value;
  448|      2|      list.decode(value);
  449|      2|      vec.push_back(std::move(value));
  450|      2|   }
  451|       |
  452|     21|   list.end_cons();
  453|       |
  454|     21|   return (*this);
  455|     21|}
_ZNK5Botan11BER_Decoder6Limits18allow_ber_encodingEv:
   44|  26.4k|            bool allow_ber_encoding() const { return m_allow_ber; }
_ZNK5Botan11BER_Decoder6Limits20require_der_encodingEv:
   46|  14.4k|            bool require_der_encoding() const { return !allow_ber_encoding(); }
_ZNK5Botan11BER_Decoder6limitsEv:
   98|  6.45k|      Limits limits() const { return m_limits; }
_ZN5Botan11BER_Decoder9start_setEv:
  162|    339|      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: 962, False: 283]
  ------------------
  469|    962|            return 0;
  470|    962|         }
  471|    283|         return (sign() == Negative) ? -1 : 1;
  ------------------
  |  Branch (471:17): [True: 100, False: 183]
  ------------------
  472|  1.24k|      }
_ZNK5Botan6BigInt7is_zeroEv:
  484|    100|      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|    383|      Sign sign() const { return (m_signedness); }
_ZNK5Botan6BigInt12reverse_signEv:
  609|    100|      Sign reverse_sign() const {
  610|    100|         if(sign() == Positive) {
  ------------------
  |  Branch (610:13): [True: 100, False: 0]
  ------------------
  611|    100|            return Negative;
  612|    100|         }
  613|      0|         return Positive;
  614|    100|      }
_ZN5Botan6BigInt9flip_signEv:
  619|    100|      BOTAN_DEPRECATED("Deprecated no replacement") void flip_sign() { set_sign(reverse_sign()); }
_ZN5Botan6BigInt8set_signENS0_4SignE:
  625|    100|      void set_sign(Sign sign) {
  626|    100|         if(sign == Negative && is_zero()) {
  ------------------
  |  Branch (626:13): [True: 100, False: 0]
  |  Branch (626:33): [True: 0, False: 100]
  ------------------
  627|      0|            sign = Positive;
  628|      0|         }
  629|       |
  630|    100|         m_signedness = sign;
  631|    100|      }
_ZNK5Botan6BigInt9sig_wordsEv:
  648|  2.67k|      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.67k|            size_t sig_words() const {
 1103|  2.67k|               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.67k|               return m_sig_words;
 1107|  2.67k|            }
_ZN5Botan6BigIntC2Ev:
   45|  1.34k|      BigInt() = default;

_ZN5Botan10DataSourceC2Ev:
  100|  9.75k|      DataSource() = default;
_ZN5Botan10DataSourceD2Ev:
  101|  9.75k|      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) {}

_ZN5Botan11DER_Encoder10add_objectENS_9ASN1_TypeENS_10ASN1_ClassENSt3__14spanIKhLm18446744073709551615EEE:
  184|    118|      DER_Encoder& add_object(ASN1_Type type_tag, ASN1_Class class_tag, std::span<const uint8_t> rep) {
  185|    118|         return add_object(type_tag, class_tag, rep.data(), rep.size());
  186|    118|      }
_ZN5Botan11DER_Encoder10add_objectENS_9ASN1_TypeENS_10ASN1_ClassERKNSt3__16vectorIhNS3_9allocatorIhEEEE:
  188|    118|      DER_Encoder& add_object(ASN1_Type type_tag, ASN1_Class class_tag, const std::vector<uint8_t>& rep) {
  189|    118|         return add_object(type_tag, class_tag, std::span{rep});
  190|    118|      }

_ZNK5Botan9Exception4whatEv:
   94|    104|      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.25k|inline constexpr ToT typecast_copy(const FromR& src) {
  211|  7.25k|   ToT dst;  // NOLINT(*-member-init)
  212|  7.25k|   typecast_copy(dst, src);
  213|  7.25k|   return dst;
  214|  7.25k|}
_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.25k|inline constexpr void typecast_copy(ToT& out, const FromR& in) {
  189|  7.25k|   typecast_copy(std::span<ToT, 1>(&out, 1), in);
  190|  7.25k|}
_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.25k|inline constexpr void typecast_copy(ToR&& out /* NOLINT(*-std-forward) */, const FromR& in) {
  177|  7.25k|   ranges::assert_equal_byte_lengths(out, in);
  178|  7.25k|   std::memcpy(std::ranges::data(out), std::ranges::data(in), ranges::size_bytes(out));
  179|  7.25k|}
_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|}
_ZN5Botan13typecast_copyITkNS_6ranges23contiguous_output_rangeERNSt3__15arrayIhLm8EEETkNS1_16contiguous_rangeENS3_ImLm1EEEQaasr3stdE23is_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|    354|inline constexpr void typecast_copy(ToR&& out /* NOLINT(*-std-forward) */, const FromR& in) {
  177|    354|   ranges::assert_equal_byte_lengths(out, in);
  178|    354|   std::memcpy(std::ranges::data(out), std::ranges::data(in), ranges::size_bytes(out));
  179|    354|}
_ZN5Botan19secure_scrub_memoryITkNS_6ranges23contiguous_output_rangeERNSt3__16vectorIhNS2_9allocatorIhEEEEEEvOT_:
   59|  30.4k|void secure_scrub_memory(ranges::contiguous_output_range auto&& data) {
   60|  30.4k|   secure_scrub_memory(std::ranges::data(data), ranges::size_bytes(data));
   61|  30.4k|}
_ZN5Botan8copy_memIhQsr3stdE12is_trivial_vIu7__decayIT_EEEEvPS1_PKS1_m:
  144|  55.2k|inline constexpr void copy_mem(T* out, const T* in, size_t n) {
  145|  55.2k|   BOTAN_ASSERT_IMPLICATION(n > 0, in != nullptr && out != nullptr, "If n > 0 then args are not null");
  ------------------
  |  |  103|  55.2k|   do {                                                                                          \
  |  |  104|  55.2k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                                              \
  |  |  105|   104k|      if((expr1) && !(expr2)) {                                                                  \
  |  |  ------------------
  |  |  |  Branch (105:10): [True: 52.2k, False: 2.93k]
  |  |  |  Branch (105:23): [True: 52.2k, False: 0]
  |  |  |  Branch (105:23): [True: 52.2k, 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.2k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (109:12): [Folded, False: 55.2k]
  |  |  ------------------
  ------------------
  146|       |
  147|  55.2k|   if(in != nullptr && out != nullptr && n > 0) {
  ------------------
  |  Branch (147:7): [True: 55.1k, False: 52]
  |  Branch (147:24): [True: 54.7k, False: 426]
  |  Branch (147:42): [True: 52.2k, False: 2.45k]
  ------------------
  148|  52.2k|      std::memmove(out, in, sizeof(T) * n);
  149|  52.2k|   }
  150|  55.2k|}
_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|     86|inline constexpr void typecast_copy(ToR&& out /* NOLINT(*-std-forward) */, const FromR& in) {
  177|     86|   ranges::assert_equal_byte_lengths(out, in);
  178|     86|   std::memcpy(std::ranges::data(out), std::ranges::data(in), ranges::size_bytes(out));
  179|     86|}
_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|     86|inline constexpr void typecast_copy(ToT& out, const FromR& in) {
  189|     86|   typecast_copy(std::span<ToT, 1>(&out, 1), in);
  190|     86|}
_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|     86|inline constexpr ToT typecast_copy(const FromR& src) {
  211|     86|   ToT dst;  // NOLINT(*-member-init)
  212|     86|   typecast_copy(dst, src);
  213|     86|   return dst;
  214|     86|}
_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|     87|inline constexpr ToT typecast_copy(const FromR& src) {
  211|     87|   ToT dst;  // NOLINT(*-member-init)
  212|     87|   typecast_copy(dst, src);
  213|     87|   return dst;
  214|     87|}
_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|     87|inline constexpr void typecast_copy(ToT& out, const FromR& in) {
  189|     87|   typecast_copy(std::span<ToT, 1>(&out, 1), in);
  190|     87|}
_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|     87|inline constexpr void typecast_copy(ToR&& out /* NOLINT(*-std-forward) */, const FromR& in) {
  177|     87|   ranges::assert_equal_byte_lengths(out, in);
  178|     87|   std::memcpy(std::ranges::data(out), std::ranges::data(in), ranges::size_bytes(out));
  179|     87|}

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

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

_ZNK5Botan7X509_DN5emptyEv:
   91|      5|      bool empty() const { return m_rdn.empty(); }
_ZN5Botan10ExtensionsC2Ev:
  871|    542|      Extensions() = default;
_ZN5Botan10ExtensionsD2Ev:
  879|    542|      ~Extensions() override = default;
_ZN5Botan7X509_DNC2Ev:
   48|  2.64k|      X509_DN() = default;
_ZN5Botan15NameConstraintsC2Ev:
  618|      1|      NameConstraints() = default;
_ZN5Botan15AlternativeNameC2Ev:
  211|      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.5k|inline constexpr void assert_exact_byte_length(const R& r) {
   78|  14.5k|   const std::span s{r};
   79|  14.5k|   if constexpr(statically_spanable_range<R>) {
   80|  14.5k|      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.5k|}
_ZN5Botan6ranges25assert_equal_byte_lengthsITkNS0_14spanable_rangeENSt3__14spanImLm1EEETpTkNS0_14spanable_rangeEJNS3_IKhLm8EEEEEEvRKT_DpRKT0_QgtsZT0_Li0E:
  100|  7.25k|{
  101|  7.25k|   const std::span s0{r0};
  102|       |
  103|  7.25k|   if constexpr(statically_spanable_range<R0>) {
  104|  7.25k|      constexpr size_t expected_size = s0.size_bytes();
  105|  7.25k|      (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.25k|}
_ZN5Botan6ranges10size_bytesITkNS0_14spanable_rangeENSt3__14spanImLm1EEEEEmRKT_:
   59|  8.48k|inline constexpr size_t size_bytes(const spanable_range auto& r) {
   60|  8.48k|   return std::span{r}.size_bytes();
   61|  8.48k|}
_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.46k|inline constexpr size_t size_bytes(const spanable_range auto& r) {
   60|  2.46k|   return std::span{r}.size_bytes();
   61|  2.46k|}
_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|}
_ZN5Botan6ranges25assert_equal_byte_lengthsITkNS0_14spanable_rangeENSt3__15arrayIhLm8EEETpTkNS0_14spanable_rangeEJNS3_ImLm1EEEEEEvRKT_DpRKT0_QgtsZT0_Li0E:
  100|    708|{
  101|    708|   const std::span s0{r0};
  102|       |
  103|    708|   if constexpr(statically_spanable_range<R0>) {
  104|    708|      constexpr size_t expected_size = s0.size_bytes();
  105|    708|      (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|    708|}
_ZN5Botan6ranges24assert_exact_byte_lengthILm8ETkNS0_14spanable_rangeENSt3__15arrayImLm1EEEEEvRKT0_:
   77|    708|inline constexpr void assert_exact_byte_length(const R& r) {
   78|    708|   const std::span s{r};
   79|    708|   if constexpr(statically_spanable_range<R>) {
   80|    708|      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|    708|}
_ZN5Botan6ranges10size_bytesITkNS0_14spanable_rangeENSt3__15arrayIhLm8EEEEEmRKT_:
   59|    354|inline constexpr size_t size_bytes(const spanable_range auto& r) {
   60|    354|   return std::span{r}.size_bytes();
   61|    354|}
_ZN5Botan6ranges10size_bytesITkNS0_14spanable_rangeENSt3__16vectorIhNS2_9allocatorIhEEEEEEmRKT_:
   59|  30.4k|inline constexpr size_t size_bytes(const spanable_range auto& r) {
   60|  30.4k|   return std::span{r}.size_bytes();
   61|  30.4k|}
_ZN5Botan6ranges24assert_exact_byte_lengthILm4ETkNS0_14spanable_rangeENSt3__14spanIKhLm4EEEEEvRKT0_:
   77|    172|inline constexpr void assert_exact_byte_length(const R& r) {
   78|    172|   const std::span s{r};
   79|    172|   if constexpr(statically_spanable_range<R>) {
   80|    172|      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|    172|}
_ZN5Botan6ranges25assert_equal_byte_lengthsITkNS0_14spanable_rangeENSt3__14spanIjLm1EEETpTkNS0_14spanable_rangeEJNS3_IKhLm4EEEEEEvRKT_DpRKT0_QgtsZT0_Li0E:
  100|     86|{
  101|     86|   const std::span s0{r0};
  102|       |
  103|     86|   if constexpr(statically_spanable_range<R0>) {
  104|     86|      constexpr size_t expected_size = s0.size_bytes();
  105|     86|      (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|     86|}
_ZN5Botan6ranges10size_bytesITkNS0_14spanable_rangeENSt3__14spanIjLm1EEEEEmRKT_:
   59|     86|inline constexpr size_t size_bytes(const spanable_range auto& r) {
   60|     86|   return std::span{r}.size_bytes();
   61|     86|}
_ZN5Botan6ranges24assert_exact_byte_lengthILm2ETkNS0_14spanable_rangeENSt3__14spanIKhLm2EEEEEvRKT0_:
   77|    174|inline constexpr void assert_exact_byte_length(const R& r) {
   78|    174|   const std::span s{r};
   79|    174|   if constexpr(statically_spanable_range<R>) {
   80|    174|      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|    174|}
_ZN5Botan6ranges25assert_equal_byte_lengthsITkNS0_14spanable_rangeENSt3__14spanItLm1EEETpTkNS0_14spanable_rangeEJNS3_IKhLm2EEEEEEvRKT_DpRKT0_QgtsZT0_Li0E:
  100|     87|{
  101|     87|   const std::span s0{r0};
  102|       |
  103|     87|   if constexpr(statically_spanable_range<R0>) {
  104|     87|      constexpr size_t expected_size = s0.size_bytes();
  105|     87|      (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|     87|}
_ZN5Botan6ranges10size_bytesITkNS0_14spanable_rangeENSt3__14spanItLm1EEEEEmRKT_:
   59|     87|inline constexpr size_t size_bytes(const spanable_range auto& r) {
   60|     87|   return std::span{r}.size_bytes();
   61|     87|}

_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.48k|[[nodiscard]] constexpr decltype(auto) wrap_strong_type(ParamT&& t) {
  269|  8.48k|   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.48k|      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.48k|}
_ZN5Botan16wrap_strong_typeIjRjQoosr3stdE18constructible_fromIT_T0_Eaasr8conceptsE11strong_typeIS2_Esr3stdE18constructible_fromINS2_12wrapped_typeES3_EEEDcOS3_:
  268|     86|[[nodiscard]] constexpr decltype(auto) wrap_strong_type(ParamT&& t) {
  269|     86|   if constexpr(std::same_as<std::remove_cvref_t<ParamT>, T>) {
  270|       |      // Noop, if the parameter type already is the desired return type.
  271|     86|      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|     86|}
_ZN5Botan16wrap_strong_typeItRtQoosr3stdE18constructible_fromIT_T0_Eaasr8conceptsE11strong_typeIS2_Esr3stdE18constructible_fromINS2_12wrapped_typeES3_EEEDcOS3_:
  268|     87|[[nodiscard]] constexpr decltype(auto) wrap_strong_type(ParamT&& t) {
  269|     87|   if constexpr(std::same_as<std::remove_cvref_t<ParamT>, T>) {
  270|       |      // Noop, if the parameter type already is the desired return type.
  271|     87|      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|     87|}

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

_ZN5Botan16X509_CertificateC2Ev:
  539|      6|      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|    623|void AlgorithmIdentifier::decode_from(BER_Decoder& codec) {
   83|    623|   codec.start_sequence().decode(m_oid).raw_bytes(m_parameters).end_cons();
   84|    623|}

_ZNK5Botan11ASN1_Object10BER_encodeEv:
   20|    118|std::vector<uint8_t> ASN1_Object::BER_encode() const {
   21|    118|   std::vector<uint8_t> output;
   22|    118|   DER_Encoder der(output);
   23|    118|   this->encode_into(der);
   24|    118|   return output;
   25|    118|}
_ZN5Botan10BER_ObjectD2Ev:
   27|  30.4k|BER_Object::~BER_Object() {
   28|  30.4k|   secure_scrub_memory(m_value);
   29|  30.4k|}
_ZNK5Botan10BER_Object11assert_is_aENS_9ASN1_TypeENS_10ASN1_ClassENSt3__117basic_string_viewIcNS3_11char_traitsIcEEEE:
   34|  8.83k|void BER_Object::assert_is_a(ASN1_Type expected_type_tag, ASN1_Class expected_class_tag, std::string_view descr) const {
   35|  8.83k|   if(!this->is_a(expected_type_tag, expected_class_tag)) {
  ------------------
  |  Branch (35:7): [True: 220, False: 8.61k]
  ------------------
   36|    220|      std::stringstream msg;
   37|       |
   38|    220|      msg << "Tag mismatch when decoding " << descr << " got ";
   39|       |
   40|    220|      if(m_class_tag == ASN1_Class::NoObject && m_type_tag == ASN1_Type::NoObject) {
  ------------------
  |  Branch (40:10): [True: 18, False: 202]
  |  Branch (40:49): [True: 18, False: 0]
  ------------------
   41|     18|         msg << "EOF";
   42|    202|      } else {
   43|    202|         if(m_class_tag == ASN1_Class::Universal || m_class_tag == ASN1_Class::Constructed) {
  ------------------
  |  Branch (43:13): [True: 45, False: 157]
  |  Branch (43:53): [True: 112, False: 45]
  ------------------
   44|    157|            msg << asn1_tag_to_string(m_type_tag);
   45|    157|         } else {
   46|     45|            msg << std::to_string(static_cast<uint32_t>(m_type_tag));
   47|     45|         }
   48|       |
   49|    202|         msg << "/" << asn1_class_to_string(m_class_tag);
   50|    202|      }
   51|       |
   52|    220|      msg << " expected ";
   53|       |
   54|    220|      if(expected_class_tag == ASN1_Class::Universal || expected_class_tag == ASN1_Class::Constructed) {
  ------------------
  |  Branch (54:10): [True: 22, False: 198]
  |  Branch (54:57): [True: 194, False: 4]
  ------------------
   55|    216|         msg << asn1_tag_to_string(expected_type_tag);
   56|    216|      } else {
   57|      4|         msg << std::to_string(static_cast<uint32_t>(expected_type_tag));
   58|      4|      }
   59|       |
   60|    220|      msg << "/" << asn1_class_to_string(expected_class_tag);
   61|       |
   62|    220|      throw BER_Decoding_Error(msg.str());
   63|    220|   }
   64|  8.83k|}
_ZNK5Botan10BER_Object4is_aENS_9ASN1_TypeENS_10ASN1_ClassE:
   66|  10.8k|bool BER_Object::is_a(ASN1_Type expected_type_tag, ASN1_Class expected_class_tag) const {
   67|  10.8k|   return (m_type_tag == expected_type_tag && m_class_tag == expected_class_tag);
  ------------------
  |  Branch (67:12): [True: 9.00k, False: 1.81k]
  |  Branch (67:47): [True: 8.98k, False: 22]
  ------------------
   68|  10.8k|}
_ZNK5Botan10BER_Object4is_aEiNS_10ASN1_ClassE:
   70|      5|bool BER_Object::is_a(int expected_type_tag, ASN1_Class expected_class_tag) const {
   71|      5|   return is_a(ASN1_Type(expected_type_tag), expected_class_tag);
   72|      5|}
_ZN5Botan10BER_Object11set_taggingENS_9ASN1_TypeENS_10ASN1_ClassE:
   74|  12.7k|void BER_Object::set_tagging(ASN1_Type type_tag, ASN1_Class class_tag) {
   75|  12.7k|   m_type_tag = type_tag;
   76|  12.7k|   m_class_tag = class_tag;
   77|  12.7k|}
_ZN5Botan20asn1_class_to_stringENS_10ASN1_ClassE:
   79|    422|std::string asn1_class_to_string(ASN1_Class type) {
   80|    422|   switch(type) {
   81|     67|      case ASN1_Class::Universal:
  ------------------
  |  Branch (81:7): [True: 67, False: 355]
  ------------------
   82|     67|         return "UNIVERSAL";
   83|    306|      case ASN1_Class::Constructed:
  ------------------
  |  Branch (83:7): [True: 306, False: 116]
  ------------------
   84|    306|         return "CONSTRUCTED";
   85|      5|      case ASN1_Class::ContextSpecific:
  ------------------
  |  Branch (85:7): [True: 5, False: 417]
  ------------------
   86|      5|         return "CONTEXT_SPECIFIC";
   87|      8|      case ASN1_Class::Application:
  ------------------
  |  Branch (87:7): [True: 8, False: 414]
  ------------------
   88|      8|         return "APPLICATION";
   89|      8|      case ASN1_Class::Private:
  ------------------
  |  Branch (89:7): [True: 8, False: 414]
  ------------------
   90|      8|         return "PRIVATE";
   91|      0|      case ASN1_Class::NoObject:
  ------------------
  |  Branch (91:7): [True: 0, False: 422]
  ------------------
   92|      0|         return "NO_OBJECT";
   93|     28|      default:
  ------------------
  |  Branch (93:7): [True: 28, False: 394]
  ------------------
   94|     28|         return "CLASS(" + std::to_string(static_cast<size_t>(type)) + ")";
   95|    422|   }
   96|    422|}
_ZN5Botan18asn1_tag_to_stringENS_9ASN1_TypeE:
   98|    430|std::string asn1_tag_to_string(ASN1_Type type) {
   99|    430|   switch(type) {
  100|    195|      case ASN1_Type::Sequence:
  ------------------
  |  Branch (100:7): [True: 195, False: 235]
  ------------------
  101|    195|         return "SEQUENCE";
  102|       |
  103|      5|      case ASN1_Type::Set:
  ------------------
  |  Branch (103:7): [True: 5, False: 425]
  ------------------
  104|      5|         return "SET";
  105|       |
  106|      6|      case ASN1_Type::PrintableString:
  ------------------
  |  Branch (106:7): [True: 6, False: 424]
  ------------------
  107|      6|         return "PRINTABLE STRING";
  108|       |
  109|      3|      case ASN1_Type::NumericString:
  ------------------
  |  Branch (109:7): [True: 3, False: 427]
  ------------------
  110|      3|         return "NUMERIC STRING";
  111|       |
  112|      2|      case ASN1_Type::Ia5String:
  ------------------
  |  Branch (112:7): [True: 2, False: 428]
  ------------------
  113|      2|         return "IA5 STRING";
  114|       |
  115|      6|      case ASN1_Type::TeletexString:
  ------------------
  |  Branch (115:7): [True: 6, False: 424]
  ------------------
  116|      6|         return "T61 STRING";
  117|       |
  118|     53|      case ASN1_Type::Utf8String:
  ------------------
  |  Branch (118:7): [True: 53, False: 377]
  ------------------
  119|     53|         return "UTF8 STRING";
  120|       |
  121|      3|      case ASN1_Type::VisibleString:
  ------------------
  |  Branch (121:7): [True: 3, False: 427]
  ------------------
  122|      3|         return "VISIBLE STRING";
  123|       |
  124|      1|      case ASN1_Type::BmpString:
  ------------------
  |  Branch (124:7): [True: 1, False: 429]
  ------------------
  125|      1|         return "BMP STRING";
  126|       |
  127|      1|      case ASN1_Type::UniversalString:
  ------------------
  |  Branch (127:7): [True: 1, False: 429]
  ------------------
  128|      1|         return "UNIVERSAL STRING";
  129|       |
  130|      1|      case ASN1_Type::UtcTime:
  ------------------
  |  Branch (130:7): [True: 1, False: 429]
  ------------------
  131|      1|         return "UTC TIME";
  132|       |
  133|      2|      case ASN1_Type::GeneralizedTime:
  ------------------
  |  Branch (133:7): [True: 2, False: 428]
  ------------------
  134|      2|         return "GENERALIZED TIME";
  135|       |
  136|      8|      case ASN1_Type::OctetString:
  ------------------
  |  Branch (136:7): [True: 8, False: 422]
  ------------------
  137|      8|         return "OCTET STRING";
  138|       |
  139|      5|      case ASN1_Type::BitString:
  ------------------
  |  Branch (139:7): [True: 5, False: 425]
  ------------------
  140|      5|         return "BIT STRING";
  141|       |
  142|     14|      case ASN1_Type::Enumerated:
  ------------------
  |  Branch (142:7): [True: 14, False: 416]
  ------------------
  143|     14|         return "ENUMERATED";
  144|       |
  145|      5|      case ASN1_Type::Integer:
  ------------------
  |  Branch (145:7): [True: 5, False: 425]
  ------------------
  146|      5|         return "INTEGER";
  147|       |
  148|      1|      case ASN1_Type::Null:
  ------------------
  |  Branch (148:7): [True: 1, False: 429]
  ------------------
  149|      1|         return "NULL";
  150|       |
  151|      2|      case ASN1_Type::ObjectId:
  ------------------
  |  Branch (151:7): [True: 2, False: 428]
  ------------------
  152|      2|         return "OBJECT";
  153|       |
  154|      5|      case ASN1_Type::Boolean:
  ------------------
  |  Branch (154:7): [True: 5, False: 425]
  ------------------
  155|      5|         return "BOOLEAN";
  156|       |
  157|      0|      case ASN1_Type::NoObject:
  ------------------
  |  Branch (157:7): [True: 0, False: 430]
  ------------------
  158|      0|         return "NO_OBJECT";
  159|       |
  160|    112|      default:
  ------------------
  |  Branch (160:7): [True: 112, False: 318]
  ------------------
  161|    112|         return "TAG(" + std::to_string(static_cast<uint32_t>(type)) + ")";
  162|    430|   }
  163|    430|}
_ZN5Botan18BER_Decoding_ErrorC2ENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
  168|    865|BER_Decoding_Error::BER_Decoding_Error(std::string_view err) : Decoding_Error(fmt("BER: {}", err)) {}
_ZN5Botan11BER_Bad_TagC2ENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEj:
  170|     36|BER_Bad_Tag::BER_Bad_Tag(std::string_view str, uint32_t tagging) : BER_Decoding_Error(fmt("{}: {}", str, tagging)) {}
_ZN5Botan4ASN19to_stringERKNS_10BER_ObjectE:
  190|    242|std::string to_string(const BER_Object& obj) {
  191|    242|   return bytes_to_string(obj.data());
  192|    242|}

_ZN5Botan3OIDC2ESt16initializer_listIjE:
   98|    934|OID::OID(std::initializer_list<uint32_t> init) : m_id(init) {
   99|    934|   oid_valid_check(m_id);
  100|    934|}
_ZNK5Botan3OID11encode_intoERNS_11DER_EncoderE:
  181|    118|void OID::encode_into(DER_Encoder& der) const {
  182|    118|   if(m_id.size() < 2) {
  ------------------
  |  Branch (182:7): [True: 0, False: 118]
  ------------------
  183|      0|      throw Invalid_Argument("OID::encode_into: OID is invalid");
  184|      0|   }
  185|       |
  186|    118|   auto append = [](std::vector<uint8_t>& encoding, uint32_t z) {
  187|    118|      if(z <= 0x7F) {
  188|    118|         encoding.push_back(static_cast<uint8_t>(z));
  189|    118|      } else {
  190|    118|         const size_t z7 = (high_bit(z) + 7 - 1) / 7;
  191|       |
  192|    118|         for(size_t j = 0; j != z7; ++j) {
  193|    118|            uint8_t zp = static_cast<uint8_t>(z >> (7 * (z7 - j - 1)) & 0x7F);
  194|       |
  195|    118|            if(j != z7 - 1) {
  196|    118|               zp |= 0x80;
  197|    118|            }
  198|       |
  199|    118|            encoding.push_back(zp);
  200|    118|         }
  201|    118|      }
  202|    118|   };
  203|       |
  204|    118|   std::vector<uint8_t> encoding;
  205|       |
  206|       |   // We know 40 * root can't overflow because root is between 0 and 2
  207|    118|   auto first = checked_add(40 * m_id[0], m_id[1]);
  208|    118|   BOTAN_ASSERT_NOMSG(first.has_value());
  ------------------
  |  |   77|    118|   do {                                                                     \
  |  |   78|    118|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   79|    118|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (79:10): [True: 0, False: 118]
  |  |  ------------------
  |  |   80|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   81|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   82|      0|      }                                                                     \
  |  |   83|    118|   } while(0)
  |  |  ------------------
  |  |  |  Branch (83:12): [Folded, False: 118]
  |  |  ------------------
  ------------------
  209|       |
  210|    118|   append(encoding, *first);
  211|       |
  212|    124|   for(size_t i = 2; i != m_id.size(); ++i) {
  ------------------
  |  Branch (212:22): [True: 6, False: 118]
  ------------------
  213|      6|      append(encoding, m_id[i]);
  214|      6|   }
  215|    118|   der.add_object(ASN1_Type::ObjectId, ASN1_Class::Universal, encoding);
  216|    118|}
_ZN5Botan3OID11decode_fromERNS_11BER_DecoderE:
  221|  1.88k|void OID::decode_from(BER_Decoder& decoder) {
  222|  1.88k|   const BER_Object obj = decoder.get_next_object();
  223|  1.88k|   if(obj.tagging() != (ASN1_Class::Universal | ASN1_Type::ObjectId)) {
  ------------------
  |  Branch (223:7): [True: 36, False: 1.84k]
  ------------------
  224|     36|      throw BER_Bad_Tag("Error decoding OID, unknown tag", obj.tagging());
  225|     36|   }
  226|       |
  227|  1.84k|   if(obj.length() == 0) {
  ------------------
  |  Branch (227:7): [True: 1, False: 1.84k]
  ------------------
  228|      1|      throw BER_Decoding_Error("OID encoding is too short");
  229|      1|   }
  230|       |
  231|  1.84k|   auto consume = [](BufferSlicer& data) -> uint32_t {
  232|  1.84k|      BOTAN_ASSERT_NOMSG(!data.empty());
  233|  1.84k|      uint32_t b = data.take_byte();
  234|       |
  235|  1.84k|      if(b > 0x7F) {
  236|  1.84k|         b &= 0x7F;
  237|       |
  238|       |         // Even BER requires that the OID have minimal length, ie that
  239|       |         // the first byte of a multibyte encoding cannot be zero
  240|       |         // See X.690 section 8.19.2
  241|  1.84k|         if(b == 0) {
  242|  1.84k|            throw Decoding_Error("Leading zero byte in multibyte OID encoding");
  243|  1.84k|         }
  244|       |
  245|  1.84k|         while(true) {
  246|  1.84k|            if(data.empty()) {
  247|  1.84k|               throw Decoding_Error("Truncated OID value");
  248|  1.84k|            }
  249|       |
  250|  1.84k|            const uint8_t next = data.take_byte();
  251|  1.84k|            const bool more = (next & 0x80) == 0x80;
  252|  1.84k|            const uint8_t value = next & 0x7F;
  253|       |
  254|  1.84k|            if((b >> (32 - 7)) != 0) {
  255|  1.84k|               throw Decoding_Error("OID component overflow");
  256|  1.84k|            }
  257|       |
  258|  1.84k|            b = (b << 7) | value;
  259|       |
  260|  1.84k|            if(!more) {
  261|  1.84k|               break;
  262|  1.84k|            }
  263|  1.84k|         }
  264|  1.84k|      }
  265|       |
  266|  1.84k|      return b;
  267|  1.84k|   };
  268|       |
  269|  1.84k|   BufferSlicer data(obj.data());
  270|  1.84k|   std::vector<uint32_t> parts;
  271|  11.2k|   while(!data.empty()) {
  ------------------
  |  Branch (271:10): [True: 9.42k, False: 1.84k]
  ------------------
  272|  9.42k|      const uint32_t comp = consume(data);
  273|       |
  274|  9.42k|      if(parts.empty()) {
  ------------------
  |  Branch (274:10): [True: 1.82k, False: 7.59k]
  ------------------
  275|       |         // divide into root and second arc
  276|       |
  277|  1.82k|         const uint32_t root_arc = [](uint32_t b0) -> uint32_t {
  278|  1.82k|            if(b0 < 40) {
  279|  1.82k|               return 0;
  280|  1.82k|            } else if(b0 < 80) {
  281|  1.82k|               return 1;
  282|  1.82k|            } else {
  283|  1.82k|               return 2;
  284|  1.82k|            }
  285|  1.82k|         }(comp);
  286|       |
  287|  1.82k|         parts.push_back(root_arc);
  288|  1.82k|         BOTAN_ASSERT_NOMSG(comp >= 40 * root_arc);
  ------------------
  |  |   77|  1.82k|   do {                                                                     \
  |  |   78|  1.82k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   79|  1.82k|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (79:10): [True: 0, False: 1.82k]
  |  |  ------------------
  |  |   80|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   81|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   82|      0|      }                                                                     \
  |  |   83|  1.82k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (83:12): [Folded, False: 1.82k]
  |  |  ------------------
  ------------------
  289|  1.82k|         parts.push_back(comp - 40 * root_arc);
  290|  7.59k|      } else {
  291|  7.59k|         parts.push_back(comp);
  292|  7.59k|      }
  293|  9.42k|   }
  294|       |
  295|  1.84k|   m_id = parts;
  296|  1.84k|}
asn1_oid.cpp:_ZN5Botan12_GLOBAL__N_115oid_valid_checkENSt3__14spanIKjLm18446744073709551615EEE:
   26|    934|void oid_valid_check(std::span<const uint32_t> oid) {
   27|    934|   BOTAN_ARG_CHECK(oid.size() >= 2, "OID too short to be valid");
  ------------------
  |  |   35|    934|   do {                                                          \
  |  |   36|    934|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */              \
  |  |   37|    934|      if(!(expr)) {                                              \
  |  |  ------------------
  |  |  |  Branch (37:10): [True: 0, False: 934]
  |  |  ------------------
  |  |   38|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */     \
  |  |   39|      0|         Botan::throw_invalid_argument(msg, __func__, __FILE__); \
  |  |   40|      0|      }                                                          \
  |  |   41|    934|   } while(0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 934]
  |  |  ------------------
  ------------------
   28|    934|   BOTAN_ARG_CHECK(oid[0] <= 2, "OID root out of range");
  ------------------
  |  |   35|    934|   do {                                                          \
  |  |   36|    934|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */              \
  |  |   37|    934|      if(!(expr)) {                                              \
  |  |  ------------------
  |  |  |  Branch (37:10): [True: 0, False: 934]
  |  |  ------------------
  |  |   38|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */     \
  |  |   39|      0|         Botan::throw_invalid_argument(msg, __func__, __FILE__); \
  |  |   40|      0|      }                                                          \
  |  |   41|    934|   } while(0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 934]
  |  |  ------------------
  ------------------
   29|    934|   BOTAN_ARG_CHECK(oid[1] <= 39 || oid[0] == 2, "OID second arc too large");
  ------------------
  |  |   35|    934|   do {                                                          \
  |  |   36|    934|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */              \
  |  |   37|    934|      if(!(expr)) {                                              \
  |  |  ------------------
  |  |  |  Branch (37:12): [True: 934, 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|    934|   } while(0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 934]
  |  |  ------------------
  ------------------
   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|    934|   BOTAN_ARG_CHECK(oid[1] <= 0xFFFFFFAF, "OID second arc too large");
  ------------------
  |  |   35|    934|   do {                                                          \
  |  |   36|    934|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */              \
  |  |   37|    934|      if(!(expr)) {                                              \
  |  |  ------------------
  |  |  |  Branch (37:10): [True: 0, False: 934]
  |  |  ------------------
  |  |   38|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */     \
  |  |   39|      0|         Botan::throw_invalid_argument(msg, __func__, __FILE__); \
  |  |   40|      0|      }                                                          \
  |  |   41|    934|   } while(0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 934]
  |  |  ------------------
  ------------------
   33|    934|}
asn1_oid.cpp:_ZZNK5Botan3OID11encode_intoERNS_11DER_EncoderEENK3$_0clERNSt3__16vectorIhNS4_9allocatorIhEEEEj:
  186|    124|   auto append = [](std::vector<uint8_t>& encoding, uint32_t z) {
  187|    124|      if(z <= 0x7F) {
  ------------------
  |  Branch (187:10): [True: 123, False: 1]
  ------------------
  188|    123|         encoding.push_back(static_cast<uint8_t>(z));
  189|    123|      } else {
  190|      1|         const size_t z7 = (high_bit(z) + 7 - 1) / 7;
  191|       |
  192|      3|         for(size_t j = 0; j != z7; ++j) {
  ------------------
  |  Branch (192:28): [True: 2, False: 1]
  ------------------
  193|      2|            uint8_t zp = static_cast<uint8_t>(z >> (7 * (z7 - j - 1)) & 0x7F);
  194|       |
  195|      2|            if(j != z7 - 1) {
  ------------------
  |  Branch (195:16): [True: 1, False: 1]
  ------------------
  196|      1|               zp |= 0x80;
  197|      1|            }
  198|       |
  199|      2|            encoding.push_back(zp);
  200|      2|         }
  201|      1|      }
  202|    124|   };
asn1_oid.cpp:_ZZN5Botan3OID11decode_fromERNS_11BER_DecoderEENK3$_0clERNS_12BufferSlicerE:
  231|  9.42k|   auto consume = [](BufferSlicer& data) -> uint32_t {
  232|  9.42k|      BOTAN_ASSERT_NOMSG(!data.empty());
  ------------------
  |  |   77|  9.42k|   do {                                                                     \
  |  |   78|  9.42k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   79|  9.42k|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (79:10): [True: 0, False: 9.42k]
  |  |  ------------------
  |  |   80|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   81|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   82|      0|      }                                                                     \
  |  |   83|  9.42k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (83:12): [Folded, False: 9.42k]
  |  |  ------------------
  ------------------
  233|  9.42k|      uint32_t b = data.take_byte();
  234|       |
  235|  9.42k|      if(b > 0x7F) {
  ------------------
  |  Branch (235:10): [True: 683, False: 8.74k]
  ------------------
  236|    683|         b &= 0x7F;
  237|       |
  238|       |         // Even BER requires that the OID have minimal length, ie that
  239|       |         // the first byte of a multibyte encoding cannot be zero
  240|       |         // See X.690 section 8.19.2
  241|    683|         if(b == 0) {
  ------------------
  |  Branch (241:13): [True: 2, False: 681]
  ------------------
  242|      2|            throw Decoding_Error("Leading zero byte in multibyte OID encoding");
  243|      2|         }
  244|       |
  245|  1.33k|         while(true) {
  ------------------
  |  Branch (245:16): [True: 1.33k, Folded]
  ------------------
  246|  1.33k|            if(data.empty()) {
  ------------------
  |  Branch (246:16): [True: 15, False: 1.32k]
  ------------------
  247|     15|               throw Decoding_Error("Truncated OID value");
  248|     15|            }
  249|       |
  250|  1.32k|            const uint8_t next = data.take_byte();
  251|  1.32k|            const bool more = (next & 0x80) == 0x80;
  252|  1.32k|            const uint8_t value = next & 0x7F;
  253|       |
  254|  1.32k|            if((b >> (32 - 7)) != 0) {
  ------------------
  |  Branch (254:16): [True: 15, False: 1.30k]
  ------------------
  255|     15|               throw Decoding_Error("OID component overflow");
  256|     15|            }
  257|       |
  258|  1.30k|            b = (b << 7) | value;
  259|       |
  260|  1.30k|            if(!more) {
  ------------------
  |  Branch (260:16): [True: 651, False: 657]
  ------------------
  261|    651|               break;
  262|    651|            }
  263|  1.30k|         }
  264|    681|      }
  265|       |
  266|  9.39k|      return b;
  267|  9.42k|   };
asn1_oid.cpp:_ZZN5Botan3OID11decode_fromERNS_11BER_DecoderEENK3$_1clEj:
  277|  1.82k|         const uint32_t root_arc = [](uint32_t b0) -> uint32_t {
  278|  1.82k|            if(b0 < 40) {
  ------------------
  |  Branch (278:16): [True: 364, False: 1.46k]
  ------------------
  279|    364|               return 0;
  280|  1.46k|            } else if(b0 < 80) {
  ------------------
  |  Branch (280:23): [True: 1.01k, False: 448]
  ------------------
  281|  1.01k|               return 1;
  282|  1.01k|            } else {
  283|    448|               return 2;
  284|    448|            }
  285|  1.82k|         }(comp);

_ZN5Botan11ASN1_StringC2ENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEENS_9ASN1_TypeE:
  135|    339|ASN1_String::ASN1_String(std::string_view str, ASN1_Type t) : m_utf8_str(str), m_tag(t) {
  136|    339|   if(!is_utf8_subset_string_type(m_tag)) {
  ------------------
  |  Branch (136:7): [True: 0, False: 339]
  ------------------
  137|      0|      throw Invalid_Argument("ASN1_String only supports encoding to UTF-8 or a UTF-8 subset");
  138|      0|   }
  139|       |
  140|    339|   if(!is_valid_asn1_string_content(m_utf8_str, m_tag)) {
  ------------------
  |  Branch (140:7): [True: 0, False: 339]
  ------------------
  141|      0|      throw Invalid_Argument(fmt("ASN1_String: Invalid {} encoding", asn1_tag_to_string(m_tag)));
  142|      0|   }
  143|    339|}
_ZN5Botan11ASN1_StringC2ENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
  145|    339|ASN1_String::ASN1_String(std::string_view str) : ASN1_String(str, choose_encoding(str)) {}
_ZN5Botan11ASN1_String11decode_fromERNS_11BER_DecoderE:
  162|    333|void ASN1_String::decode_from(BER_Decoder& source) {
  163|    333|   const BER_Object obj = source.get_next_object();
  164|       |
  165|    333|   if(obj.get_class() != ASN1_Class::Universal || !is_asn1_string_type(obj.type())) {
  ------------------
  |  Branch (165:7): [True: 1, False: 332]
  |  Branch (165:51): [True: 67, False: 265]
  ------------------
  166|     68|      auto typ = static_cast<uint32_t>(obj.type());
  167|     68|      auto cls = static_cast<uint32_t>(obj.get_class());
  168|     68|      throw Decoding_Error(fmt("ASN1_String: Unknown string type {}/{}", typ, cls));
  169|     68|   }
  170|       |
  171|    265|   m_tag = obj.type();
  172|    265|   m_data.assign(obj.bits(), obj.bits() + obj.length());
  173|       |
  174|    265|   if(m_tag == ASN1_Type::BmpString) {
  ------------------
  |  Branch (174:7): [True: 48, False: 217]
  ------------------
  175|     48|      m_utf8_str = ucs2_to_utf8(m_data);
  176|    217|   } else if(m_tag == ASN1_Type::UniversalString) {
  ------------------
  |  Branch (176:14): [True: 88, False: 129]
  ------------------
  177|     88|      m_utf8_str = ucs4_to_utf8(m_data);
  178|    129|   } else if(m_tag == ASN1_Type::TeletexString) {
  ------------------
  |  Branch (178:14): [True: 12, False: 117]
  ------------------
  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|     12|      m_utf8_str = latin1_to_utf8(m_data);
  184|    117|   } else {
  185|       |      // All other supported string types are UTF-8 or some subset thereof
  186|    117|      m_utf8_str = ASN1::to_string(obj);
  187|       |
  188|    117|      if(!is_valid_asn1_string_content(m_utf8_str, m_tag)) {
  ------------------
  |  Branch (188:10): [True: 57, False: 60]
  ------------------
  189|     57|         throw Decoding_Error(fmt("ASN1_String: Invalid {} encoding", asn1_tag_to_string(m_tag)));
  190|     57|      }
  191|    117|   }
  192|    265|}
asn1_str.cpp:_ZN5Botan12_GLOBAL__N_119is_asn1_string_typeENS_9ASN1_TypeE:
   99|    332|bool is_asn1_string_type(ASN1_Type tag) {
  100|    332|   return (is_utf8_subset_string_type(tag) || tag == ASN1_Type::TeletexString || tag == ASN1_Type::BmpString ||
  ------------------
  |  Branch (100:12): [True: 117, False: 215]
  |  Branch (100:47): [True: 12, False: 203]
  |  Branch (100:82): [True: 48, False: 155]
  ------------------
  101|    155|           tag == ASN1_Type::UniversalString);
  ------------------
  |  Branch (101:12): [True: 88, False: 67]
  ------------------
  102|    332|}
asn1_str.cpp:_ZN5Botan12_GLOBAL__N_126is_utf8_subset_string_typeENS_9ASN1_TypeE:
   94|  1.12k|bool is_utf8_subset_string_type(ASN1_Type tag) {
   95|  1.12k|   return (tag == ASN1_Type::NumericString || tag == ASN1_Type::PrintableString || tag == ASN1_Type::VisibleString ||
  ------------------
  |  Branch (95:12): [True: 4, False: 1.12k]
  |  Branch (95:47): [True: 686, False: 437]
  |  Branch (95:84): [True: 6, False: 431]
  ------------------
   96|    431|           tag == ASN1_Type::Ia5String || tag == ASN1_Type::Utf8String);
  ------------------
  |  Branch (96:12): [True: 10, False: 421]
  |  Branch (96:43): [True: 206, False: 215]
  ------------------
   97|  1.12k|}
asn1_str.cpp:_ZN5Botan12_GLOBAL__N_128is_valid_asn1_string_contentERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS_9ASN1_TypeE:
  104|    456|bool is_valid_asn1_string_content(const std::string& str, ASN1_Type tag) {
  105|    456|   BOTAN_ASSERT_NOMSG(is_utf8_subset_string_type(tag));
  ------------------
  |  |   77|    456|   do {                                                                     \
  |  |   78|    456|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   79|    456|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (79:10): [True: 0, False: 456]
  |  |  ------------------
  |  |   80|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   81|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   82|      0|      }                                                                     \
  |  |   83|    456|   } while(0)
  |  |  ------------------
  |  |  |  Branch (83:12): [Folded, False: 456]
  |  |  ------------------
  ------------------
  106|       |
  107|    456|   switch(tag) {
  108|    103|      case ASN1_Type::Utf8String:
  ------------------
  |  Branch (108:7): [True: 103, False: 353]
  ------------------
  109|    103|         return is_valid_utf8(str);
  110|      2|      case ASN1_Type::NumericString:
  ------------------
  |  Branch (110:7): [True: 2, False: 454]
  ------------------
  111|    345|      case ASN1_Type::PrintableString:
  ------------------
  |  Branch (111:7): [True: 343, False: 113]
  ------------------
  112|    350|      case ASN1_Type::Ia5String:
  ------------------
  |  Branch (112:7): [True: 5, False: 451]
  ------------------
  113|    353|      case ASN1_Type::VisibleString:
  ------------------
  |  Branch (113:7): [True: 3, False: 453]
  ------------------
  114|    353|         return g_char_validator.valid_encoding(str, tag);
  115|      0|      default:
  ------------------
  |  Branch (115:7): [True: 0, False: 456]
  ------------------
  116|      0|         return false;
  117|    456|   }
  118|    456|}
asn1_str.cpp:_ZNK5Botan12_GLOBAL__N_131ASN1_String_Codepoint_Validator14valid_encodingENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEENS_9ASN1_TypeE:
   25|    692|      constexpr bool valid_encoding(std::string_view str, ASN1_Type tag) const {
   26|    692|         const uint8_t mask = mask_for(tag);
   27|    692|         for(const char c : str) {
  ------------------
  |  Branch (27:27): [True: 20, False: 687]
  ------------------
   28|     20|            const uint8_t codepoint = static_cast<uint8_t>(c);
   29|     20|            const bool is_valid = (m_table[codepoint] & mask) != 0;
   30|       |
   31|     20|            if(!is_valid) {
  ------------------
  |  Branch (31:16): [True: 5, False: 15]
  ------------------
   32|      5|               return false;
   33|      5|            }
   34|     20|         }
   35|       |
   36|    687|         return true;
   37|    692|      }
asn1_str.cpp:_ZN5Botan12_GLOBAL__N_131ASN1_String_Codepoint_Validator8mask_forENS_9ASN1_TypeE:
   45|    692|      static constexpr uint8_t mask_for(ASN1_Type tag) {
   46|    692|         switch(tag) {
   47|      2|            case ASN1_Type::NumericString:
  ------------------
  |  Branch (47:13): [True: 2, False: 690]
  ------------------
   48|      2|               return Numeric_String;
   49|    682|            case ASN1_Type::PrintableString:
  ------------------
  |  Branch (49:13): [True: 682, False: 10]
  ------------------
   50|    682|               return Printable_String;
   51|      5|            case ASN1_Type::Ia5String:
  ------------------
  |  Branch (51:13): [True: 5, False: 687]
  ------------------
   52|      5|               return IA5_String;
   53|      3|            case ASN1_Type::VisibleString:
  ------------------
  |  Branch (53:13): [True: 3, False: 689]
  ------------------
   54|      3|               return Visible_String;
   55|      0|            default:
  ------------------
  |  Branch (55:13): [True: 0, False: 692]
  ------------------
   56|      0|               return 0;
   57|    692|         }
   58|    692|      }
asn1_str.cpp:_ZN5Botan12_GLOBAL__N_115choose_encodingENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
  120|    339|ASN1_Type choose_encoding(std::string_view str) {
  121|    339|   if(g_char_validator.valid_encoding(str, ASN1_Type::PrintableString)) {
  ------------------
  |  Branch (121:7): [True: 339, False: 0]
  ------------------
  122|    339|      return ASN1_Type::PrintableString;
  123|    339|   } else {
  124|      0|      return ASN1_Type::Utf8String;
  125|      0|   }
  126|    339|}

_ZN5Botan9ASN1_Time11decode_fromERNS_11BER_DecoderE:
   59|    311|void ASN1_Time::decode_from(BER_Decoder& source) {
   60|    311|   const BER_Object ber_time = source.get_next_object();
   61|       |
   62|    311|   if(ber_time.get_class() != ASN1_Class::Universal ||
  ------------------
  |  Branch (62:7): [True: 140, False: 171]
  ------------------
   63|    186|      (ber_time.type() != ASN1_Type::UtcTime && ber_time.type() != ASN1_Type::GeneralizedTime)) {
  ------------------
  |  Branch (63:8): [True: 103, False: 68]
  |  Branch (63:49): [True: 46, False: 57]
  ------------------
   64|    186|      throw Decoding_Error(fmt("ASN1_Time: Unexpected tag {}/{}",
   65|    186|                               static_cast<uint32_t>(ber_time.type()),
   66|    186|                               static_cast<uint32_t>(ber_time.get_class())));
   67|    186|   }
   68|       |
   69|    125|   try {
   70|    125|      set_to(ASN1::to_string(ber_time), ber_time.type());
   71|    125|   } catch(Invalid_Argument& e) {
   72|    104|      throw Decoding_Error(fmt("Invalid ASN1_Time encoding: {}", e.what()));
   73|    104|   }
   74|    125|}
_ZN5Botan9ASN1_Time6set_toENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEENS_9ASN1_TypeE:
  176|    125|void ASN1_Time::set_to(std::string_view t_spec, ASN1_Type spec_tag) {
  177|    125|   BOTAN_ARG_CHECK(spec_tag == ASN1_Type::UtcTime || spec_tag == ASN1_Type::GeneralizedTime,
  ------------------
  |  |   35|    125|   do {                                                          \
  |  |   36|    125|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */              \
  |  |   37|    182|      if(!(expr)) {                                              \
  |  |  ------------------
  |  |  |  Branch (37:12): [True: 68, False: 57]
  |  |  |  Branch (37:12): [True: 57, False: 0]
  |  |  ------------------
  |  |   38|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */     \
  |  |   39|      0|         Botan::throw_invalid_argument(msg, __func__, __FILE__); \
  |  |   40|      0|      }                                                          \
  |  |   41|    125|   } while(0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 125]
  |  |  ------------------
  ------------------
  178|    125|                   "Invalid tag for ASN1_Time");
  179|       |
  180|    125|   if(spec_tag == ASN1_Type::GeneralizedTime) {
  ------------------
  |  Branch (180:7): [True: 57, False: 68]
  ------------------
  181|     57|      BOTAN_ARG_CHECK(t_spec.size() == 15, "Invalid GeneralizedTime input string");
  ------------------
  |  |   35|     57|   do {                                                          \
  |  |   36|     57|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */              \
  |  |   37|     57|      if(!(expr)) {                                              \
  |  |  ------------------
  |  |  |  Branch (37:10): [True: 5, False: 52]
  |  |  ------------------
  |  |   38|      5|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */     \
  |  |   39|      5|         Botan::throw_invalid_argument(msg, __func__, __FILE__); \
  |  |   40|      5|      }                                                          \
  |  |   41|     57|   } while(0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 57]
  |  |  ------------------
  ------------------
  182|     68|   } else if(spec_tag == ASN1_Type::UtcTime) {
  ------------------
  |  Branch (182:14): [True: 68, False: 0]
  ------------------
  183|     68|      BOTAN_ARG_CHECK(t_spec.size() == 13, "Invalid UTCTime input string");
  ------------------
  |  |   35|     68|   do {                                                          \
  |  |   36|     68|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */              \
  |  |   37|     68|      if(!(expr)) {                                              \
  |  |  ------------------
  |  |  |  Branch (37:10): [True: 7, False: 61]
  |  |  ------------------
  |  |   38|      7|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */     \
  |  |   39|      7|         Botan::throw_invalid_argument(msg, __func__, __FILE__); \
  |  |   40|      7|      }                                                          \
  |  |   41|     68|   } while(0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 68]
  |  |  ------------------
  ------------------
  184|     68|   }
  185|       |
  186|    125|   BOTAN_ARG_CHECK(t_spec.back() == 'Z', "Botan does not support ASN1 times with timezones other than Z");
  ------------------
  |  |   35|    125|   do {                                                          \
  |  |   36|    125|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */              \
  |  |   37|    125|      if(!(expr)) {                                              \
  |  |  ------------------
  |  |  |  Branch (37:10): [True: 13, False: 112]
  |  |  ------------------
  |  |   38|     13|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */     \
  |  |   39|     13|         Botan::throw_invalid_argument(msg, __func__, __FILE__); \
  |  |   40|     13|      }                                                          \
  |  |   41|    125|   } while(0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 125]
  |  |  ------------------
  ------------------
  187|       |
  188|    125|   const size_t field_len = 2;
  189|       |
  190|    125|   const size_t year_start = 0;
  191|    125|   const size_t year_len = (spec_tag == ASN1_Type::UtcTime) ? 2 : 4;
  ------------------
  |  Branch (191:28): [True: 52, False: 73]
  ------------------
  192|    125|   const size_t month_start = year_start + year_len;
  193|    125|   const size_t day_start = month_start + field_len;
  194|    125|   const size_t hour_start = day_start + field_len;
  195|    125|   const size_t min_start = hour_start + field_len;
  196|    125|   const size_t sec_start = min_start + field_len;
  197|       |
  198|    125|   m_year = to_u32bit(t_spec.substr(year_start, year_len));
  199|    125|   m_month = to_u32bit(t_spec.substr(month_start, field_len));
  200|    125|   m_day = to_u32bit(t_spec.substr(day_start, field_len));
  201|    125|   m_hour = to_u32bit(t_spec.substr(hour_start, field_len));
  202|    125|   m_minute = to_u32bit(t_spec.substr(min_start, field_len));
  203|    125|   m_second = to_u32bit(t_spec.substr(sec_start, field_len));
  204|    125|   m_tag = spec_tag;
  205|       |
  206|    125|   if(spec_tag == ASN1_Type::UtcTime) {
  ------------------
  |  Branch (206:7): [True: 46, False: 79]
  ------------------
  207|     46|      if(m_year >= 50) {
  ------------------
  |  Branch (207:10): [True: 12, False: 34]
  ------------------
  208|     12|         m_year += 1900;
  209|     34|      } else {
  210|     34|         m_year += 2000;
  211|     34|      }
  212|     46|   }
  213|       |
  214|    125|   if(!passes_sanity_check()) {
  ------------------
  |  Branch (214:7): [True: 65, False: 60]
  ------------------
  215|     65|      throw Invalid_Argument(fmt("ASN1_Time string '{}' does not seem to be valid", t_spec));
  216|     65|   }
  217|    125|}
_ZNK5Botan9ASN1_Time19passes_sanity_checkEv:
  222|     86|bool ASN1_Time::passes_sanity_check() const {
  223|       |   // AppVeyor's trust store includes a cert with expiration date in 3016 ...
  224|     86|   if(m_year < 1950 || m_year > 3100) {
  ------------------
  |  Branch (224:7): [True: 11, False: 75]
  |  Branch (224:24): [True: 10, False: 65]
  ------------------
  225|     21|      return false;
  226|     21|   }
  227|     65|   if(m_month == 0 || m_month > 12) {
  ------------------
  |  Branch (227:7): [True: 2, False: 63]
  |  Branch (227:23): [True: 13, False: 50]
  ------------------
  228|     15|      return false;
  229|     15|   }
  230|       |
  231|     50|   const uint32_t days_in_month[12] = {31, 28 + 1, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
  232|       |
  233|     50|   if(m_day == 0 || m_day > days_in_month[m_month - 1]) {
  ------------------
  |  Branch (233:7): [True: 1, False: 49]
  |  Branch (233:21): [True: 10, False: 39]
  ------------------
  234|     11|      return false;
  235|     11|   }
  236|       |
  237|     39|   if(m_month == 2 && m_day == 29) {
  ------------------
  |  Branch (237:7): [True: 17, False: 22]
  |  Branch (237:23): [True: 9, False: 8]
  ------------------
  238|      9|      if(m_year % 4 != 0) {
  ------------------
  |  Branch (238:10): [True: 2, False: 7]
  ------------------
  239|      2|         return false;  // not a leap year
  240|      2|      }
  241|       |
  242|      7|      if(m_year % 100 == 0 && m_year % 400 != 0) {
  ------------------
  |  Branch (242:10): [True: 2, False: 5]
  |  Branch (242:31): [True: 1, False: 1]
  ------------------
  243|      1|         return false;
  244|      1|      }
  245|      7|   }
  246|       |
  247|     36|   if(m_hour >= 24 || m_minute >= 60 || m_second > 60) {
  ------------------
  |  Branch (247:7): [True: 7, False: 29]
  |  Branch (247:23): [True: 2, False: 27]
  |  Branch (247:41): [True: 3, False: 24]
  ------------------
  248|     12|      return false;
  249|     12|   }
  250|       |
  251|     24|   if(m_tag == ASN1_Type::UtcTime) {
  ------------------
  |  Branch (251:7): [True: 21, False: 3]
  ------------------
  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|     21|      if(m_second > 59) {
  ------------------
  |  Branch (259:10): [True: 3, False: 18]
  ------------------
  260|      3|         return false;
  261|      3|      }
  262|     21|   }
  263|       |
  264|     21|   return true;
  265|     24|}

_ZN5Botan11BER_DecoderD2Ev:
  366|  9.75k|BER_Decoder::~BER_Decoder() = default;
_ZNK5Botan11BER_Decoder10more_itemsEv:
  371|  1.94k|bool BER_Decoder::more_items() const {
  372|  1.94k|   if(m_source->end_of_data() && !m_pushed.is_set()) {
  ------------------
  |  Branch (372:7): [True: 284, False: 1.65k]
  |  Branch (372:34): [True: 284, False: 0]
  ------------------
  373|    284|      return false;
  374|    284|   }
  375|  1.65k|   return true;
  376|  1.94k|}
_ZN5Botan11BER_Decoder10verify_endEv:
  381|  1.30k|BER_Decoder& BER_Decoder::verify_end() {
  382|  1.30k|   return verify_end("BER_Decoder::verify_end called, but data remains");
  383|  1.30k|}
_ZN5Botan11BER_Decoder10verify_endENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
  388|  1.30k|BER_Decoder& BER_Decoder::verify_end(std::string_view err) {
  389|  1.30k|   if(!m_source->end_of_data() || m_pushed.is_set()) {
  ------------------
  |  Branch (389:7): [True: 26, False: 1.27k]
  |  Branch (389:35): [True: 38, False: 1.23k]
  ------------------
  390|     64|      throw Decoding_Error(err);
  391|     64|   }
  392|  1.23k|   return (*this);
  393|  1.30k|}
_ZN5Botan11BER_Decoder14read_next_byteEv:
  405|  16.6k|std::optional<uint8_t> BER_Decoder::read_next_byte() {
  406|  16.6k|   BOTAN_ASSERT_NOMSG(m_source != nullptr);
  ------------------
  |  |   77|  16.6k|   do {                                                                     \
  |  |   78|  16.6k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   79|  16.6k|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (79:10): [True: 0, False: 16.6k]
  |  |  ------------------
  |  |   80|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   81|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   82|      0|      }                                                                     \
  |  |   83|  16.6k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (83:12): [Folded, False: 16.6k]
  |  |  ------------------
  ------------------
  407|  16.6k|   uint8_t b = 0;
  408|  16.6k|   if(m_source->read_byte(b) != 0) {
  ------------------
  |  Branch (408:7): [True: 15.0k, False: 1.57k]
  ------------------
  409|  15.0k|      return b;
  410|  15.0k|   } else {
  411|  1.57k|      return {};
  412|  1.57k|   }
  413|  16.6k|}
_ZN5Botan11BER_Decoder15get_next_objectEv:
  426|  13.7k|BER_Object BER_Decoder::get_next_object() {
  427|  13.7k|   BER_Object next;
  428|       |
  429|  13.7k|   if(m_pushed.is_set()) {
  ------------------
  |  Branch (429:7): [True: 914, False: 12.8k]
  ------------------
  430|    914|      std::swap(next, m_pushed);
  431|    914|      return next;
  432|    914|   }
  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: 800, False: 12.0k]
  ------------------
  440|    800|         return next;
  441|    800|      }
  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.01k, False: 10.9k]
  |  Branch (450:40): [True: 47, False: 972]
  ------------------
  451|     47|         (dl.content_length() != 0 || dl.indefinite_length())) {
  ------------------
  |  Branch (451:11): [True: 37, False: 10]
  |  Branch (451:39): [True: 0, False: 10]
  ------------------
  452|     37|         throw BER_Decoding_Error("EOC marker with non-zero length");
  453|     37|      }
  454|       |
  455|  11.9k|      if(!m_source->check_available(dl.total_length())) {
  ------------------
  |  Branch (455:10): [True: 143, False: 11.8k]
  ------------------
  456|    143|         throw BER_Decoding_Error("Value truncated");
  457|    143|      }
  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: 10, False: 11.8k]
  ------------------
  473|     10|         if(m_limits.require_der_encoding()) {
  ------------------
  |  Branch (473:13): [True: 10, False: 0]
  ------------------
  474|     10|            throw BER_Decoding_Error("Detected EOC marker in DER structure");
  475|     10|         }
  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|    580|void BER_Decoder::push_back(const BER_Object& obj) {
  501|    580|   if(m_pushed.is_set()) {
  ------------------
  |  Branch (501:7): [True: 0, False: 580]
  ------------------
  502|      0|      throw Invalid_State("BER_Decoder: Only one push back is allowed");
  503|      0|   }
  504|    580|   m_pushed = obj;
  505|    580|}
_ZN5Botan11BER_Decoder9push_backEONS_10BER_ObjectE:
  507|  1.03k|void BER_Decoder::push_back(BER_Object&& obj) {
  508|  1.03k|   if(m_pushed.is_set()) {
  ------------------
  |  Branch (508:7): [True: 0, False: 1.03k]
  ------------------
  509|      0|      throw Invalid_State("BER_Decoder: Only one push back is allowed");
  510|      0|   }
  511|  1.03k|   m_pushed = std::move(obj);
  512|  1.03k|}
_ZN5Botan11BER_Decoder10start_consENS_9ASN1_TypeENS_10ASN1_ClassE:
  514|  6.61k|BER_Decoder BER_Decoder::start_cons(ASN1_Type type_tag, ASN1_Class class_tag) {
  515|  6.61k|   BER_Object obj = get_next_object();
  516|  6.61k|   obj.assert_is_a(type_tag, class_tag | ASN1_Class::Constructed);
  517|  6.61k|   BER_Decoder child(std::move(obj), this);
  518|  6.61k|   return child;
  519|  6.61k|}
_ZN5Botan11BER_Decoder8end_consEv:
  524|  1.72k|BER_Decoder& BER_Decoder::end_cons() {
  525|  1.72k|   if(m_parent == nullptr) {
  ------------------
  |  Branch (525:7): [True: 0, False: 1.72k]
  ------------------
  526|      0|      throw Invalid_State("BER_Decoder::end_cons called with null parent");
  527|      0|   }
  528|  1.72k|   if(!m_source->end_of_data() || m_pushed.is_set()) {
  ------------------
  |  Branch (528:7): [True: 6, False: 1.71k]
  |  Branch (528:35): [True: 0, False: 1.71k]
  ------------------
  529|      6|      throw Decoding_Error("BER_Decoder::end_cons called with data left");
  530|      6|   }
  531|  1.71k|   return (*m_parent);
  532|  1.72k|}
_ZN5Botan11BER_DecoderC2EONS_10BER_ObjectEPS0_:
  535|  6.11k|      m_limits(parent != nullptr ? parent->limits() : BER_Decoder::Limits::BER()), m_parent(parent) {
  ------------------
  |  Branch (535:16): [True: 6.11k, False: 0]
  ------------------
  536|  6.11k|   m_data_src = std::make_unique<DataSource_BERObject>(std::move(obj));
  537|  6.11k|   m_source = m_data_src.get();
  538|  6.11k|}
_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.49k|BER_Decoder& BER_Decoder::decode(ASN1_Object& obj, ASN1_Type /*unused*/, ASN1_Class /*unused*/) {
  561|  3.49k|   obj.decode_from(*this);
  562|  3.49k|   return (*this);
  563|  3.49k|}
_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: 100, False: 1.24k]
  ------------------
  615|    100|      throw BER_Decoding_Error("Decoded small integer value was negative");
  616|    100|   }
  617|       |
  618|  1.24k|   if(integer.bits() > 32) {
  ------------------
  |  Branch (618:7): [True: 98, False: 1.14k]
  ------------------
  619|     98|      throw BER_Decoding_Error("Decoded integer value larger than expected");
  620|     98|   }
  621|       |
  622|  1.14k|   out = 0;
  623|  5.33k|   for(size_t i = 0; i != 4; ++i) {
  ------------------
  |  Branch (623:22): [True: 4.18k, False: 1.14k]
  ------------------
  624|  4.18k|      out = (out << 8) | integer.byte_at(3 - i);
  625|  4.18k|   }
  626|       |
  627|  1.14k|   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: 76]
  ------------------
  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: 58, False: 201]
  |  Branch (670:38): [True: 6, False: 52]
  ------------------
  671|      6|            throw BER_Decoding_Error("Detected non-minimal INTEGER encoding in DER structure");
  672|      6|         }
  673|    253|         if(obj.bits()[0] == 0xFF && (obj.bits()[1] & 0x80) != 0) {
  ------------------
  |  Branch (673:13): [True: 31, False: 222]
  |  Branch (673:38): [True: 13, False: 18]
  ------------------
  674|     13|            throw BER_Decoding_Error("Detected non-minimal INTEGER encoding in DER structure");
  675|     13|         }
  676|    253|      }
  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: 100, False: 1.22k]
  ------------------
  686|    100|         secure_vector<uint8_t> vec(obj.bits(), obj.bits() + obj.length());
  687|    546|         for(size_t i = obj.length(); i > 0; --i) {
  ------------------
  |  Branch (687:39): [True: 546, False: 0]
  ------------------
  688|    546|            const bool gt0 = (vec[i - 1] > 0);
  689|    546|            vec[i - 1] -= 1;
  690|    546|            if(gt0) {
  ------------------
  |  Branch (690:16): [True: 100, False: 446]
  ------------------
  691|    100|               break;
  692|    100|            }
  693|    546|         }
  694|  24.7k|         for(size_t i = 0; i != obj.length(); ++i) {
  ------------------
  |  Branch (694:28): [True: 24.6k, False: 100]
  ------------------
  695|  24.6k|            vec[i] = ~vec[i];
  696|  24.6k|         }
  697|    100|         out._assign_from_bytes(vec);
  698|    100|         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.24k|                                 ASN1_Class class_tag) {
  783|  1.24k|   if(real_type != ASN1_Type::OctetString && real_type != ASN1_Type::BitString) {
  ------------------
  |  Branch (783:7): [True: 611, False: 636]
  |  Branch (783:46): [True: 0, False: 611]
  ------------------
  784|      0|      throw BER_Bad_Tag("Bad tag for {BIT,OCTET} STRING", static_cast<uint32_t>(real_type));
  785|      0|   }
  786|       |
  787|  1.24k|   asn1_decode_binary_string(
  788|  1.24k|      buffer, get_next_object(), real_type, type_tag, class_tag, m_limits.require_der_encoding());
  789|  1.24k|   return (*this);
  790|  1.24k|}
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: 800, False: 12.0k]
  ------------------
   31|    800|      type_tag = ASN1_Type::NoObject;
   32|    800|      class_tag = ASN1_Class::NoObject;
   33|    800|      return 0;
   34|    800|   }
   35|       |
   36|  12.0k|   if((*b & 0x1F) != 0x1F) {
  ------------------
  |  Branch (36:7): [True: 11.5k, False: 437]
  ------------------
   37|  11.5k|      type_tag = ASN1_Type(*b & 0x1F);
   38|  11.5k|      class_tag = ASN1_Class(*b & 0xE0);
   39|  11.5k|      return 1;
   40|  11.5k|   }
   41|       |
   42|    437|   size_t tag_bytes = 1;
   43|    437|   class_tag = ASN1_Class(*b & 0xE0);
   44|       |
   45|    437|   uint32_t tag_buf = 0;
   46|  1.48k|   while(true) {
  ------------------
  |  Branch (46:10): [True: 1.48k, Folded]
  ------------------
   47|  1.48k|      b = ber->read_byte();
   48|  1.48k|      if(!b) {
  ------------------
  |  Branch (48:10): [True: 19, False: 1.46k]
  ------------------
   49|     19|         throw BER_Decoding_Error("Long-form tag truncated");
   50|     19|      }
   51|  1.46k|      if((tag_buf >> 24) != 0) {
  ------------------
  |  Branch (51:10): [True: 8, False: 1.45k]
  ------------------
   52|      8|         throw BER_Decoding_Error("Long-form tag overflowed 32 bits");
   53|      8|      }
   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.45k|      if(tag_bytes == 1 && (*b & 0x7F) == 0) {
  ------------------
  |  Branch (58:10): [True: 434, False: 1.02k]
  |  Branch (58:28): [True: 1, False: 433]
  ------------------
   59|      1|         throw BER_Decoding_Error("Long form tag with leading zero");
   60|      1|      }
   61|  1.45k|      ++tag_bytes;
   62|  1.45k|      tag_buf = (tag_buf << 7) | (*b & 0x7F);
   63|  1.45k|      if((*b & 0x80) == 0) {
  ------------------
  |  Branch (63:10): [True: 409, False: 1.04k]
  ------------------
   64|    409|         break;
   65|    409|      }
   66|  1.45k|   }
   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|    409|   if(tag_buf <= 30) {
  ------------------
  |  Branch (70:7): [True: 6, False: 403]
  ------------------
   71|      6|      throw BER_Decoding_Error("Long-form tag encoding used for small tag value");
   72|      6|   }
   73|       |
   74|    403|   if(tag_buf == static_cast<uint32_t>(ASN1_Type::NoObject)) {
  ------------------
  |  Branch (74:7): [True: 1, False: 402]
  ------------------
   75|      1|      throw BER_Decoding_Error("Tag value collides with internal sentinel");
   76|      1|   }
   77|       |
   78|       |   // NOLINTNEXTLINE(clang-analyzer-optin.core.EnumCastOutOfRange)
   79|    402|   type_tag = ASN1_Type(tag_buf);
   80|    402|   return tag_bytes;
   81|    403|}
ber_dec.cpp:_ZN5Botan12_GLOBAL__N_113decode_lengthEPNS_10DataSourceEmbb:
  126|  11.9k|BerDecodedLength decode_length(DataSource* ber, size_t allow_indef, bool der_mode, bool constructed) {
  127|  11.9k|   uint8_t b = 0;
  128|  11.9k|   if(ber->read_byte(b) == 0) {
  ------------------
  |  Branch (128:7): [True: 107, False: 11.8k]
  ------------------
  129|    107|      throw BER_Decoding_Error("Length field not found");
  130|    107|   }
  131|  11.8k|   if((b & 0x80) == 0) {
  ------------------
  |  Branch (131:7): [True: 11.5k, False: 300]
  ------------------
  132|  11.5k|      return BerDecodedLength(b, 1);
  133|  11.5k|   }
  134|       |
  135|    300|   const size_t num_length_bytes = (b & 0x7F);
  136|    300|   if(num_length_bytes > 4) {
  ------------------
  |  Branch (136:7): [True: 18, False: 282]
  ------------------
  137|     18|      throw BER_Decoding_Error("Length field is too large");
  138|     18|   }
  139|       |
  140|    282|   const size_t field_size = 1 + num_length_bytes;
  141|       |
  142|    282|   if(num_length_bytes == 0) {
  ------------------
  |  Branch (142:7): [True: 3, False: 279]
  ------------------
  143|      3|      if(der_mode) {
  ------------------
  |  Branch (143:10): [True: 3, False: 0]
  ------------------
  144|      3|         throw BER_Decoding_Error("Detected indefinite-length encoding in DER structure");
  145|      3|      } 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|      3|   }
  160|       |
  161|    279|   size_t length = 0;
  162|       |
  163|    917|   for(size_t i = 0; i != num_length_bytes; ++i) {
  ------------------
  |  Branch (163:22): [True: 647, False: 270]
  ------------------
  164|    647|      if(ber->read_byte(b) == 0) {
  ------------------
  |  Branch (164:10): [True: 9, False: 638]
  ------------------
  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|    638|      length = (length << 8) | b;
  169|    638|   }
  170|       |
  171|       |   // DER requires shortest possible length encoding
  172|    270|   if(der_mode) {
  ------------------
  |  Branch (172:7): [True: 270, False: 0]
  ------------------
  173|    270|      if(length < 128) {
  ------------------
  |  Branch (173:10): [True: 9, False: 261]
  ------------------
  174|      9|         throw BER_Decoding_Error("Detected non-canonical length encoding in DER structure");
  175|      9|      }
  176|    261|      if(num_length_bytes > 1 && length < (size_t(1) << ((num_length_bytes - 1) * 8))) {
  ------------------
  |  Branch (176:10): [True: 225, False: 36]
  |  Branch (176:34): [True: 1, False: 224]
  ------------------
  177|      1|         throw BER_Decoding_Error("Detected non-canonical length encoding in DER structure");
  178|      1|      }
  179|    261|   }
  180|       |
  181|    260|   return BerDecodedLength(length, field_size);
  182|    270|}
ber_dec.cpp:_ZN5Botan12_GLOBAL__N_116BerDecodedLengthC2Emm:
   99|  11.8k|            BerDecodedLength(content_length, field_length, false) {}
ber_dec.cpp:_ZN5Botan12_GLOBAL__N_116BerDecodedLengthC2Emmb:
  116|  11.8k|            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.2k|bool is_constructed(ASN1_Class class_tag) {
   21|  13.2k|   return (static_cast<uint32_t>(class_tag) & static_cast<uint32_t>(ASN1_Class::Constructed)) != 0;
   22|  13.2k|}
ber_dec.cpp:_ZNK5Botan12_GLOBAL__N_116BerDecodedLength14content_lengthEv:
  105|  34.9k|      size_t content_length() const { return m_content_length; }
ber_dec.cpp:_ZNK5Botan12_GLOBAL__N_116BerDecodedLength17indefinite_lengthEv:
  112|  11.6k|      bool indefinite_length() const { return m_indefinite; }
ber_dec.cpp:_ZNK5Botan12_GLOBAL__N_116BerDecodedLength12total_lengthEv:
  108|  11.7k|      size_t total_length() const { return m_indefinite ? m_content_length + 2 : m_content_length; }
  ------------------
  |  Branch (108:44): [True: 0, False: 11.7k]
  ------------------
ber_dec.cpp:_ZN5Botan12_GLOBAL__N_120DataSource_BERObjectC2EONS_10BER_ObjectE:
  357|  6.11k|      explicit DataSource_BERObject(BER_Object&& obj) : m_obj(std::move(obj)) {}
ber_dec.cpp:_ZN5Botan12_GLOBAL__N_120DataSource_BERObject4readEPhm:
  327|  42.8k|      size_t read(uint8_t out[], size_t length) override {
  328|  42.8k|         BOTAN_ASSERT_NOMSG(m_offset <= m_obj.length());
  ------------------
  |  |   77|  42.8k|   do {                                                                     \
  |  |   78|  42.8k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   79|  42.8k|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (79:10): [True: 0, False: 42.8k]
  |  |  ------------------
  |  |   80|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   81|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   82|      0|      }                                                                     \
  |  |   83|  42.8k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (83:12): [Folded, False: 42.8k]
  |  |  ------------------
  ------------------
  329|  42.8k|         const size_t got = std::min<size_t>(m_obj.length() - m_offset, length);
  330|  42.8k|         copy_mem(out, m_obj.bits() + m_offset, got);
  331|  42.8k|         m_offset += got;
  332|  42.8k|         return got;
  333|  42.8k|      }
ber_dec.cpp:_ZN5Botan12_GLOBAL__N_120DataSource_BERObject15check_availableEm:
  348|  8.31k|      bool check_available(size_t n) override {
  349|  8.31k|         BOTAN_ASSERT_NOMSG(m_offset <= m_obj.length());
  ------------------
  |  |   77|  8.31k|   do {                                                                     \
  |  |   78|  8.31k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   79|  8.31k|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (79:10): [True: 0, False: 8.31k]
  |  |  ------------------
  |  |   80|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   81|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   82|      0|      }                                                                     \
  |  |   83|  8.31k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (83:12): [Folded, False: 8.31k]
  |  |  ------------------
  ------------------
  350|  8.31k|         return (n <= (m_obj.length() - m_offset));
  351|  8.31k|      }
ber_dec.cpp:_ZNK5Botan12_GLOBAL__N_120DataSource_BERObject11end_of_dataEv:
  353|  3.79k|      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.79k|      size_t get_bytes_read() const override { return m_offset; }
ber_dec.cpp:_ZN5Botan12_GLOBAL__N_114is_constructedERKNS_10BER_ObjectE:
  709|  1.23k|bool is_constructed(const BER_Object& obj) {
  710|  1.23k|   return is_constructed(obj.class_tag());
  711|  1.23k|}
ber_dec.cpp:_ZN5Botan12_GLOBAL__N_125asn1_decode_binary_stringINSt3__19allocatorIhEEEEvRNS2_6vectorIhT_EERKNS_10BER_ObjectENS_9ASN1_TypeESC_NS_10ASN1_ClassEb:
  719|  1.24k|                               bool require_der) {
  720|  1.24k|   obj.assert_is_a(type_tag, class_tag);
  721|       |
  722|       |   // DER requires BIT STRING and OCTET STRING to use primitive encoding
  723|  1.24k|   if(require_der && is_constructed(obj)) {
  ------------------
  |  Branch (723:7): [True: 1.23k, False: 8]
  |  Branch (723:22): [True: 0, False: 1.23k]
  ------------------
  724|      0|      throw BER_Decoding_Error("Detected constructed string encoding in DER structure");
  725|      0|   }
  726|       |
  727|  1.24k|   if(real_type == ASN1_Type::OctetString) {
  ------------------
  |  Branch (727:7): [True: 631, False: 616]
  ------------------
  728|    631|      buffer.assign(obj.bits(), obj.bits() + obj.length());
  729|    631|   } else {
  730|    616|      if(obj.length() == 0) {
  ------------------
  |  Branch (730:10): [True: 1, False: 615]
  ------------------
  731|      1|         throw BER_Decoding_Error("Invalid BIT STRING");
  732|      1|      }
  733|       |
  734|    615|      const uint8_t unused_bits = obj.bits()[0];
  735|       |
  736|    615|      if(unused_bits >= 8) {
  ------------------
  |  Branch (736:10): [True: 5, False: 610]
  ------------------
  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|    610|      if(unused_bits > 0 && obj.length() < 2) {
  ------------------
  |  Branch (741:10): [True: 12, False: 598]
  |  Branch (741:29): [True: 2, False: 10]
  ------------------
  742|      2|         throw BER_Decoding_Error("Invalid BIT STRING");
  743|      2|      }
  744|       |
  745|       |      // DER requires unused bits in BIT STRING to be zero (X.690 section 11.2.2)
  746|    608|      if(require_der && unused_bits > 0) {
  ------------------
  |  Branch (746:10): [True: 600, False: 8]
  |  Branch (746:25): [True: 10, False: 590]
  ------------------
  747|     10|         const uint8_t last_byte = obj.bits()[obj.length() - 1];
  748|     10|         if((last_byte & ((1 << unused_bits) - 1)) != 0) {
  ------------------
  |  Branch (748:13): [True: 7, False: 3]
  ------------------
  749|      7|            throw BER_Decoding_Error("Detected non-zero padding bits in BIT STRING in DER structure");
  750|      7|         }
  751|     10|      }
  752|       |
  753|    601|      buffer.resize(obj.length() - 1);
  754|       |
  755|    601|      if(obj.length() > 1) {
  ------------------
  |  Branch (755:10): [True: 41, False: 560]
  ------------------
  756|     41|         copy_mem(buffer.data(), obj.bits() + 1, obj.length() - 1);
  757|     41|      }
  758|    601|   }
  759|  1.24k|}

_ZN5Botan11DER_EncoderC2ERNSt3__16vectorIhNS1_9allocatorIhEEEE:
   72|    118|DER_Encoder::DER_Encoder(std::vector<uint8_t>& vec) {
   73|    118|   m_append_output = [&vec](const uint8_t b[], size_t l) { vec.insert(vec.end(), b, b + l); };
   74|    118|}
_ZN5Botan11DER_Encoder10add_objectENS_9ASN1_TypeENS_10ASN1_ClassEPKhm:
  244|    118|DER_Encoder& DER_Encoder::add_object(ASN1_Type type_tag, ASN1_Class class_tag, const uint8_t rep[], size_t length) {
  245|    118|   std::vector<uint8_t> hdr;
  246|    118|   encode_tag(hdr, type_tag, class_tag);
  247|    118|   encode_length(hdr, length);
  248|       |
  249|    118|   if(!m_subsequences.empty()) {
  ------------------
  |  Branch (249:7): [True: 0, False: 118]
  ------------------
  250|      0|      m_subsequences[m_subsequences.size() - 1].add_bytes(hdr.data(), hdr.size(), rep, length);
  251|    118|   } else if(m_append_output) {
  ------------------
  |  Branch (251:14): [True: 118, False: 0]
  ------------------
  252|    118|      m_append_output(hdr.data(), hdr.size());
  253|    118|      m_append_output(rep, length);
  254|    118|   } else {
  255|      0|      m_default_outbuf += hdr;
  256|      0|      m_default_outbuf += std::make_pair(rep, length);
  257|      0|   }
  258|       |
  259|    118|   return (*this);
  260|    118|}
der_enc.cpp:_ZN5Botan12_GLOBAL__N_110encode_tagERNSt3__16vectorIhNS1_9allocatorIhEEEENS_9ASN1_TypeENS_10ASN1_ClassE:
   25|    118|void encode_tag(std::vector<uint8_t>& encoded_tag, ASN1_Type type_tag_e, ASN1_Class class_tag_e) {
   26|    118|   const uint32_t type_tag = static_cast<uint32_t>(type_tag_e);
   27|    118|   const uint32_t class_tag = static_cast<uint32_t>(class_tag_e);
   28|       |
   29|    118|   if((class_tag | 0xE0) != 0xE0) {
  ------------------
  |  Branch (29:7): [True: 0, False: 118]
  ------------------
   30|      0|      throw Encoding_Error(fmt("DER_Encoder: Invalid class tag {}", std::to_string(class_tag)));
   31|      0|   }
   32|       |
   33|    118|   if(type_tag <= 30) {
  ------------------
  |  Branch (33:7): [True: 118, False: 0]
  ------------------
   34|    118|      encoded_tag.push_back(static_cast<uint8_t>(type_tag | class_tag));
   35|    118|   } else {
   36|      0|      size_t blocks = high_bit(static_cast<uint32_t>(type_tag)) + 6;
   37|      0|      blocks = (blocks - (blocks % 7)) / 7;
   38|       |
   39|      0|      BOTAN_ASSERT_NOMSG(blocks > 0);
  ------------------
  |  |   77|      0|   do {                                                                     \
  |  |   78|      0|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   79|      0|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (79:10): [True: 0, False: 0]
  |  |  ------------------
  |  |   80|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   81|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   82|      0|      }                                                                     \
  |  |   83|      0|   } while(0)
  |  |  ------------------
  |  |  |  Branch (83:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
   40|       |
   41|      0|      encoded_tag.push_back(static_cast<uint8_t>(class_tag | 0x1F));
   42|      0|      for(size_t i = 0; i != blocks - 1; ++i) {
  ------------------
  |  Branch (42:25): [True: 0, False: 0]
  ------------------
   43|      0|         encoded_tag.push_back(0x80 | ((type_tag >> 7 * (blocks - i - 1)) & 0x7F));
   44|      0|      }
   45|      0|      encoded_tag.push_back(type_tag & 0x7F);
   46|      0|   }
   47|    118|}
der_enc.cpp:_ZN5Botan12_GLOBAL__N_113encode_lengthERNSt3__16vectorIhNS1_9allocatorIhEEEEm:
   52|    118|void encode_length(std::vector<uint8_t>& encoded_length, size_t length) {
   53|    118|   if(length <= 127) {
  ------------------
  |  Branch (53:7): [True: 118, False: 0]
  ------------------
   54|    118|      encoded_length.push_back(static_cast<uint8_t>(length));
   55|    118|   } else {
   56|      0|      const size_t bytes_needed = significant_bytes(length);
   57|       |
   58|      0|      encoded_length.push_back(static_cast<uint8_t>(0x80 | bytes_needed));
   59|       |
   60|      0|      for(size_t i = sizeof(length) - bytes_needed; i < sizeof(length); ++i) {
  ------------------
  |  Branch (60:53): [True: 0, False: 0]
  ------------------
   61|      0|         encoded_length.push_back(get_byte_var(i, length));
   62|      0|      }
   63|      0|   }
   64|    118|}
der_enc.cpp:_ZZN5Botan11DER_EncoderC1ERNSt3__16vectorIhNS1_9allocatorIhEEEEENK3$_0clEPKhm:
   73|    236|   m_append_output = [&vec](const uint8_t b[], size_t l) { vec.insert(vec.end(), b, b + l); };

_ZNK5Botan6BigInt7byte_atEm:
  118|  4.18k|uint8_t BigInt::byte_at(size_t n) const {
  119|  4.18k|   return get_byte_var(sizeof(word) - (n % sizeof(word)) - 1, word_at(n / sizeof(word)));
  120|  4.18k|}
_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.0k|   for(size_t i = 0; i != sz; ++i) {
  ------------------
  |  Branch (221:22): [True: 16.7k, False: 1.24k]
  ------------------
  222|  16.7k|      const word w = m_reg[sz - i - 1];
  223|  16.7k|      sub &= ct_is_zero(w);
  224|  16.7k|      sig -= sub;
  225|  16.7k|   }
  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|    183|size_t BigInt::top_bits_free() const {
  299|    183|   const size_t words = sig_words();
  300|       |
  301|    183|   const word top_word = word_at(words - 1);
  302|    183|   const size_t bits_used = high_bit(CT::value_barrier(top_word));
  303|    183|   CT::unpoison(bits_used);
  304|    183|   return WordInfo<word>::bits - bits_used;
  305|    183|}
_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: 962, False: 183]
  ------------------
  311|    962|      return 0;
  312|    962|   }
  313|       |
  314|    183|   const size_t full_words = (words - 1) * WordInfo<word>::bits;
  315|    183|   const size_t top_bits = WordInfo<word>::bits - top_bits_free();
  316|       |
  317|    183|   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.49k|   for(size_t i = 0; i != full_words; ++i) {
  ------------------
  |  Branch (434:22): [True: 7.25k, False: 1.24k]
  ------------------
  435|  7.25k|      reg[i] = load_be<word>(bytes.last<sizeof(word)>());
  436|  7.25k|      bytes = bytes.first(bytes.size() - sizeof(word));
  437|  7.25k|   }
  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.97k|BOTAN_MALLOC_FN void* allocate_memory(size_t elems, size_t elem_size) {
   22|  4.97k|   if(elems == 0 || elem_size == 0) {
  ------------------
  |  Branch (22:7): [True: 0, False: 4.97k]
  |  Branch (22:21): [True: 0, False: 4.97k]
  ------------------
   23|      0|      return nullptr;
   24|      0|   }
   25|       |
   26|       |   // Some calloc implementations do not check for overflow (?!?)
   27|  4.97k|   if(!checked_mul(elems, elem_size).has_value()) {
  ------------------
  |  Branch (27:7): [True: 0, False: 4.97k]
  ------------------
   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.97k|   void* ptr = std::calloc(elems, elem_size);  // NOLINT(*-no-malloc,*-owning-memory)
   43|  4.97k|#endif
   44|  4.97k|   if(ptr == nullptr) {
  ------------------
  |  Branch (44:7): [True: 0, False: 4.97k]
  ------------------
   45|      0|      [[unlikely]] throw std::bad_alloc();
   46|      0|   }
   47|  4.97k|   return ptr;
   48|  4.97k|}
_ZN5Botan17deallocate_memoryEPvmm:
   50|  4.97k|void deallocate_memory(void* p, size_t elems, size_t elem_size) {
   51|  4.97k|   if(p == nullptr) {
  ------------------
  |  Branch (51:7): [True: 0, False: 4.97k]
  ------------------
   52|      0|      [[unlikely]] return;
   53|      0|   }
   54|       |
   55|  4.97k|   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.97k|   std::free(p);  // NOLINT(*-no-malloc,*-owning-memory)
   64|  4.97k|}

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

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

_ZN5Botan10DataSource9read_byteERh:
   27|  29.2k|size_t DataSource::read_byte(uint8_t& out) {
   28|  29.2k|   return read(&out, 1);
   29|  29.2k|}
_ZN5Botan10DataSource9read_byteEv:
   34|  14.2k|std::optional<uint8_t> DataSource::read_byte() {
   35|  14.2k|   uint8_t b = 0;
   36|  14.2k|   if(this->read(&b, 1) == 1) {
  ------------------
  |  Branch (36:7): [True: 13.4k, False: 819]
  ------------------
   37|  13.4k|      return b;
   38|  13.4k|   } else {
   39|    819|      return {};
   40|    819|   }
   41|  14.2k|}
_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.46k|bool DataSource_Memory::check_available(size_t n) {
   81|  3.46k|   return (n <= (m_source.size() - m_offset));
   82|  3.46k|}
_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.92k|Exception::Exception(std::string_view msg) : m_msg(msg) {}
_ZN5Botan16Invalid_ArgumentC2ENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
   77|    104|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.4k|void secure_scrub_memory(void* ptr, size_t n) {
   26|  35.4k|   return secure_zeroize_buffer(ptr, n);
   27|  35.4k|}
_ZN5Botan21secure_zeroize_bufferEPvm:
   29|  35.4k|void secure_zeroize_buffer(void* ptr, size_t n) {
   30|  35.4k|   if(n == 0) {
  ------------------
  |  Branch (30:7): [True: 19.2k, False: 16.2k]
  ------------------
   31|  19.2k|      return;
   32|  19.2k|   }
   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|}

_ZN5Botan9parse_u32ENSt3__117basic_string_viewIcNS0_11char_traitsIcEEEE:
   59|    549|std::optional<uint32_t> parse_u32(std::string_view input) {
   60|    549|   return parse_decimal_integer<uint32_t>(input);
   61|    549|}
_ZN5Botan9to_u32bitENSt3__117basic_string_viewIcNS0_11char_traitsIcEEEE:
   71|    549|uint32_t to_u32bit(std::string_view input) {
   72|    549|   if(const auto parsed = parse_u32(input)) {
  ------------------
  |  Branch (72:18): [True: 535, False: 14]
  ------------------
   73|    535|      return *parsed;
   74|    535|   } else {
   75|     14|      throw Invalid_Argument(fmt("Failed to parse input '{}' as a 32-bit integer", input));
   76|     14|   }
   77|    549|}
parsing.cpp:_ZN5Botan12_GLOBAL__N_116digit_from_asciiEc:
   23|  1.18k|std::optional<size_t> digit_from_ascii(char c) {
   24|  1.18k|   if(c >= '0' && c <= '9') {
  ------------------
  |  Branch (24:7): [True: 1.17k, False: 9]
  |  Branch (24:19): [True: 1.17k, False: 5]
  ------------------
   25|  1.17k|      return c - '0';
   26|  1.17k|   } else {
   27|     14|      return {};
   28|     14|   }
   29|  1.18k|}
parsing.cpp:_ZN5Botan12_GLOBAL__N_121parse_decimal_integerITkNSt3__117unsigned_integralEjEENS2_8optionalIT_EENS2_17basic_string_viewIcNS2_11char_traitsIcEEEE:
   32|    549|std::optional<T> parse_decimal_integer(std::string_view input) {
   33|    549|   if(input.empty() || input.size() > (std::numeric_limits<T>::digits10 + 1)) {
  ------------------
  |  Branch (33:7): [True: 0, False: 549]
  |  Branch (33:24): [True: 0, False: 549]
  ------------------
   34|      0|      return {};
   35|      0|   }
   36|       |
   37|    549|   T accum = 0;
   38|       |
   39|  1.18k|   for(const char c : input) {
  ------------------
  |  Branch (39:21): [True: 1.18k, False: 535]
  ------------------
   40|  1.18k|      if(const auto digit = digit_from_ascii(c)) {
  ------------------
  |  Branch (40:21): [True: 1.17k, False: 14]
  ------------------
   41|  1.17k|         if(accum > (std::numeric_limits<T>::max() - static_cast<T>(*digit)) / 10) {
  ------------------
  |  Branch (41:13): [True: 0, False: 1.17k]
  ------------------
   42|      0|            return {};
   43|      0|         }
   44|  1.17k|         accum = accum * 10 + static_cast<T>(*digit);
   45|  1.17k|      } else {
   46|     14|         return {};
   47|     14|      }
   48|  1.18k|   }
   49|       |
   50|    535|   return accum;
   51|    549|}

_ZN5Botan4OCSP6CertID11decode_fromERNS_11BER_DecoderE:
   92|      1|void CertID::decode_from(BER_Decoder& from) {
   93|       |   /*
   94|       |   * RFC 6960 Section 4.1.1
   95|       |   *
   96|       |   * CertID ::= SEQUENCE {
   97|       |   *    hashAlgorithm       AlgorithmIdentifier,
   98|       |   *    issuerNameHash      OCTET STRING,
   99|       |   *    issuerKeyHash       OCTET STRING,
  100|       |   *    serialNumber        CertificateSerialNumber }
  101|       |   */
  102|      1|   from.start_sequence()
  103|      1|      .decode(m_hash_id)
  104|      1|      .decode(m_issuer_dn_hash, ASN1_Type::OctetString)
  105|      1|      .decode(m_issuer_key_hash, ASN1_Type::OctetString)
  106|      1|      .decode(m_subject_serial)
  107|      1|      .end_cons();
  108|       |
  109|      1|   if(!m_hash_id.parameters_are_null_or_empty()) {
  ------------------
  |  Branch (109:7): [True: 0, False: 1]
  ------------------
  110|      0|      throw Decoding_Error("OCSP CertID hashAlgorithm has unexpected parameters");
  111|      0|   }
  112|      1|}
_ZN5Botan4OCSP14SingleResponse11decode_fromERNS_11BER_DecoderE:
  118|      2|void SingleResponse::decode_from(BER_Decoder& from) {
  119|       |   /*
  120|       |   * RFC 6960 Section 4.2.1
  121|       |   *
  122|       |   * SingleResponse ::= SEQUENCE {
  123|       |   *    certID                       CertID,
  124|       |   *    certStatus                   CertStatus,
  125|       |   *    thisUpdate                   GeneralizedTime,
  126|       |   *    nextUpdate         [0]       EXPLICIT GeneralizedTime OPTIONAL,
  127|       |   *    singleExtensions   [1]       EXPLICIT Extensions OPTIONAL }
  128|       |   *
  129|       |   * CertStatus ::= CHOICE {
  130|       |   *    good        [0]     IMPLICIT NULL,
  131|       |   *    revoked     [1]     IMPLICIT RevokedInfo,
  132|       |   *    unknown     [2]     IMPLICIT UnknownInfo }
  133|       |   *
  134|       |   * RevokedInfo ::= SEQUENCE {
  135|       |   *    revocationTime              GeneralizedTime,
  136|       |   *    revocationReason    [0]     EXPLICIT CRLReason OPTIONAL }
  137|       |   */
  138|      2|   BER_Object cert_status;
  139|      2|   Extensions extensions;
  140|       |
  141|      2|   auto seq = from.start_sequence();
  142|      2|   seq.decode(m_certid)
  143|      2|      .get_next(cert_status)
  144|      2|      .decode(m_thisupdate)
  145|      2|      .decode_optional(m_nextupdate, ASN1_Type(0), ASN1_Class::ContextSpecific | ASN1_Class::Constructed);
  146|       |
  147|      2|   if(seq.more_items()) {
  ------------------
  |  Branch (147:7): [True: 0, False: 2]
  ------------------
  148|      0|      const BER_Object next = seq.get_next_object();
  149|      0|      if(next.is_a(1, ASN1_Class::ContextSpecific | ASN1_Class::Constructed)) {
  ------------------
  |  Branch (149:10): [True: 0, False: 0]
  ------------------
  150|      0|         BER_Decoder ext_decoder(next, BER_Decoder::Limits::DER());
  151|      0|         extensions.decode_from(ext_decoder, Extension_Context::OCSP_Response);
  152|      0|         ext_decoder.verify_end();
  153|      0|      } else {
  154|      0|         throw Decoding_Error("Unexpected tag in OCSP SingleResponse");
  155|      0|      }
  156|      0|   }
  157|      2|   seq.end_cons();
  158|       |
  159|      2|   const auto cert_status_class = cert_status.get_class();
  160|      2|   if(cert_status_class != ASN1_Class::ContextSpecific &&
  ------------------
  |  Branch (160:7): [True: 0, False: 2]
  ------------------
  161|      0|      cert_status_class != (ASN1_Class::ContextSpecific | ASN1_Class::Constructed)) {
  ------------------
  |  Branch (161:7): [True: 0, False: 0]
  ------------------
  162|      0|      throw Decoding_Error("OCSP::SingleResponse: certStatus has unexpected class tag");
  163|      0|   }
  164|       |
  165|       |   // TODO: should verify the cert_status body and decode RevokedInfo
  166|      2|   m_cert_status = static_cast<uint32_t>(cert_status.type());
  167|      2|   if(m_cert_status > 2) {
  ------------------
  |  Branch (167:7): [True: 0, False: 2]
  ------------------
  168|      0|      throw Decoding_Error("Unknown OCSP CertStatus tag");
  169|      0|   }
  170|       |
  171|       |   // We don't currently recognize any extensions here so if any are critical we should reject
  172|      2|   m_has_unknown_critical_ext = !extensions.critical_extensions().empty();
  173|      2|}
_ZN5Botan4OCSP8ResponseC2EPKhm:
  252|  1.76k|      m_response_bits(response_bits, response_bits + response_bits_len) {
  253|       |   /*
  254|       |   * RFC 6960 Section 4.2.1
  255|       |   *
  256|       |   * OCSPResponse ::= SEQUENCE {
  257|       |   *    responseStatus         OCSPResponseStatus,
  258|       |   *    responseBytes      [0] EXPLICIT ResponseBytes OPTIONAL }
  259|       |   *
  260|       |   * OCSPResponseStatus ::= ENUMERATED { ... }
  261|       |   *
  262|       |   * ResponseBytes ::= SEQUENCE {
  263|       |   *    responseType   OBJECT IDENTIFIER,
  264|       |   *    response       OCTET STRING }
  265|       |   */
  266|  1.76k|   BER_Decoder outer_decoder(m_response_bits, BER_Decoder::Limits::DER());
  267|  1.76k|   BER_Decoder response_outer = outer_decoder.start_sequence();
  268|       |
  269|  1.76k|   size_t resp_status = 0;
  270|       |
  271|  1.76k|   response_outer.decode(resp_status, ASN1_Type::Enumerated, ASN1_Class::Universal);
  272|       |
  273|       |   /*
  274|       |   RFC 6960 4.2.1
  275|       |
  276|       |   OCSPResponseStatus ::= ENUMERATED {
  277|       |       successful            (0),  -- Response has valid confirmations
  278|       |       malformedRequest      (1),  -- Illegal confirmation request
  279|       |       internalError         (2),  -- Internal error in issuer
  280|       |       tryLater              (3),  -- Try again later
  281|       |                                   -- (4) is not used
  282|       |       sigRequired           (5),  -- Must sign the request
  283|       |       unauthorized          (6)   -- Request unauthorized
  284|       |   }
  285|       |   */
  286|  1.76k|   if(resp_status == 4 || resp_status >= 7) {
  ------------------
  |  Branch (286:7): [True: 727, False: 1.04k]
  |  Branch (286:27): [True: 54, False: 988]
  ------------------
  287|     55|      throw Decoding_Error("Unknown OCSPResponseStatus code");
  288|     55|   }
  289|       |
  290|  1.71k|   m_status = static_cast<Response_Status_Code>(resp_status);
  291|       |
  292|       |   /*
  293|       |   * RFC 6960 4.2.1: "If the value of responseStatus is one of the error
  294|       |   * conditions, the responseBytes field is not set."
  295|       |   */
  296|  1.71k|   const bool successful = (m_status == Response_Status_Code::Successful);
  297|  1.71k|   const bool has_response_bytes = response_outer.more_items();
  298|       |
  299|  1.71k|   if(successful && !has_response_bytes) {
  ------------------
  |  Branch (299:7): [True: 961, False: 753]
  |  Branch (299:21): [True: 1, False: 960]
  ------------------
  300|      1|      throw Decoding_Error("OCSP response with successful status is missing responseBytes");
  301|      1|   }
  302|  1.71k|   if(!successful && has_response_bytes) {
  ------------------
  |  Branch (302:7): [True: 27, False: 1.68k]
  |  Branch (302:22): [True: 4, False: 23]
  ------------------
  303|      4|      throw Decoding_Error("OCSP response with non-successful status includes responseBytes");
  304|      4|   }
  305|       |
  306|  1.70k|   if(successful) {
  ------------------
  |  Branch (306:7): [True: 960, False: 749]
  ------------------
  307|    960|      BER_Decoder response_bytes_ctx = response_outer.start_context_specific(0);
  308|    960|      BER_Decoder response_bytes = response_bytes_ctx.start_sequence();
  309|       |
  310|    960|      response_bytes.decode_and_check(OID({1, 3, 6, 1, 5, 5, 7, 48, 1, 1}), "Unknown response type in OCSP response");
  311|       |
  312|       |      /*
  313|       |      * RFC 6960 Section 4.2.1
  314|       |      *
  315|       |      * BasicOCSPResponse ::= SEQUENCE {
  316|       |      *    tbsResponseData      ResponseData,
  317|       |      *    signatureAlgorithm   AlgorithmIdentifier,
  318|       |      *    signature            BIT STRING,
  319|       |      *    certs            [0] EXPLICIT SEQUENCE OF Certificate OPTIONAL }
  320|       |      */
  321|    960|      BER_Decoder basic_response_decoder(response_bytes.get_next_octet_string(), BER_Decoder::Limits::DER());
  322|    960|      BER_Decoder basicresponse = basic_response_decoder.start_sequence();
  323|       |
  324|    960|      basicresponse.start_sequence()
  325|    960|         .raw_bytes(m_tbs_bits)
  326|    960|         .end_cons()
  327|    960|         .decode(m_sig_algo)
  328|    960|         .decode(m_signature, ASN1_Type::BitString);
  329|    960|      decode_optional_list(basicresponse, ASN1_Type(0), m_certs);
  330|       |
  331|    960|      basicresponse.verify_end();
  332|    960|      basic_response_decoder.verify_end();
  333|       |
  334|       |      /*
  335|       |      * RFC 6960 Section 4.2.1
  336|       |      *
  337|       |      * ResponseData ::= SEQUENCE {
  338|       |      *    version              [0] EXPLICIT Version DEFAULT v1,
  339|       |      *    responderID              ResponderID,
  340|       |      *    producedAt               GeneralizedTime,
  341|       |      *    responses                SEQUENCE OF SingleResponse,
  342|       |      *    responseExtensions   [1] EXPLICIT Extensions OPTIONAL }
  343|       |      *
  344|       |      * ResponderID ::= CHOICE {
  345|       |      *    byName   [1] Name,
  346|       |      *    byKey    [2] KeyHash }
  347|       |      */
  348|    960|      size_t responsedata_version = 0;
  349|    960|      Extensions extensions;
  350|       |
  351|    960|      BER_Decoder tbs_decoder(m_tbs_bits, BER_Decoder::Limits::DER());
  352|    960|      tbs_decoder
  353|    960|         .decode_optional(responsedata_version, ASN1_Type(0), ASN1_Class::ContextSpecific | ASN1_Class::Constructed)
  354|       |
  355|    960|         .decode_optional(m_signer_name, ASN1_Type(1), ASN1_Class::ContextSpecific | ASN1_Class::Constructed)
  356|       |
  357|    960|         .decode_optional_string(
  358|    960|            m_key_hash, ASN1_Type::OctetString, 2, ASN1_Class::ContextSpecific | ASN1_Class::Constructed)
  359|       |
  360|    960|         .decode(m_produced_at)
  361|       |
  362|    960|         .decode_list(m_responses);
  363|       |
  364|    960|      if(tbs_decoder.more_items()) {
  ------------------
  |  Branch (364:10): [True: 6, False: 954]
  ------------------
  365|      6|         const BER_Object next = tbs_decoder.get_next_object();
  366|      6|         if(next.is_a(1, ASN1_Class::ContextSpecific | ASN1_Class::Constructed)) {
  ------------------
  |  Branch (366:13): [True: 1, False: 5]
  ------------------
  367|      1|            BER_Decoder ext_decoder(next, BER_Decoder::Limits::DER());
  368|      1|            extensions.decode_from(ext_decoder, Extension_Context::OCSP_Response);
  369|      1|            ext_decoder.verify_end();
  370|      5|         } else {
  371|      5|            throw Decoding_Error("Unexpected tag in OCSP ResponseData");
  372|      5|         }
  373|      6|      }
  374|    955|      tbs_decoder.verify_end();
  375|       |
  376|    955|      const bool has_signer = !m_signer_name.empty();
  377|    955|      const bool has_key_hash = !m_key_hash.empty();
  378|       |
  379|    955|      if(has_signer && has_key_hash) {
  ------------------
  |  Branch (379:10): [True: 0, False: 955]
  |  Branch (379:24): [True: 0, False: 0]
  ------------------
  380|      0|         throw Decoding_Error("OCSP response includes both byName and byKey in responderID field");
  381|      0|      }
  382|    955|      if(!has_signer && !has_key_hash) {
  ------------------
  |  Branch (382:10): [True: 5, False: 950]
  |  Branch (382:25): [True: 5, False: 0]
  ------------------
  383|      5|         throw Decoding_Error("OCSP response contains neither byName nor byKey in responderID field");
  384|      5|      }
  385|    950|      if(has_key_hash && m_key_hash.size() != 20) {
  ------------------
  |  Branch (385:10): [True: 0, False: 950]
  |  Branch (385:26): [True: 0, False: 0]
  ------------------
  386|       |         // KeyHash ::= OCTET STRING -- SHA-1 hash of responder's public key
  387|      0|         throw Decoding_Error("OCSP response contains a byKey with invalid length");
  388|      0|      }
  389|       |
  390|    950|      response_bytes.verify_end();
  391|    950|      response_bytes_ctx.verify_end();
  392|       |
  393|       |      // We don't currently recognize any extensions here so if any are critical we should reject
  394|    950|      m_has_unknown_critical_ext = !extensions.critical_extensions().empty();
  395|    950|   }
  396|       |
  397|  1.69k|   response_outer.verify_end();
  398|  1.69k|   outer_decoder.verify_end();
  399|       |
  400|  1.69k|   if(m_has_unknown_critical_ext == false) {
  ------------------
  |  Branch (400:7): [True: 4, False: 1.69k]
  ------------------
  401|       |      // Check all of the SingleResponse extensions
  402|      4|      for(const auto& sr : m_responses) {
  ------------------
  |  Branch (402:26): [True: 0, False: 4]
  ------------------
  403|      0|         if(sr.has_unknown_critical_extension()) {
  ------------------
  |  Branch (403:13): [True: 0, False: 0]
  ------------------
  404|      0|            m_has_unknown_critical_ext = true;
  405|      0|            break;
  406|      0|         }
  407|      0|      }
  408|      4|   }
  409|  1.69k|}
ocsp.cpp:_ZN5Botan4OCSP12_GLOBAL__N_120decode_optional_listERNS_11BER_DecoderENS_9ASN1_TypeERNSt3__16vectorINS_16X509_CertificateENS5_9allocatorIS7_EEEE:
  178|    592|void decode_optional_list(BER_Decoder& ber, ASN1_Type tag, std::vector<X509_Certificate>& output) {
  179|    592|   const BER_Object obj = ber.get_next_object();
  180|       |
  181|    592|   if(!obj.is_a(tag, ASN1_Class::ContextSpecific | ASN1_Class::Constructed)) {
  ------------------
  |  Branch (181:7): [True: 580, False: 12]
  ------------------
  182|    580|      ber.push_back(obj);
  183|    580|      return;
  184|    580|   }
  185|       |
  186|     12|   BER_Decoder list(obj, BER_Decoder::Limits::DER());
  187|     12|   auto seq = list.start_sequence();
  188|     18|   while(seq.more_items()) {
  ------------------
  |  Branch (188:10): [True: 6, False: 12]
  ------------------
  189|      6|      output.push_back([&] {
  190|      6|         X509_Certificate cert;
  191|      6|         cert.decode_from(seq);
  192|      6|         return cert;
  193|      6|      }());
  194|      6|   }
  195|     12|   seq.end_cons();
  196|     12|   list.verify_end();
  197|     12|}
ocsp.cpp:_ZZN5Botan4OCSP12_GLOBAL__N_120decode_optional_listERNS_11BER_DecoderENS_9ASN1_TypeERNSt3__16vectorINS_16X509_CertificateENS5_9allocatorIS7_EEEEENK3$_0clEv:
  189|      6|      output.push_back([&] {
  190|      6|         X509_Certificate cert;
  191|      6|         cert.decode_from(seq);
  192|      6|         return cert;
  193|      6|      }());

_ZN5Botan7X509_DN11decode_fromERNS_11BER_DecoderE:
  372|    343|void X509_DN::decode_from(BER_Decoder& source) {
  373|    343|   std::vector<uint8_t> bits;
  374|       |
  375|    343|   source.start_sequence().raw_bytes(bits).end_cons();
  376|       |
  377|    343|   BER_Decoder sequence(bits, source.limits());
  378|       |
  379|    343|   std::vector<std::vector<std::pair<OID, ASN1_String>>> rdns;
  380|       |
  381|       |   // Cap AVAs per RDN to bound work for downstream set-based matching.
  382|       |   // No legitimate cert has anywhere near this many AVAs in a single RDN.
  383|    343|   constexpr size_t MAX_AVAS_PER_RDN = 32;
  384|       |
  385|    681|   while(sequence.more_items()) {
  ------------------
  |  Branch (385:10): [True: 339, False: 342]
  ------------------
  386|    339|      BER_Decoder rdn_decoder = sequence.start_set();
  387|       |
  388|    339|      std::vector<std::pair<OID, ASN1_String>> rdn;
  389|    678|      while(rdn_decoder.more_items()) {
  ------------------
  |  Branch (389:13): [True: 339, False: 339]
  ------------------
  390|    339|         OID oid;
  391|    339|         ASN1_String str;
  392|       |
  393|    339|         rdn_decoder.start_sequence()
  394|    339|            .decode(oid)
  395|    339|            .decode(str)  // TODO support Any
  396|    339|            .end_cons();
  397|       |
  398|    339|         rdn.emplace_back(std::move(oid), std::move(str));
  399|       |
  400|    339|         if(rdn.size() > MAX_AVAS_PER_RDN) {
  ------------------
  |  Branch (400:13): [True: 0, False: 339]
  ------------------
  401|      0|            throw Decoding_Error("X.500 RDN has too many attribute-value assertions");
  402|      0|         }
  403|    339|      }
  404|       |
  405|       |      /*
  406|       |      RFC 5280 4.1.2.4:
  407|       |         RelativeDistinguishedName ::=
  408|       |           SET SIZE (1..MAX) OF AttributeTypeAndValue
  409|       |      */
  410|    339|      if(rdn.empty()) {
  ------------------
  |  Branch (410:10): [True: 1, False: 338]
  ------------------
  411|      1|         throw Decoding_Error("X.500 RDN must contain at least one attribute-value assertion");
  412|      1|      }
  413|    338|      rdns.push_back(std::move(rdn));
  414|    338|   }
  415|       |
  416|    342|   auto canonical_bits = canonicalize_dn(rdns);
  417|       |
  418|    342|   m_rdn = std::move(rdns);
  419|    342|   m_dn_bits = std::move(bits);
  420|    342|   m_canonical_dn_bits = std::move(canonical_bits);
  421|    342|}
x509_dn.cpp:_ZN5Botan12_GLOBAL__N_115canonicalize_dnERKNSt3__16vectorINS2_INS1_4pairINS_3OIDENS_11ASN1_StringEEENS1_9allocatorIS6_EEEENS7_IS9_EEEE:
  275|    122|std::vector<uint8_t> canonicalize_dn(const std::vector<std::vector<std::pair<OID, ASN1_String>>>& rdns) {
  276|    122|   auto append_canonical_data = []<typename T>(std::vector<uint8_t>& out, const T& data) {
  277|    122|      const std::array<uint8_t, 8> data_len = store_le(static_cast<uint64_t>(data.size()));
  278|    122|      out.insert(out.end(), data_len.begin(), data_len.end());
  279|    122|      out.insert(out.end(), data.begin(), data.end());
  280|    122|   };
  281|       |
  282|    122|   std::vector<uint8_t> canonical_bits;
  283|       |
  284|    122|   for(const auto& rdn : rdns) {
  ------------------
  |  Branch (284:24): [True: 118, False: 122]
  ------------------
  285|    118|      std::vector<uint8_t> rdn_bits;
  286|       |
  287|    118|      for(const auto& [oid, value] : canonicalize_rdn(rdn)) {
  ------------------
  |  Branch (287:36): [True: 118, False: 118]
  ------------------
  288|    118|         append_canonical_data(rdn_bits, oid.BER_encode());
  289|    118|         append_canonical_data(rdn_bits, value);
  290|    118|      }
  291|       |
  292|    118|      append_canonical_data(canonical_bits, rdn_bits);
  293|    118|   }
  294|       |
  295|    122|   return canonical_bits;
  296|    122|}
x509_dn.cpp:_ZN5Botan12_GLOBAL__N_116canonicalize_rdnERKNSt3__16vectorINS1_4pairINS_3OIDENS_11ASN1_StringEEENS1_9allocatorIS6_EEEE:
  263|    118|std::vector<std::pair<OID, std::string>> canonicalize_rdn(const std::vector<std::pair<OID, ASN1_String>>& rdn) {
  264|    118|   std::vector<std::pair<OID, std::string>> result;
  265|    118|   result.reserve(rdn.size());
  266|    118|   for(const auto& ava : rdn) {
  ------------------
  |  Branch (266:24): [True: 118, False: 118]
  ------------------
  267|    118|      result.emplace_back(ava.first, X500_Char_Iterator::canonicalize(ava.second.value()));
  268|    118|   }
  269|    118|   if(result.size() != 1) {
  ------------------
  |  Branch (269:7): [True: 0, False: 118]
  ------------------
  270|      0|      std::sort(result.begin(), result.end());
  271|      0|   }
  272|    118|   return result;
  273|    118|}
x509_dn.cpp:_ZN5Botan12_GLOBAL__N_118X500_Char_Iterator12canonicalizeENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEE:
   79|    118|      static std::string canonicalize(std::string_view name) {
   80|    118|         std::string result;
   81|    118|         result.reserve(name.size());
   82|       |
   83|    118|         X500_Char_Iterator it(name);
   84|    634|         while(auto c = it.next()) {
  ------------------
  |  Branch (84:21): [True: 516, False: 118]
  ------------------
   85|    516|            result += *c;
   86|    516|         }
   87|       |
   88|    118|         return result;
   89|    118|      }
x509_dn.cpp:_ZN5Botan12_GLOBAL__N_118X500_Char_IteratorC2ENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEE:
   46|    118|      explicit X500_Char_Iterator(std::string_view s) : m_str(s), m_pos(0) {
   47|       |         // Skip leading whitespace
   48|    118|         while(m_pos < m_str.size() && is_space(m_str[m_pos])) {
  ------------------
  |  Branch (48:16): [True: 116, False: 2]
  |  Branch (48:40): [True: 0, False: 116]
  ------------------
   49|      0|            ++m_pos;
   50|      0|         }
   51|    118|      }
x509_dn.cpp:_ZN5Botan12_GLOBAL__N_118X500_Char_Iterator4nextEv:
   54|    634|      std::optional<char> next() {
   55|    634|         if(m_pos >= m_str.size()) {
  ------------------
  |  Branch (55:13): [True: 118, False: 516]
  ------------------
   56|    118|            return std::nullopt;
   57|    118|         }
   58|       |
   59|    516|         if(is_space(m_str[m_pos])) {
  ------------------
  |  Branch (59:13): [True: 0, False: 516]
  ------------------
   60|       |            // Skip the entire whitespace run
   61|      0|            while(m_pos < m_str.size() && is_space(m_str[m_pos])) {
  ------------------
  |  Branch (61:19): [True: 0, False: 0]
  |  Branch (61:43): [True: 0, False: 0]
  ------------------
   62|      0|               ++m_pos;
   63|      0|            }
   64|       |            // Emit a single space only if more content follows (strip trailing ws)
   65|      0|            if(m_pos < m_str.size()) {
  ------------------
  |  Branch (65:16): [True: 0, False: 0]
  ------------------
   66|      0|               return ' ';
   67|      0|            }
   68|      0|            return std::nullopt;
   69|      0|         }
   70|       |
   71|    516|         const char c = m_str[m_pos++];
   72|       |         // Locale-independent ASCII fold; RFC 5280 DN matching does not depend on libc locale
   73|    516|         if(c >= 'A' && c <= 'Z') {
  ------------------
  |  Branch (73:13): [True: 14, False: 502]
  |  Branch (73:25): [True: 4, False: 10]
  ------------------
   74|      4|            return static_cast<char>(c + ('a' - 'A'));
   75|      4|         }
   76|    512|         return c;
   77|    516|      }
x509_dn.cpp:_ZZN5Botan12_GLOBAL__N_115canonicalize_dnERKNSt3__16vectorINS2_INS1_4pairINS_3OIDENS_11ASN1_StringEEENS1_9allocatorIS6_EEEENS7_IS9_EEEEENK3$_0clINS2_IhNS7_IhEEEEEEDaRSH_RKT_:
  276|    236|   auto append_canonical_data = []<typename T>(std::vector<uint8_t>& out, const T& data) {
  277|    236|      const std::array<uint8_t, 8> data_len = store_le(static_cast<uint64_t>(data.size()));
  278|    236|      out.insert(out.end(), data_len.begin(), data_len.end());
  279|    236|      out.insert(out.end(), data.begin(), data.end());
  280|    236|   };
x509_dn.cpp:_ZZN5Botan12_GLOBAL__N_115canonicalize_dnERKNSt3__16vectorINS2_INS1_4pairINS_3OIDENS_11ASN1_StringEEENS1_9allocatorIS6_EEEENS7_IS9_EEEEENK3$_0clINS1_12basic_stringIcNS1_11char_traitsIcEENS7_IcEEEEEEDaRNS2_IhNS7_IhEEEERKT_:
  276|    118|   auto append_canonical_data = []<typename T>(std::vector<uint8_t>& out, const T& data) {
  277|    118|      const std::array<uint8_t, 8> data_len = store_le(static_cast<uint64_t>(data.size()));
  278|    118|      out.insert(out.end(), data_len.begin(), data_len.end());
  279|    118|      out.insert(out.end(), data.begin(), data.end());
  280|    118|   };
x509_dn.cpp:_ZN5Botan12_GLOBAL__N_18is_spaceEc:
   25|    632|bool is_space(char c) {
   26|    632|   return c == ' ' || c == '\t';
  ------------------
  |  Branch (26:11): [True: 0, False: 632]
  |  Branch (26:23): [True: 0, False: 632]
  ------------------
   27|    632|}

_ZN5Botan10Extensions11decode_fromERNS_11BER_DecoderENSt3__18optionalINS_17Extension_ContextEEE:
  299|      1|void Extensions::decode_from(BER_Decoder& from_source, std::optional<Extension_Context> context) {
  300|      1|   m_extension_oids.clear();
  301|      1|   m_extension_info.clear();
  302|      1|   m_has_unknown_critical_extension = false;
  303|       |
  304|      1|   BER_Decoder sequence = from_source.start_sequence();
  305|       |
  306|      1|   while(sequence.more_items()) {
  ------------------
  |  Branch (306:10): [True: 0, False: 1]
  ------------------
  307|      0|      OID oid;
  308|      0|      bool critical = false;
  309|      0|      std::vector<uint8_t> bits;
  310|       |
  311|      0|      sequence.start_sequence()
  312|      0|         .decode(oid)
  313|      0|         .decode_optional(critical, ASN1_Type::Boolean, ASN1_Class::Universal, false)
  314|      0|         .decode(bits, ASN1_Type::OctetString)
  315|      0|         .end_cons();
  316|       |
  317|      0|      auto obj = create_extn_obj(oid, critical, bits, context);
  318|       |      // Unknown_Extension is the only Certificate_Extension with an empty oid_name
  319|      0|      if(critical && obj->oid_name().empty()) {
  ------------------
  |  Branch (319:10): [True: 0, False: 0]
  |  Branch (319:10): [True: 0, False: 0]
  |  Branch (319:22): [True: 0, False: 0]
  ------------------
  320|      0|         m_has_unknown_critical_extension = true;
  321|      0|      }
  322|      0|      Extensions_Info info(critical, bits, std::move(obj));
  323|       |
  324|       |      // RFC 5280 4.2: "A certificate MUST NOT include more than one
  325|       |      // instance of a particular extension."
  326|      0|      if(!m_extension_info.emplace(oid, info).second) {
  ------------------
  |  Branch (326:10): [True: 0, False: 0]
  ------------------
  327|      0|         throw Decoding_Error("Duplicate certificate extension encountered");
  328|      0|      }
  329|      0|      m_extension_oids.push_back(oid);
  330|      0|   }
  331|      1|   sequence.verify_end();
  332|      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|      6|void X509_Object::decode_from(BER_Decoder& from) {
   94|      6|   auto data = std::make_shared<Signed_Data>();
   95|       |
   96|      6|   from.start_sequence()
   97|      6|      .start_sequence()
   98|      6|      .raw_bytes(data->m_tbs_bits)
   99|      6|      .end_cons()
  100|      6|      .decode(data->m_sig_algo)
  101|      6|      .decode(data->m_sig, ASN1_Type::BitString)
  102|      6|      .end_cons();
  103|       |
  104|      6|   m_signed_data = std::move(data);
  105|      6|   force_decode();
  106|      6|}

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

