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

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

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

_ZN5Botan2CT8unpoisonITkNSt3__18integralEmEEvRKT_:
  112|  1.43k|constexpr void unpoison(const T& p) {
  113|  1.43k|   unpoison(&p, 1);
  114|  1.43k|}
_ZN5Botan2CT8unpoisonImEEvPKT_m:
   67|  2.78k|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.78k|   BOTAN_UNUSED(p, n);
  ------------------
  |  |  144|  2.78k|#define BOTAN_UNUSED Botan::ignore_params
  ------------------
   75|  2.78k|}

_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|    126|void do_fmt(std::ostringstream& oss, std::string_view format, const T& val, const Ts&... rest) {
   26|    126|   size_t i = 0;
   27|       |
   28|  2.97k|   while(i < format.size()) {
  ------------------
  |  Branch (28:10): [True: 2.97k, False: 0]
  ------------------
   29|  2.97k|      if(format[i] == '{' && (format.size() > (i + 1)) && format.at(i + 1) == '}') {
  ------------------
  |  Branch (29:10): [True: 126, False: 2.85k]
  |  Branch (29:30): [True: 126, False: 0]
  |  Branch (29:59): [True: 126, False: 0]
  ------------------
   30|    126|         oss << val;
   31|    126|         return do_fmt(oss, format.substr(i + 2), rest...);
   32|  2.85k|      } else {
   33|  2.85k|         oss << format[i];
   34|  2.85k|      }
   35|       |
   36|  2.85k|      i += 1;
   37|  2.85k|   }
   38|    126|}
_ZN5Botan10fmt_detail6do_fmtERNSt3__119basic_ostringstreamIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS1_17basic_string_viewIcS4_EE:
   20|  1.40k|inline void do_fmt(std::ostringstream& oss, std::string_view format) {
   21|  1.40k|   oss << format;
   22|  1.40k|}
_ZN5Botan10fmt_detail6do_fmtINSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEJEEEvRNS2_19basic_ostringstreamIcS5_NS2_9allocatorIcEEEES6_RKT_DpRKT0_:
   25|    946|void do_fmt(std::ostringstream& oss, std::string_view format, const T& val, const Ts&... rest) {
   26|    946|   size_t i = 0;
   27|       |
   28|  6.43k|   while(i < format.size()) {
  ------------------
  |  Branch (28:10): [True: 6.43k, False: 0]
  ------------------
   29|  6.43k|      if(format[i] == '{' && (format.size() > (i + 1)) && format.at(i + 1) == '}') {
  ------------------
  |  Branch (29:10): [True: 946, False: 5.48k]
  |  Branch (29:30): [True: 946, False: 0]
  |  Branch (29:59): [True: 946, False: 0]
  ------------------
   30|    946|         oss << val;
   31|    946|         return do_fmt(oss, format.substr(i + 2), rest...);
   32|  5.48k|      } else {
   33|  5.48k|         oss << format[i];
   34|  5.48k|      }
   35|       |
   36|  5.48k|      i += 1;
   37|  5.48k|   }
   38|    946|}
_ZN5Botan3fmtIJNSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEEEENS1_12basic_stringIcS4_NS1_9allocatorIcEEEES5_DpRKT_:
   53|    946|std::string fmt(std::string_view format, const T&... args) {
   54|    946|   std::ostringstream oss;
   55|    946|   oss.imbue(std::locale::classic());
   56|    946|   fmt_detail::do_fmt(oss, format, args...);
   57|    946|   return oss.str();
   58|    946|}
_ZN5Botan3fmtIJPKcEEENSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEENS3_17basic_string_viewIcS6_EEDpRKT_:
   53|    101|std::string fmt(std::string_view format, const T&... args) {
   54|    101|   std::ostringstream oss;
   55|    101|   oss.imbue(std::locale::classic());
   56|    101|   fmt_detail::do_fmt(oss, format, args...);
   57|    101|   return oss.str();
   58|    101|}
_ZN5Botan3fmtIJNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEEEES7_NS1_17basic_string_viewIcS4_EEDpRKT_:
   53|     52|std::string fmt(std::string_view format, const T&... args) {
   54|     52|   std::ostringstream oss;
   55|     52|   oss.imbue(std::locale::classic());
   56|     52|   fmt_detail::do_fmt(oss, format, args...);
   57|     52|   return oss.str();
   58|     52|}
_ZN5Botan10fmt_detail6do_fmtINSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEJEEEvRNS2_19basic_ostringstreamIcS5_S7_EENS2_17basic_string_viewIcS5_EERKT_DpRKT0_:
   25|     52|void do_fmt(std::ostringstream& oss, std::string_view format, const T& val, const Ts&... rest) {
   26|     52|   size_t i = 0;
   27|       |
   28|  1.14k|   while(i < format.size()) {
  ------------------
  |  Branch (28:10): [True: 1.14k, False: 0]
  ------------------
   29|  1.14k|      if(format[i] == '{' && (format.size() > (i + 1)) && format.at(i + 1) == '}') {
  ------------------
  |  Branch (29:10): [True: 52, False: 1.09k]
  |  Branch (29:30): [True: 52, False: 0]
  |  Branch (29:59): [True: 52, False: 0]
  ------------------
   30|     52|         oss << val;
   31|     52|         return do_fmt(oss, format.substr(i + 2), rest...);
   32|  1.09k|      } else {
   33|  1.09k|         oss << format[i];
   34|  1.09k|      }
   35|       |
   36|  1.09k|      i += 1;
   37|  1.09k|   }
   38|     52|}
_ZN5Botan10fmt_detail6do_fmtIjJEEEvRNSt3__119basic_ostringstreamIcNS2_11char_traitsIcEENS2_9allocatorIcEEEENS2_17basic_string_viewIcS5_EERKT_DpRKT0_:
   25|    279|void do_fmt(std::ostringstream& oss, std::string_view format, const T& val, const Ts&... rest) {
   26|    279|   size_t i = 0;
   27|       |
   28|    594|   while(i < format.size()) {
  ------------------
  |  Branch (28:10): [True: 594, False: 0]
  ------------------
   29|    594|      if(format[i] == '{' && (format.size() > (i + 1)) && format.at(i + 1) == '}') {
  ------------------
  |  Branch (29:10): [True: 279, False: 315]
  |  Branch (29:30): [True: 279, False: 0]
  |  Branch (29:59): [True: 279, False: 0]
  ------------------
   30|    279|         oss << val;
   31|    279|         return do_fmt(oss, format.substr(i + 2), rest...);
   32|    315|      } else {
   33|    315|         oss << format[i];
   34|    315|      }
   35|       |
   36|    315|      i += 1;
   37|    315|   }
   38|    279|}
_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|    243|std::string fmt(std::string_view format, const T&... args) {
   54|    243|   std::ostringstream oss;
   55|    243|   oss.imbue(std::locale::classic());
   56|    243|   fmt_detail::do_fmt(oss, format, args...);
   57|    243|   return oss.str();
   58|    243|}
_ZN5Botan10fmt_detail6do_fmtIjJjEEEvRNSt3__119basic_ostringstreamIcNS2_11char_traitsIcEENS2_9allocatorIcEEEENS2_17basic_string_viewIcS5_EERKT_DpRKT0_:
   25|    243|void do_fmt(std::ostringstream& oss, std::string_view format, const T& val, const Ts&... rest) {
   26|    243|   size_t i = 0;
   27|       |
   28|  7.03k|   while(i < format.size()) {
  ------------------
  |  Branch (28:10): [True: 7.03k, False: 0]
  ------------------
   29|  7.03k|      if(format[i] == '{' && (format.size() > (i + 1)) && format.at(i + 1) == '}') {
  ------------------
  |  Branch (29:10): [True: 243, False: 6.78k]
  |  Branch (29:30): [True: 243, False: 0]
  |  Branch (29:59): [True: 243, False: 0]
  ------------------
   30|    243|         oss << val;
   31|    243|         return do_fmt(oss, format.substr(i + 2), rest...);
   32|  6.78k|      } else {
   33|  6.78k|         oss << format[i];
   34|  6.78k|      }
   35|       |
   36|  6.78k|      i += 1;
   37|  6.78k|   }
   38|    243|}

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

_ZN5Botan12get_byte_varImEEhmT_:
   69|  4.14k|inline constexpr uint8_t get_byte_var(size_t byte_num, T input) {
   70|  4.14k|   return static_cast<uint8_t>(input >> (((~byte_num) & (sizeof(T) - 1)) << 3));
   71|  4.14k|}
_ZN5Botan7load_beImJNSt3__14spanIKhLm8EEEEEEDaDpOT0_:
  504|  9.46k|inline constexpr auto load_be(ParamTs&&... params) {
  505|  9.46k|   return detail::load_any<std::endian::big, OutT>(std::forward<ParamTs>(params)...);
  506|  9.46k|}
_ZN5Botan6detail8load_anyILNSt3__16endianE64206ETkNS0_20unsigned_integralishEmTkNS_6ranges16contiguous_rangeIhEENS2_4spanIKhLm8EEEQnt15custom_loadableINS0_19wrapped_type_helperIu14__remove_cvrefIT0_EE4typeEEEESA_OT1_:
  278|  9.46k|inline constexpr WrappedOutT load_any(InR&& in_range) {
  279|  9.46k|   using OutT = detail::wrapped_type<WrappedOutT>;
  280|  9.46k|   ranges::assert_exact_byte_length<sizeof(OutT)>(in_range);
  281|       |
  282|  9.46k|   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|  9.46k|      if(std::is_constant_evaluated()) /* TODO: C++23: if consteval {} */ {
  287|  9.46k|         return fallback_load_any<endianness, OutT>(std::forward<InR>(in_range));
  288|  9.46k|      } else {
  289|  9.46k|         const std::span in{in_range};
  290|  9.46k|         if constexpr(sizeof(OutT) == 1) {
  291|  9.46k|            return static_cast<OutT>(in[0]);
  292|  9.46k|         } else if constexpr(endianness == std::endian::native) {
  293|  9.46k|            return typecast_copy<OutT>(in);
  294|  9.46k|         } else {
  295|  9.46k|            static_assert(opposite(endianness) == std::endian::native);
  296|  9.46k|            return reverse_bytes(typecast_copy<OutT>(in));
  297|  9.46k|         }
  298|  9.46k|      }
  299|  9.46k|   }());
  300|  9.46k|}
_ZN5Botan6detail24wrap_strong_type_or_enumITkNS0_20unsigned_integralishEmTkNSt3__117unsigned_integralEmEEDaT0_:
  200|  10.6k|constexpr auto wrap_strong_type_or_enum(T t) {
  201|       |   if constexpr(std::is_enum_v<OutT>) {
  202|       |      return static_cast<OutT>(t);
  203|  10.6k|   } else {
  204|  10.6k|      return Botan::wrap_strong_type<OutT>(t);
  205|  10.6k|   }
  206|  10.6k|}
_ZZN5Botan6detail8load_anyILNSt3__16endianE64206ETkNS0_20unsigned_integralishEmTkNS_6ranges16contiguous_rangeIhEENS2_4spanIKhLm8EEEQnt15custom_loadableINS0_19wrapped_type_helperIu14__remove_cvrefIT0_EE4typeEEEESA_OT1_ENKUlvE_clEv:
  282|  9.46k|   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|  9.46k|      if(std::is_constant_evaluated()) /* TODO: C++23: if consteval {} */ {
  ------------------
  |  Branch (286:10): [Folded, False: 9.46k]
  ------------------
  287|      0|         return fallback_load_any<endianness, OutT>(std::forward<InR>(in_range));
  288|  9.46k|      } else {
  289|  9.46k|         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|  9.46k|         } else {
  295|  9.46k|            static_assert(opposite(endianness) == std::endian::native);
  296|  9.46k|            return reverse_bytes(typecast_copy<OutT>(in));
  297|  9.46k|         }
  298|  9.46k|      }
  299|  9.46k|   }());
_ZN5Botan7load_beImJRNSt3__15arrayIhLm8EEEEEEDaDpOT0_:
  504|  1.23k|inline constexpr auto load_be(ParamTs&&... params) {
  505|  1.23k|   return detail::load_any<std::endian::big, OutT>(std::forward<ParamTs>(params)...);
  506|  1.23k|}
_ZN5Botan6detail8load_anyILNSt3__16endianE64206ETkNS0_20unsigned_integralishEmTkNS_6ranges16contiguous_rangeIhEERNS2_5arrayIhLm8EEEQnt15custom_loadableINS0_19wrapped_type_helperIu14__remove_cvrefIT0_EE4typeEEEESA_OT1_:
  278|  1.23k|inline constexpr WrappedOutT load_any(InR&& in_range) {
  279|  1.23k|   using OutT = detail::wrapped_type<WrappedOutT>;
  280|  1.23k|   ranges::assert_exact_byte_length<sizeof(OutT)>(in_range);
  281|       |
  282|  1.23k|   return detail::wrap_strong_type_or_enum<WrappedOutT>([&]() -> OutT {
  283|       |      // At compile time we cannot use `typecast_copy` as it uses `std::memcpy`
  284|       |      // internally to copy ranges on a byte-by-byte basis, which is not allowed
  285|       |      // in a `constexpr` context.
  286|  1.23k|      if(std::is_constant_evaluated()) /* TODO: C++23: if consteval {} */ {
  287|  1.23k|         return fallback_load_any<endianness, OutT>(std::forward<InR>(in_range));
  288|  1.23k|      } else {
  289|  1.23k|         const std::span in{in_range};
  290|  1.23k|         if constexpr(sizeof(OutT) == 1) {
  291|  1.23k|            return static_cast<OutT>(in[0]);
  292|  1.23k|         } else if constexpr(endianness == std::endian::native) {
  293|  1.23k|            return typecast_copy<OutT>(in);
  294|  1.23k|         } else {
  295|  1.23k|            static_assert(opposite(endianness) == std::endian::native);
  296|  1.23k|            return reverse_bytes(typecast_copy<OutT>(in));
  297|  1.23k|         }
  298|  1.23k|      }
  299|  1.23k|   }());
  300|  1.23k|}
_ZZN5Botan6detail8load_anyILNSt3__16endianE64206ETkNS0_20unsigned_integralishEmTkNS_6ranges16contiguous_rangeIhEERNS2_5arrayIhLm8EEEQnt15custom_loadableINS0_19wrapped_type_helperIu14__remove_cvrefIT0_EE4typeEEEESA_OT1_ENKUlvE_clEv:
  282|  1.23k|   return detail::wrap_strong_type_or_enum<WrappedOutT>([&]() -> OutT {
  283|       |      // At compile time we cannot use `typecast_copy` as it uses `std::memcpy`
  284|       |      // internally to copy ranges on a byte-by-byte basis, which is not allowed
  285|       |      // in a `constexpr` context.
  286|  1.23k|      if(std::is_constant_evaluated()) /* TODO: C++23: if consteval {} */ {
  ------------------
  |  Branch (286:10): [Folded, False: 1.23k]
  ------------------
  287|      0|         return fallback_load_any<endianness, OutT>(std::forward<InR>(in_range));
  288|  1.23k|      } else {
  289|  1.23k|         const std::span in{in_range};
  290|       |         if constexpr(sizeof(OutT) == 1) {
  291|       |            return static_cast<OutT>(in[0]);
  292|       |         } else if constexpr(endianness == std::endian::native) {
  293|       |            return typecast_copy<OutT>(in);
  294|  1.23k|         } else {
  295|  1.23k|            static_assert(opposite(endianness) == std::endian::native);
  296|  1.23k|            return reverse_bytes(typecast_copy<OutT>(in));
  297|  1.23k|         }
  298|  1.23k|      }
  299|  1.23k|   }());
_ZN5Botan6detail24wrap_strong_type_or_enumITkNS0_20unsigned_integralishEjTkNSt3__117unsigned_integralEjEEDaT0_:
  200|     82|constexpr auto wrap_strong_type_or_enum(T t) {
  201|       |   if constexpr(std::is_enum_v<OutT>) {
  202|       |      return static_cast<OutT>(t);
  203|     82|   } else {
  204|     82|      return Botan::wrap_strong_type<OutT>(t);
  205|     82|   }
  206|     82|}
_ZN5Botan6detail8load_anyILNSt3__16endianE64206ETkNS0_20unsigned_integralishEjTkNS_6ranges16contiguous_rangeIhEENS2_4spanIKhLm4EEEQnt15custom_loadableINS0_19wrapped_type_helperIu14__remove_cvrefIT0_EE4typeEEEESA_OT1_:
  278|     82|inline constexpr WrappedOutT load_any(InR&& in_range) {
  279|     82|   using OutT = detail::wrapped_type<WrappedOutT>;
  280|     82|   ranges::assert_exact_byte_length<sizeof(OutT)>(in_range);
  281|       |
  282|     82|   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|     82|      if(std::is_constant_evaluated()) /* TODO: C++23: if consteval {} */ {
  287|     82|         return fallback_load_any<endianness, OutT>(std::forward<InR>(in_range));
  288|     82|      } else {
  289|     82|         const std::span in{in_range};
  290|     82|         if constexpr(sizeof(OutT) == 1) {
  291|     82|            return static_cast<OutT>(in[0]);
  292|     82|         } else if constexpr(endianness == std::endian::native) {
  293|     82|            return typecast_copy<OutT>(in);
  294|     82|         } else {
  295|     82|            static_assert(opposite(endianness) == std::endian::native);
  296|     82|            return reverse_bytes(typecast_copy<OutT>(in));
  297|     82|         }
  298|     82|      }
  299|     82|   }());
  300|     82|}
_ZZN5Botan6detail8load_anyILNSt3__16endianE64206ETkNS0_20unsigned_integralishEjTkNS_6ranges16contiguous_rangeIhEENS2_4spanIKhLm4EEEQnt15custom_loadableINS0_19wrapped_type_helperIu14__remove_cvrefIT0_EE4typeEEEESA_OT1_ENKUlvE_clEv:
  282|     82|   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|     82|      if(std::is_constant_evaluated()) /* TODO: C++23: if consteval {} */ {
  ------------------
  |  Branch (286:10): [Folded, False: 82]
  ------------------
  287|      0|         return fallback_load_any<endianness, OutT>(std::forward<InR>(in_range));
  288|     82|      } else {
  289|     82|         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|     82|         } else {
  295|     82|            static_assert(opposite(endianness) == std::endian::native);
  296|     82|            return reverse_bytes(typecast_copy<OutT>(in));
  297|     82|         }
  298|     82|      }
  299|     82|   }());
_ZN5Botan7load_beItJPKhRmEEEDaDpOT0_:
  504|     88|inline constexpr auto load_be(ParamTs&&... params) {
  505|     88|   return detail::load_any<std::endian::big, OutT>(std::forward<ParamTs>(params)...);
  506|     88|}
_ZN5Botan6detail8load_anyILNSt3__16endianE64206ETkNS0_20unsigned_integralishEtEET0_PKhm:
  454|     88|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|     88|   constexpr size_t out_size = sizeof(OutT);
  457|     88|   return load_any<endianness, OutT>(std::span<const uint8_t, out_size>(in + off * out_size, out_size));
  458|     88|}
_ZN5Botan6detail8load_anyILNSt3__16endianE64206ETkNS0_20unsigned_integralishEtTkNS_6ranges16contiguous_rangeIhEENS2_4spanIKhLm2EEEQnt15custom_loadableINS0_19wrapped_type_helperIu14__remove_cvrefIT0_EE4typeEEEESA_OT1_:
  278|     88|inline constexpr WrappedOutT load_any(InR&& in_range) {
  279|     88|   using OutT = detail::wrapped_type<WrappedOutT>;
  280|     88|   ranges::assert_exact_byte_length<sizeof(OutT)>(in_range);
  281|       |
  282|     88|   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|     88|      if(std::is_constant_evaluated()) /* TODO: C++23: if consteval {} */ {
  287|     88|         return fallback_load_any<endianness, OutT>(std::forward<InR>(in_range));
  288|     88|      } else {
  289|     88|         const std::span in{in_range};
  290|     88|         if constexpr(sizeof(OutT) == 1) {
  291|     88|            return static_cast<OutT>(in[0]);
  292|     88|         } else if constexpr(endianness == std::endian::native) {
  293|     88|            return typecast_copy<OutT>(in);
  294|     88|         } else {
  295|     88|            static_assert(opposite(endianness) == std::endian::native);
  296|     88|            return reverse_bytes(typecast_copy<OutT>(in));
  297|     88|         }
  298|     88|      }
  299|     88|   }());
  300|     88|}
_ZN5Botan6detail24wrap_strong_type_or_enumITkNS0_20unsigned_integralishEtTkNSt3__117unsigned_integralEtEEDaT0_:
  200|     88|constexpr auto wrap_strong_type_or_enum(T t) {
  201|       |   if constexpr(std::is_enum_v<OutT>) {
  202|       |      return static_cast<OutT>(t);
  203|     88|   } else {
  204|     88|      return Botan::wrap_strong_type<OutT>(t);
  205|     88|   }
  206|     88|}
_ZZN5Botan6detail8load_anyILNSt3__16endianE64206ETkNS0_20unsigned_integralishEtTkNS_6ranges16contiguous_rangeIhEENS2_4spanIKhLm2EEEQnt15custom_loadableINS0_19wrapped_type_helperIu14__remove_cvrefIT0_EE4typeEEEESA_OT1_ENKUlvE_clEv:
  282|     88|   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|     88|      if(std::is_constant_evaluated()) /* TODO: C++23: if consteval {} */ {
  ------------------
  |  Branch (286:10): [Folded, False: 88]
  ------------------
  287|      0|         return fallback_load_any<endianness, OutT>(std::forward<InR>(in_range));
  288|     88|      } else {
  289|     88|         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|     88|         } else {
  295|     88|            static_assert(opposite(endianness) == std::endian::native);
  296|     88|            return reverse_bytes(typecast_copy<OutT>(in));
  297|     88|         }
  298|     88|      }
  299|     88|   }());
_ZN5Botan7load_beIjJPKhRmEEEDaDpOT0_:
  504|     82|inline constexpr auto load_be(ParamTs&&... params) {
  505|     82|   return detail::load_any<std::endian::big, OutT>(std::forward<ParamTs>(params)...);
  506|     82|}
_ZN5Botan6detail8load_anyILNSt3__16endianE64206ETkNS0_20unsigned_integralishEjEET0_PKhm:
  454|     82|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|     82|   constexpr size_t out_size = sizeof(OutT);
  457|     82|   return load_any<endianness, OutT>(std::span<const uint8_t, out_size>(in + off * out_size, out_size));
  458|     82|}

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

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

_ZN5Botan11ASN1_ObjectD2Ev:
  122|  11.6k|      virtual ~ASN1_Object() = default;
_ZNK5Botan10BER_Object6is_setEv:
  138|  31.0k|      bool is_set() const { return m_type_tag != ASN1_Type::NoObject; }
_ZNK5Botan10BER_Object7taggingEv:
  140|  13.4k|      uint32_t tagging() const { return type_tag() | class_tag(); }
_ZNK5Botan10BER_Object8type_tagEv:
  142|  13.4k|      ASN1_Type type_tag() const { return m_type_tag; }
_ZNK5Botan10BER_Object9class_tagEv:
  144|  14.6k|      ASN1_Class class_tag() const { return m_class_tag; }
_ZNK5Botan10BER_Object4typeEv:
  146|  1.20k|      ASN1_Type type() const { return m_type_tag; }
_ZNK5Botan10BER_Object9get_classEv:
  148|    867|      ASN1_Class get_class() const { return m_class_tag; }
_ZNK5Botan10BER_Object4bitsEv:
  150|  46.9k|      const uint8_t* bits() const { return m_value.data(); }
_ZNK5Botan10BER_Object6lengthEv:
  152|   136k|      size_t length() const { return m_value.size(); }
_ZNK5Botan10BER_Object4dataEv:
  154|  3.53k|      std::span<const uint8_t> data() const { return std::span{m_value}; }
_ZN5Botan10BER_Object12mutable_bitsEm:
  171|  11.5k|      uint8_t* mutable_bits(size_t length) {
  172|  11.5k|         m_value.resize(length);
  173|  11.5k|         return m_value.data();
  174|  11.5k|      }
_ZNK5Botan3OIDeqERKS0_:
  301|    861|      bool operator==(const OID& other) const { return m_id == other.m_id; }
_ZN5BotanorENS_10ASN1_ClassES0_:
   78|  8.19k|inline ASN1_Class operator|(ASN1_Class x, ASN1_Class y) {
   79|  8.19k|   return static_cast<ASN1_Class>(static_cast<uint32_t>(x) | static_cast<uint32_t>(y));
   80|  8.19k|}
_ZN5BotanorENS_9ASN1_TypeENS_10ASN1_ClassE:
   82|  13.4k|inline uint32_t operator|(ASN1_Type x, ASN1_Class y) {
   83|  13.4k|   return static_cast<uint32_t>(x) | static_cast<uint32_t>(y);
   84|  13.4k|}
_ZN5BotanorENS_10ASN1_ClassENS_9ASN1_TypeE:
   86|  1.84k|inline uint32_t operator|(ASN1_Class x, ASN1_Type y) {
   87|  1.84k|   return static_cast<uint32_t>(x) | static_cast<uint32_t>(y);
   88|  1.84k|}
_ZN5BotanneERKNS_3OIDES2_:
  342|    861|inline bool operator!=(const OID& a, const OID& b) {
  343|    861|   return !(a == b);
  344|    861|}
_ZN5Botan11ASN1_ObjectC2Ev:
  117|  11.0k|      ASN1_Object() = default;
_ZN5Botan19AlgorithmIdentifierC2Ev:
  399|  1.79k|      AlgorithmIdentifier() = default;
_ZN5Botan3OIDC2Ev:
  220|  3.05k|      explicit OID() = default;
_ZN5Botan10BER_ObjectC2Ev:
  130|  23.2k|      BER_Object() = default;
_ZN5Botan10BER_ObjectaSEOS0_:
  135|  2.77k|      BER_Object& operator=(BER_Object&& other) = default;
_ZN5Botan11ASN1_ObjectC2ERKS0_:
  118|    228|      ASN1_Object(const ASN1_Object&) = default;
_ZN5Botan11ASN1_ObjectC2EOS0_:
  120|    369|      ASN1_Object(ASN1_Object&&) = default;
_ZN5Botan11ASN1_ObjectaSERKS0_:
  119|    301|      ASN1_Object& operator=(const ASN1_Object&) = default;
_ZN5Botan10BER_ObjectaSERKS0_:
  134|    570|      BER_Object& operator=(const BER_Object& other) = default;
_ZN5Botan10BER_ObjectC2EOS0_:
  133|  6.95k|      BER_Object(BER_Object&& other) = default;

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

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

_ZN5Botan11BER_Decoder14start_sequenceEv:
  160|  5.26k|      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|    356|            BER_Decoder(obj.data(), limits) {}
_ZN5Botan11BER_Decoder22start_context_specificEj:
  164|    945|      BER_Decoder start_context_specific(uint32_t tag) {
  165|    945|         return start_cons(ASN1_Type(tag), ASN1_Class::ContextSpecific);
  166|    945|      }
_ZN5Botan11BER_Decoder21get_next_octet_stringEv:
  232|    621|      std::vector<uint8_t> get_next_octet_string() {
  233|    621|         std::vector<uint8_t> out_vec;
  234|    621|         decode(out_vec, ASN1_Type::OctetString);
  235|    621|         return out_vec;
  236|    621|      }
_ZN5Botan11BER_Decoder6decodeINSt3__19allocatorIhEEEERS0_RNS2_6vectorIhT_EENS_9ASN1_TypeE:
  242|  1.22k|      BER_Decoder& decode(std::vector<uint8_t, Alloc>& out, ASN1_Type real_type) {
  243|  1.22k|         return decode(out, real_type, real_type, ASN1_Class::Universal);
  244|  1.22k|      }
_ZN5Botan11BER_Decoder16decode_and_checkINS_3OIDEEERS0_RKT_NSt3__117basic_string_viewIcNS7_11char_traitsIcEEEE:
  327|    922|      BER_Decoder& decode_and_check(const T& expected, std::string_view error_msg) {
  328|    922|         T actual;
  329|    922|         decode(actual);
  330|       |
  331|    922|         if(actual != expected) {
  ------------------
  |  Branch (331:13): [True: 240, False: 682]
  ------------------
  332|    240|            throw Decoding_Error(error_msg);
  333|    240|         }
  334|       |
  335|    682|         return (*this);
  336|    922|      }
_ZN5Botan11BER_Decoder9raw_bytesINSt3__19allocatorIhEEEERS0_RNS2_6vectorIhT_EE:
  203|  1.55k|      BER_Decoder& raw_bytes(std::vector<uint8_t, Alloc>& out) {
  204|  1.55k|         out.clear();
  205|  16.5k|         for(;;) {
  206|  16.5k|            if(auto next = this->read_next_byte()) {
  ------------------
  |  Branch (206:21): [True: 15.0k, False: 1.55k]
  ------------------
  207|  15.0k|               out.push_back(*next);
  208|  15.0k|            } else {
  209|  1.55k|               break;
  210|  1.55k|            }
  211|  16.5k|         }
  212|  1.55k|         return (*this);
  213|  1.55k|      }
_ZN5Botan11BER_Decoder15decode_optionalImEERS0_RT_NS_9ASN1_TypeENS_10ASN1_ClassERKS3_:
  285|    526|      BER_Decoder& decode_optional(T& out, ASN1_Type type_tag, ASN1_Class class_tag, const T& default_value = T()) {
  286|    526|         std::optional<T> optval;
  287|    526|         this->decode_optional(optval, type_tag, class_tag);
  288|    526|         out = optval ? *optval : default_value;
  ------------------
  |  Branch (288:16): [True: 3, False: 523]
  ------------------
  289|    526|         return (*this);
  290|    526|      }
_ZN5Botan11BER_Decoder15decode_optionalImEERS0_RNSt3__18optionalIT_EENS_9ASN1_TypeENS_10ASN1_ClassE:
  394|    526|BER_Decoder& BER_Decoder::decode_optional(std::optional<T>& optval, ASN1_Type type_tag, ASN1_Class class_tag) {
  395|    526|   BER_Object obj = get_next_object();
  396|       |
  397|    526|   if(obj.is_a(type_tag, class_tag)) {
  ------------------
  |  Branch (397:7): [True: 5, False: 521]
  ------------------
  398|      5|      T out{};
  399|      5|      if(class_tag == ASN1_Class::ExplicitContextSpecific) {
  ------------------
  |  Branch (399:10): [True: 5, False: 0]
  ------------------
  400|      5|         BER_Decoder(obj, m_limits).decode(out).verify_end();
  401|      5|      } else {
  402|      0|         this->push_back(std::move(obj));
  403|      0|         this->decode(out, type_tag, class_tag);
  404|      0|      }
  405|      5|      optval = std::move(out);
  406|    521|   } else {
  407|    521|      this->push_back(std::move(obj));
  408|    521|      optval = std::nullopt;
  409|    521|   }
  410|       |
  411|    526|   return (*this);
  412|    526|}
_ZN5Botan11BER_Decoder6decodeERm:
  225|      5|      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|    522|      BER_Decoder& decode_optional(T& out, ASN1_Type type_tag, ASN1_Class class_tag, const T& default_value = T()) {
  286|    522|         std::optional<T> optval;
  287|    522|         this->decode_optional(optval, type_tag, class_tag);
  288|    522|         out = optval ? *optval : default_value;
  ------------------
  |  Branch (288:16): [True: 117, False: 405]
  ------------------
  289|    522|         return (*this);
  290|    522|      }
_ZN5Botan11BER_Decoder15decode_optionalINS_7X509_DNEEERS0_RNSt3__18optionalIT_EENS_9ASN1_TypeENS_10ASN1_ClassE:
  394|    522|BER_Decoder& BER_Decoder::decode_optional(std::optional<T>& optval, ASN1_Type type_tag, ASN1_Class class_tag) {
  395|    522|   BER_Object obj = get_next_object();
  396|       |
  397|    522|   if(obj.is_a(type_tag, class_tag)) {
  ------------------
  |  Branch (397:7): [True: 338, False: 184]
  ------------------
  398|    338|      T out{};
  399|    338|      if(class_tag == ASN1_Class::ExplicitContextSpecific) {
  ------------------
  |  Branch (399:10): [True: 338, False: 0]
  ------------------
  400|    338|         BER_Decoder(obj, m_limits).decode(out).verify_end();
  401|    338|      } else {
  402|      0|         this->push_back(std::move(obj));
  403|      0|         this->decode(out, type_tag, class_tag);
  404|      0|      }
  405|    338|      optval = std::move(out);
  406|    338|   } else {
  407|    184|      this->push_back(std::move(obj));
  408|    184|      optval = std::nullopt;
  409|    184|   }
  410|       |
  411|    522|   return (*this);
  412|    522|}
_ZN5Botan11BER_Decoder22decode_optional_stringINSt3__19allocatorIhEEEERS0_RNS2_6vectorIhT_EENS_9ASN1_TypeEjNS_10ASN1_ClassE:
  345|    301|                                          ASN1_Class class_tag = ASN1_Class::ContextSpecific) {
  346|    301|         BER_Object obj = get_next_object();
  347|       |
  348|    301|         const ASN1_Type type_tag = static_cast<ASN1_Type>(expected_tag);
  349|       |
  350|    301|         if(obj.is_a(type_tag, class_tag)) {
  ------------------
  |  Branch (350:13): [True: 3, False: 298]
  ------------------
  351|      3|            if(class_tag == ASN1_Class::ExplicitContextSpecific) {
  ------------------
  |  Branch (351:16): [True: 3, False: 0]
  ------------------
  352|      3|               BER_Decoder(obj, m_limits).decode(out, real_type).verify_end();
  353|      3|            } else {
  354|      0|               push_back(std::move(obj));
  355|      0|               decode(out, real_type, type_tag, class_tag);
  356|      0|            }
  357|    298|         } else {
  358|    298|            out.clear();
  359|    298|            push_back(std::move(obj));
  360|    298|         }
  361|       |
  362|    301|         return (*this);
  363|    301|      }
_ZN5Botan11BER_Decoder11decode_listINS_4OCSP14SingleResponseEEERS0_RNSt3__16vectorIT_NS5_9allocatorIS7_EEEENS_9ASN1_TypeENS_10ASN1_ClassE:
  443|     22|BER_Decoder& BER_Decoder::decode_list(std::vector<T>& vec, ASN1_Type type_tag, ASN1_Class class_tag) {
  444|     22|   BER_Decoder list = start_cons(type_tag, class_tag);
  445|       |
  446|     24|   while(list.more_items()) {
  ------------------
  |  Branch (446:10): [True: 2, False: 22]
  ------------------
  447|      2|      T value;
  448|      2|      list.decode(value);
  449|      2|      vec.push_back(std::move(value));
  450|      2|   }
  451|       |
  452|     22|   list.end_cons();
  453|       |
  454|     22|   return (*this);
  455|     22|}
_ZNK5Botan11BER_Decoder6Limits18allow_ber_encodingEv:
   44|  26.2k|            bool allow_ber_encoding() const { return m_allow_ber; }
_ZNK5Botan11BER_Decoder6Limits20require_der_encodingEv:
   46|  14.3k|            bool require_der_encoding() const { return !allow_ber_encoding(); }
_ZNK5Botan11BER_Decoder6limitsEv:
   98|  6.40k|      Limits limits() const { return m_limits; }
_ZN5Botan11BER_Decoder9start_setEv:
  162|    335|      BER_Decoder start_set() { return start_cons(ASN1_Type::Set, ASN1_Class::Universal); }

_ZN5Botan6BigIntD2Ev:
  185|  1.35k|      ~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: 950, False: 293]
  ------------------
  469|    950|            return 0;
  470|    950|         }
  471|    293|         return (sign() == Negative) ? -1 : 1;
  ------------------
  |  Branch (471:17): [True: 104, False: 189]
  ------------------
  472|  1.24k|      }
_ZNK5Botan6BigInt7is_zeroEv:
  484|    104|      bool is_zero() const { return sig_words() == 0; }
_ZNK5Botan6BigInt7word_atEm:
  574|  4.33k|      word word_at(size_t n) const { return m_data.get_word_at(n); }
_ZNK5Botan6BigInt4signEv:
  604|    397|      Sign sign() const { return (m_signedness); }
_ZNK5Botan6BigInt12reverse_signEv:
  609|    104|      Sign reverse_sign() const {
  610|    104|         if(sign() == Positive) {
  ------------------
  |  Branch (610:13): [True: 104, False: 0]
  ------------------
  611|    104|            return Negative;
  612|    104|         }
  613|      0|         return Positive;
  614|    104|      }
_ZN5Botan6BigInt9flip_signEv:
  619|    104|      BOTAN_DEPRECATED("Deprecated no replacement") void flip_sign() { set_sign(reverse_sign()); }
_ZN5Botan6BigInt8set_signENS0_4SignE:
  625|    104|      void set_sign(Sign sign) {
  626|    104|         if(sign == Negative && is_zero()) {
  ------------------
  |  Branch (626:13): [True: 104, False: 0]
  |  Branch (626:33): [True: 0, False: 104]
  ------------------
  627|      0|            sign = Positive;
  628|      0|         }
  629|       |
  630|    104|         m_signedness = sign;
  631|    104|      }
_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.35k|            const word* const_data() const { return m_reg.data(); }
_ZNK5Botan6BigInt4Data11get_word_atEm:
 1038|  4.33k|            word get_word_at(size_t n) const {
 1039|  4.33k|               if(n < m_reg.size()) {
  ------------------
  |  Branch (1039:19): [True: 4.33k, False: 0]
  ------------------
 1040|  4.33k|                  return m_reg[n];
 1041|  4.33k|               }
 1042|      0|               return 0;
 1043|  4.33k|            }
_ZNK5Botan6BigInt4Data4sizeEv:
 1075|  1.35k|            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.43k]
  ------------------
 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.35k|      BigInt() = default;

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

_ZNK5Botan9Exception4whatEv:
   94|    101|      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|  9.46k|inline constexpr ToT typecast_copy(const FromR& src) {
  211|  9.46k|   ToT dst;  // NOLINT(*-member-init)
  212|  9.46k|   typecast_copy(dst, src);
  213|  9.46k|   return dst;
  214|  9.46k|}
_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|  9.46k|inline constexpr void typecast_copy(ToT& out, const FromR& in) {
  189|  9.46k|   typecast_copy(std::span<ToT, 1>(&out, 1), in);
  190|  9.46k|}
_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|  9.46k|inline constexpr void typecast_copy(ToR&& out /* NOLINT(*-std-forward) */, const FromR& in) {
  177|  9.46k|   ranges::assert_equal_byte_lengths(out, in);
  178|  9.46k|   std::memcpy(std::ranges::data(out), std::ranges::data(in), ranges::size_bytes(out));
  179|  9.46k|}
_ZN5Botan8copy_memITkNS_6ranges23contiguous_output_rangeENSt3__14spanIhLm18446744073709551615EEETkNS1_16contiguous_rangeENS3_IKhLm18446744073709551615EEEQaasr3stdE9is_same_vINS2_11conditionalIXsr21__is_primary_templateINS2_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS2_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS2_26indirectly_readable_traitsISE_EESF_E4type10value_typeENS7_IXsr21__is_primary_templateINS8_Iu14__remove_cvrefIDTclL_ZNSA_5beginEEclsr3stdE7declvalIRT0_EEEEEEEEE5valueENSG_ISO_EESP_E4type10value_typeEEsr3stdE23is_trivially_copyable_vIST_EEEvOSB_RKSL_:
  160|  1.23k|inline constexpr void copy_mem(OutR&& out /* NOLINT(*-std-forward) */, const InR& in) {
  161|  1.23k|   ranges::assert_equal_byte_lengths(out, in);
  162|  1.23k|   if(std::is_constant_evaluated()) {
  ------------------
  |  Branch (162:7): [Folded, False: 1.23k]
  ------------------
  163|      0|      std::copy(std::ranges::begin(in), std::ranges::end(in), std::ranges::begin(out));
  164|  1.23k|   } else if(ranges::size_bytes(out) > 0) {
  ------------------
  |  Branch (164:14): [True: 1.23k, False: 0]
  ------------------
  165|  1.23k|      std::memmove(std::ranges::data(out), std::ranges::data(in), ranges::size_bytes(out));
  166|  1.23k|   }
  167|  1.23k|}
_ZN5Botan13typecast_copyImTkNS_6ranges16contiguous_rangeENSt3__14spanIhLm8EEEQaaaasr3stdE26is_default_constructible_vIT_Esr3stdE23is_trivially_copyable_vIS5_Esr3stdE23is_trivially_copyable_vINS2_11conditionalIXsr21__is_primary_templateINS2_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS2_6ranges5__cpo5beginEEclsr3stdE7declvalIRT0_EEEEEEEEE5valueENS2_26indirectly_readable_traitsISD_EESE_E4type10value_typeEEEES5_RKSA_:
  210|  1.23k|inline constexpr ToT typecast_copy(const FromR& src) {
  211|  1.23k|   ToT dst;  // NOLINT(*-member-init)
  212|  1.23k|   typecast_copy(dst, src);
  213|  1.23k|   return dst;
  214|  1.23k|}
_ZN5Botan13typecast_copyImTkNS_6ranges16contiguous_rangeENSt3__14spanIhLm8EEEQaaaasr3stdE23is_trivially_copyable_vINS2_11conditionalIXsr21__is_primary_templateINS2_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS2_6ranges5__cpo5beginEEclsr3stdE7declvalIRT0_EEEEEEEEE5valueENS2_26indirectly_readable_traitsISC_EESD_E4type10value_typeEEsr3stdE23is_trivially_copyable_vIT_Entsr3std6rangesE5rangeISJ_EEEvRSJ_RKS9_:
  188|  1.23k|inline constexpr void typecast_copy(ToT& out, const FromR& in) {
  189|  1.23k|   typecast_copy(std::span<ToT, 1>(&out, 1), in);
  190|  1.23k|}
_ZN5Botan13typecast_copyITkNS_6ranges23contiguous_output_rangeENSt3__14spanImLm1EEETkNS1_16contiguous_rangeENS3_IhLm8EEEQaasr3stdE23is_trivially_copyable_vINS2_11conditionalIXsr21__is_primary_templateINS2_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS2_6ranges5__cpo5beginEEclsr3stdE7declvalIRT0_EEEEEEEEE5valueENS2_26indirectly_readable_traitsISD_EESE_E4type10value_typeEEsr3stdE23is_trivially_copyable_vINS6_IXsr21__is_primary_templateINS7_Iu14__remove_cvrefIDTclL_ZNS9_5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENSF_ISN_EESO_E4type10value_typeEEEEvOSK_RKSA_:
  176|  1.23k|inline constexpr void typecast_copy(ToR&& out /* NOLINT(*-std-forward) */, const FromR& in) {
  177|  1.23k|   ranges::assert_equal_byte_lengths(out, in);
  178|  1.23k|   std::memcpy(std::ranges::data(out), std::ranges::data(in), ranges::size_bytes(out));
  179|  1.23k|}
_ZN5Botan19secure_scrub_memoryITkNS_6ranges23contiguous_output_rangeERNSt3__16vectorIhNS2_9allocatorIhEEEEEEvOT_:
   59|  30.2k|void secure_scrub_memory(ranges::contiguous_output_range auto&& data) {
   60|  30.2k|   secure_scrub_memory(std::ranges::data(data), ranges::size_bytes(data));
   61|  30.2k|}
_ZN5Botan8copy_memIhQsr3stdE12is_trivial_vIu7__decayIT_EEEEvPS1_PKS1_m:
  144|  54.8k|inline constexpr void copy_mem(T* out, const T* in, size_t n) {
  145|  54.8k|   BOTAN_ASSERT_IMPLICATION(n > 0, in != nullptr && out != nullptr, "If n > 0 then args are not null");
  ------------------
  |  |  103|  54.8k|   do {                                                                                          \
  |  |  104|  54.8k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                                              \
  |  |  105|   103k|      if((expr1) && !(expr2)) {                                                                  \
  |  |  ------------------
  |  |  |  Branch (105:10): [True: 51.9k, False: 2.88k]
  |  |  |  Branch (105:23): [True: 51.9k, False: 0]
  |  |  |  Branch (105:23): [True: 51.9k, False: 0]
  |  |  ------------------
  |  |  106|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                                     \
  |  |  107|      0|         Botan::assertion_failure(#expr1 " implies " #expr2, msg, __func__, __FILE__, __LINE__); \
  |  |  108|      0|      }                                                                                          \
  |  |  109|  54.8k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (109:12): [Folded, False: 54.8k]
  |  |  ------------------
  ------------------
  146|       |
  147|  54.8k|   if(in != nullptr && out != nullptr && n > 0) {
  ------------------
  |  Branch (147:7): [True: 54.7k, False: 55]
  |  Branch (147:24): [True: 54.3k, False: 425]
  |  Branch (147:42): [True: 51.9k, False: 2.40k]
  ------------------
  148|  51.9k|      std::memmove(out, in, sizeof(T) * n);
  149|  51.9k|   }
  150|  54.8k|}
_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|     82|inline constexpr void typecast_copy(ToR&& out /* NOLINT(*-std-forward) */, const FromR& in) {
  177|     82|   ranges::assert_equal_byte_lengths(out, in);
  178|     82|   std::memcpy(std::ranges::data(out), std::ranges::data(in), ranges::size_bytes(out));
  179|     82|}
_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|     82|inline constexpr void typecast_copy(ToT& out, const FromR& in) {
  189|     82|   typecast_copy(std::span<ToT, 1>(&out, 1), in);
  190|     82|}
_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|     82|inline constexpr ToT typecast_copy(const FromR& src) {
  211|     82|   ToT dst;  // NOLINT(*-member-init)
  212|     82|   typecast_copy(dst, src);
  213|     82|   return dst;
  214|     82|}
_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|     88|inline constexpr ToT typecast_copy(const FromR& src) {
  211|     88|   ToT dst;  // NOLINT(*-member-init)
  212|     88|   typecast_copy(dst, src);
  213|     88|   return dst;
  214|     88|}
_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|     88|inline constexpr void typecast_copy(ToT& out, const FromR& in) {
  189|     88|   typecast_copy(std::span<ToT, 1>(&out, 1), in);
  190|     88|}
_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|     88|inline constexpr void typecast_copy(ToR&& out /* NOLINT(*-std-forward) */, const FromR& in) {
  177|     88|   ranges::assert_equal_byte_lengths(out, in);
  178|     88|   std::memcpy(std::ranges::data(out), std::ranges::data(in), ranges::size_bytes(out));
  179|     88|}

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

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

_ZNK5Botan7X509_DN5emptyEv:
   91|     16|      bool empty() const { return m_rdn.empty(); }
_ZN5Botan10ExtensionsC2Ev:
  861|    528|      Extensions() = default;
_ZN5Botan10ExtensionsD2Ev:
  869|    528|      ~Extensions() override = default;
_ZN5Botan7X509_DNC2Ev:
   48|  2.65k|      X509_DN() = default;
_ZN5Botan15NameConstraintsC2Ev:
  608|      1|      NameConstraints() = default;
_ZN5Botan15AlternativeNameC2Ev:
  201|      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|  18.9k|inline constexpr void assert_exact_byte_length(const R& r) {
   78|  18.9k|   const std::span s{r};
   79|  18.9k|   if constexpr(statically_spanable_range<R>) {
   80|  18.9k|      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|  18.9k|}
_ZN5Botan6ranges25assert_equal_byte_lengthsITkNS0_14spanable_rangeENSt3__14spanImLm1EEETpTkNS0_14spanable_rangeEJNS3_IKhLm8EEEEEEvRKT_DpRKT0_QgtsZT0_Li0E:
  100|  9.46k|{
  101|  9.46k|   const std::span s0{r0};
  102|       |
  103|  9.46k|   if constexpr(statically_spanable_range<R0>) {
  104|  9.46k|      constexpr size_t expected_size = s0.size_bytes();
  105|  9.46k|      (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|  9.46k|}
_ZN5Botan6ranges10size_bytesITkNS0_14spanable_rangeENSt3__14spanImLm1EEEEEmRKT_:
   59|  10.6k|inline constexpr size_t size_bytes(const spanable_range auto& r) {
   60|  10.6k|   return std::span{r}.size_bytes();
   61|  10.6k|}
_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|}
_ZN5Botan6ranges10size_bytesITkNS0_14spanable_rangeENSt3__16vectorIhNS2_9allocatorIhEEEEEEmRKT_:
   59|  30.2k|inline constexpr size_t size_bytes(const spanable_range auto& r) {
   60|  30.2k|   return std::span{r}.size_bytes();
   61|  30.2k|}
_ZN5Botan6ranges24assert_exact_byte_lengthILm4ETkNS0_14spanable_rangeENSt3__14spanIKhLm4EEEEEvRKT0_:
   77|    164|inline constexpr void assert_exact_byte_length(const R& r) {
   78|    164|   const std::span s{r};
   79|    164|   if constexpr(statically_spanable_range<R>) {
   80|    164|      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|    164|}
_ZN5Botan6ranges25assert_equal_byte_lengthsITkNS0_14spanable_rangeENSt3__14spanIjLm1EEETpTkNS0_14spanable_rangeEJNS3_IKhLm4EEEEEEvRKT_DpRKT0_QgtsZT0_Li0E:
  100|     82|{
  101|     82|   const std::span s0{r0};
  102|       |
  103|     82|   if constexpr(statically_spanable_range<R0>) {
  104|     82|      constexpr size_t expected_size = s0.size_bytes();
  105|     82|      (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|     82|}
_ZN5Botan6ranges10size_bytesITkNS0_14spanable_rangeENSt3__14spanIjLm1EEEEEmRKT_:
   59|     82|inline constexpr size_t size_bytes(const spanable_range auto& r) {
   60|     82|   return std::span{r}.size_bytes();
   61|     82|}
_ZN5Botan6ranges24assert_exact_byte_lengthILm2ETkNS0_14spanable_rangeENSt3__14spanIKhLm2EEEEEvRKT0_:
   77|    176|inline constexpr void assert_exact_byte_length(const R& r) {
   78|    176|   const std::span s{r};
   79|    176|   if constexpr(statically_spanable_range<R>) {
   80|    176|      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|    176|}
_ZN5Botan6ranges25assert_equal_byte_lengthsITkNS0_14spanable_rangeENSt3__14spanItLm1EEETpTkNS0_14spanable_rangeEJNS3_IKhLm2EEEEEEvRKT_DpRKT0_QgtsZT0_Li0E:
  100|     88|{
  101|     88|   const std::span s0{r0};
  102|       |
  103|     88|   if constexpr(statically_spanable_range<R0>) {
  104|     88|      constexpr size_t expected_size = s0.size_bytes();
  105|     88|      (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|     88|}
_ZN5Botan6ranges10size_bytesITkNS0_14spanable_rangeENSt3__14spanItLm1EEEEEmRKT_:
   59|     88|inline constexpr size_t size_bytes(const spanable_range auto& r) {
   60|     88|   return std::span{r}.size_bytes();
   61|     88|}

_ZN5Botan16secure_allocatorImE10deallocateEPmm:
   54|  1.24k|      void deallocate(T* p, std::size_t n) { deallocate_memory(p, n, sizeof(T)); }
_ZN5Botan16secure_allocatorIhE10deallocateEPhm:
   54|  3.72k|      void deallocate(T* p, std::size_t n) { deallocate_memory(p, n, sizeof(T)); }
_ZN5Botan16secure_allocatorIhE8allocateEm:
   52|  3.72k|      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|  10.6k|[[nodiscard]] constexpr decltype(auto) wrap_strong_type(ParamT&& t) {
  269|  10.6k|   if constexpr(std::same_as<std::remove_cvref_t<ParamT>, T>) {
  270|       |      // Noop, if the parameter type already is the desired return type.
  271|  10.6k|      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|  10.6k|}
_ZN5Botan16wrap_strong_typeIjRjQoosr3stdE18constructible_fromIT_T0_Eaasr8conceptsE11strong_typeIS2_Esr3stdE18constructible_fromINS2_12wrapped_typeES3_EEEDcOS3_:
  268|     82|[[nodiscard]] constexpr decltype(auto) wrap_strong_type(ParamT&& t) {
  269|     82|   if constexpr(std::same_as<std::remove_cvref_t<ParamT>, T>) {
  270|       |      // Noop, if the parameter type already is the desired return type.
  271|     82|      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|     82|}
_ZN5Botan16wrap_strong_typeItRtQoosr3stdE18constructible_fromIT_T0_Eaasr8conceptsE11strong_typeIS2_Esr3stdE18constructible_fromINS2_12wrapped_typeES3_EEEDcOS3_:
  268|     88|[[nodiscard]] constexpr decltype(auto) wrap_strong_type(ParamT&& t) {
  269|     88|   if constexpr(std::same_as<std::remove_cvref_t<ParamT>, T>) {
  270|       |      // Noop, if the parameter type already is the desired return type.
  271|     88|      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|     88|}

_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.79k|extern "C" int LLVMFuzzerTestOneInput(const uint8_t in[], size_t len) {
   40|  1.79k|   if(len <= max_fuzzer_input_size) {
  ------------------
  |  Branch (40:7): [True: 1.78k, False: 9]
  ------------------
   41|  1.78k|      try {
   42|  1.78k|         fuzz(std::span<const uint8_t>(in, len));
   43|  1.78k|      } 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.78k|   }
   51|  1.79k|   return 0;
   52|  1.79k|}

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

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

_ZN5Botan10BER_ObjectD2Ev:
   27|  30.2k|BER_Object::~BER_Object() {
   28|  30.2k|   secure_scrub_memory(m_value);
   29|  30.2k|}
_ZNK5Botan10BER_Object11assert_is_aENS_9ASN1_TypeENS_10ASN1_ClassENSt3__117basic_string_viewIcNS3_11char_traitsIcEEEE:
   34|  8.77k|void BER_Object::assert_is_a(ASN1_Type expected_type_tag, ASN1_Class expected_class_tag, std::string_view descr) const {
   35|  8.77k|   if(!this->is_a(expected_type_tag, expected_class_tag)) {
  ------------------
  |  Branch (35:7): [True: 231, False: 8.54k]
  ------------------
   36|    231|      std::stringstream msg;
   37|       |
   38|    231|      msg << "Tag mismatch when decoding " << descr << " got ";
   39|       |
   40|    231|      if(m_class_tag == ASN1_Class::NoObject && m_type_tag == ASN1_Type::NoObject) {
  ------------------
  |  Branch (40:10): [True: 16, False: 215]
  |  Branch (40:49): [True: 16, False: 0]
  ------------------
   41|     16|         msg << "EOF";
   42|    215|      } else {
   43|    215|         if(m_class_tag == ASN1_Class::Universal || m_class_tag == ASN1_Class::Constructed) {
  ------------------
  |  Branch (43:13): [True: 41, False: 174]
  |  Branch (43:53): [True: 130, False: 44]
  ------------------
   44|    171|            msg << asn1_tag_to_string(m_type_tag);
   45|    171|         } else {
   46|     44|            msg << std::to_string(static_cast<uint32_t>(m_type_tag));
   47|     44|         }
   48|       |
   49|    215|         msg << "/" << asn1_class_to_string(m_class_tag);
   50|    215|      }
   51|       |
   52|    231|      msg << " expected ";
   53|       |
   54|    231|      if(expected_class_tag == ASN1_Class::Universal || expected_class_tag == ASN1_Class::Constructed) {
  ------------------
  |  Branch (54:10): [True: 27, False: 204]
  |  Branch (54:57): [True: 198, False: 6]
  ------------------
   55|    225|         msg << asn1_tag_to_string(expected_type_tag);
   56|    225|      } else {
   57|      6|         msg << std::to_string(static_cast<uint32_t>(expected_type_tag));
   58|      6|      }
   59|       |
   60|    231|      msg << "/" << asn1_class_to_string(expected_class_tag);
   61|       |
   62|    231|      throw BER_Decoding_Error(msg.str());
   63|    231|   }
   64|  8.77k|}
_ZNK5Botan10BER_Object4is_aENS_9ASN1_TypeENS_10ASN1_ClassE:
   66|  10.7k|bool BER_Object::is_a(ASN1_Type expected_type_tag, ASN1_Class expected_class_tag) const {
   67|  10.7k|   return (m_type_tag == expected_type_tag && m_class_tag == expected_class_tag);
  ------------------
  |  Branch (67:12): [True: 8.91k, False: 1.78k]
  |  Branch (67:47): [True: 8.90k, False: 17]
  ------------------
   68|  10.7k|}
_ZNK5Botan10BER_Object4is_aEiNS_10ASN1_ClassE:
   70|      1|bool BER_Object::is_a(int expected_type_tag, ASN1_Class expected_class_tag) const {
   71|      1|   return is_a(ASN1_Type(expected_type_tag), expected_class_tag);
   72|      1|}
_ZN5Botan10BER_Object11set_taggingENS_9ASN1_TypeENS_10ASN1_ClassE:
   74|  12.6k|void BER_Object::set_tagging(ASN1_Type type_tag, ASN1_Class class_tag) {
   75|  12.6k|   m_type_tag = type_tag;
   76|  12.6k|   m_class_tag = class_tag;
   77|  12.6k|}
_ZN5Botan20asn1_class_to_stringENS_10ASN1_ClassE:
   79|    446|std::string asn1_class_to_string(ASN1_Class type) {
   80|    446|   switch(type) {
   81|     68|      case ASN1_Class::Universal:
  ------------------
  |  Branch (81:7): [True: 68, False: 378]
  ------------------
   82|     68|         return "UNIVERSAL";
   83|    328|      case ASN1_Class::Constructed:
  ------------------
  |  Branch (83:7): [True: 328, False: 118]
  ------------------
   84|    328|         return "CONSTRUCTED";
   85|      3|      case ASN1_Class::ContextSpecific:
  ------------------
  |  Branch (85:7): [True: 3, False: 443]
  ------------------
   86|      3|         return "CONTEXT_SPECIFIC";
   87|      5|      case ASN1_Class::Application:
  ------------------
  |  Branch (87:7): [True: 5, False: 441]
  ------------------
   88|      5|         return "APPLICATION";
   89|      6|      case ASN1_Class::Private:
  ------------------
  |  Branch (89:7): [True: 6, False: 440]
  ------------------
   90|      6|         return "PRIVATE";
   91|      0|      case ASN1_Class::NoObject:
  ------------------
  |  Branch (91:7): [True: 0, False: 446]
  ------------------
   92|      0|         return "NO_OBJECT";
   93|     36|      default:
  ------------------
  |  Branch (93:7): [True: 36, False: 410]
  ------------------
   94|     36|         return "CLASS(" + std::to_string(static_cast<size_t>(type)) + ")";
   95|    446|   }
   96|    446|}
_ZN5Botan18asn1_tag_to_stringENS_9ASN1_TypeE:
   98|    448|std::string asn1_tag_to_string(ASN1_Type type) {
   99|    448|   switch(type) {
  100|    201|      case ASN1_Type::Sequence:
  ------------------
  |  Branch (100:7): [True: 201, False: 247]
  ------------------
  101|    201|         return "SEQUENCE";
  102|       |
  103|      7|      case ASN1_Type::Set:
  ------------------
  |  Branch (103:7): [True: 7, False: 441]
  ------------------
  104|      7|         return "SET";
  105|       |
  106|      5|      case ASN1_Type::PrintableString:
  ------------------
  |  Branch (106:7): [True: 5, False: 443]
  ------------------
  107|      5|         return "PRINTABLE STRING";
  108|       |
  109|      2|      case ASN1_Type::NumericString:
  ------------------
  |  Branch (109:7): [True: 2, False: 446]
  ------------------
  110|      2|         return "NUMERIC STRING";
  111|       |
  112|      3|      case ASN1_Type::Ia5String:
  ------------------
  |  Branch (112:7): [True: 3, False: 445]
  ------------------
  113|      3|         return "IA5 STRING";
  114|       |
  115|      1|      case ASN1_Type::TeletexString:
  ------------------
  |  Branch (115:7): [True: 1, False: 447]
  ------------------
  116|      1|         return "T61 STRING";
  117|       |
  118|     51|      case ASN1_Type::Utf8String:
  ------------------
  |  Branch (118:7): [True: 51, False: 397]
  ------------------
  119|     51|         return "UTF8 STRING";
  120|       |
  121|      2|      case ASN1_Type::VisibleString:
  ------------------
  |  Branch (121:7): [True: 2, False: 446]
  ------------------
  122|      2|         return "VISIBLE STRING";
  123|       |
  124|      1|      case ASN1_Type::BmpString:
  ------------------
  |  Branch (124:7): [True: 1, False: 447]
  ------------------
  125|      1|         return "BMP STRING";
  126|       |
  127|      2|      case ASN1_Type::UniversalString:
  ------------------
  |  Branch (127:7): [True: 2, False: 446]
  ------------------
  128|      2|         return "UNIVERSAL STRING";
  129|       |
  130|      2|      case ASN1_Type::UtcTime:
  ------------------
  |  Branch (130:7): [True: 2, False: 446]
  ------------------
  131|      2|         return "UTC TIME";
  132|       |
  133|      2|      case ASN1_Type::GeneralizedTime:
  ------------------
  |  Branch (133:7): [True: 2, False: 446]
  ------------------
  134|      2|         return "GENERALIZED TIME";
  135|       |
  136|      6|      case ASN1_Type::OctetString:
  ------------------
  |  Branch (136:7): [True: 6, False: 442]
  ------------------
  137|      6|         return "OCTET STRING";
  138|       |
  139|      7|      case ASN1_Type::BitString:
  ------------------
  |  Branch (139:7): [True: 7, False: 441]
  ------------------
  140|      7|         return "BIT STRING";
  141|       |
  142|     19|      case ASN1_Type::Enumerated:
  ------------------
  |  Branch (142:7): [True: 19, False: 429]
  ------------------
  143|     19|         return "ENUMERATED";
  144|       |
  145|      6|      case ASN1_Type::Integer:
  ------------------
  |  Branch (145:7): [True: 6, False: 442]
  ------------------
  146|      6|         return "INTEGER";
  147|       |
  148|      2|      case ASN1_Type::Null:
  ------------------
  |  Branch (148:7): [True: 2, False: 446]
  ------------------
  149|      2|         return "NULL";
  150|       |
  151|      1|      case ASN1_Type::ObjectId:
  ------------------
  |  Branch (151:7): [True: 1, False: 447]
  ------------------
  152|      1|         return "OBJECT";
  153|       |
  154|      4|      case ASN1_Type::Boolean:
  ------------------
  |  Branch (154:7): [True: 4, False: 444]
  ------------------
  155|      4|         return "BOOLEAN";
  156|       |
  157|      0|      case ASN1_Type::NoObject:
  ------------------
  |  Branch (157:7): [True: 0, False: 448]
  ------------------
  158|      0|         return "NO_OBJECT";
  159|       |
  160|    124|      default:
  ------------------
  |  Branch (160:7): [True: 124, False: 324]
  ------------------
  161|    124|         return "TAG(" + std::to_string(static_cast<uint32_t>(type)) + ")";
  162|    448|   }
  163|    448|}
_ZN5Botan18BER_Decoding_ErrorC2ENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
  168|    888|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|    232|std::string to_string(const BER_Object& obj) {
  191|    232|   return bytes_to_string(obj.data());
  192|    232|}

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

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

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

_ZN5Botan11BER_DecoderD2Ev:
  366|  9.69k|BER_Decoder::~BER_Decoder() = default;
_ZNK5Botan11BER_Decoder10more_itemsEv:
  371|  1.92k|bool BER_Decoder::more_items() const {
  372|  1.92k|   if(m_source->end_of_data() && !m_pushed.is_set()) {
  ------------------
  |  Branch (372:7): [True: 298, False: 1.62k]
  |  Branch (372:34): [True: 298, False: 0]
  ------------------
  373|    298|      return false;
  374|    298|   }
  375|  1.62k|   return true;
  376|  1.92k|}
_ZN5Botan11BER_Decoder10verify_endEv:
  381|  1.27k|BER_Decoder& BER_Decoder::verify_end() {
  382|  1.27k|   return verify_end("BER_Decoder::verify_end called, but data remains");
  383|  1.27k|}
_ZN5Botan11BER_Decoder10verify_endENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
  388|  1.27k|BER_Decoder& BER_Decoder::verify_end(std::string_view err) {
  389|  1.27k|   if(!m_source->end_of_data() || m_pushed.is_set()) {
  ------------------
  |  Branch (389:7): [True: 20, False: 1.25k]
  |  Branch (389:35): [True: 41, False: 1.21k]
  ------------------
  390|     61|      throw Decoding_Error(err);
  391|     61|   }
  392|  1.21k|   return (*this);
  393|  1.27k|}
_ZN5Botan11BER_Decoder14read_next_byteEv:
  405|  16.5k|std::optional<uint8_t> BER_Decoder::read_next_byte() {
  406|  16.5k|   BOTAN_ASSERT_NOMSG(m_source != nullptr);
  ------------------
  |  |   77|  16.5k|   do {                                                                     \
  |  |   78|  16.5k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   79|  16.5k|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (79:10): [True: 0, False: 16.5k]
  |  |  ------------------
  |  |   80|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   81|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   82|      0|      }                                                                     \
  |  |   83|  16.5k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (83:12): [Folded, False: 16.5k]
  |  |  ------------------
  ------------------
  407|  16.5k|   uint8_t b = 0;
  408|  16.5k|   if(m_source->read_byte(b) != 0) {
  ------------------
  |  Branch (408:7): [True: 15.0k, False: 1.55k]
  ------------------
  409|  15.0k|      return b;
  410|  15.0k|   } else {
  411|  1.55k|      return {};
  412|  1.55k|   }
  413|  16.5k|}
_ZN5Botan11BER_Decoder15get_next_objectEv:
  426|  13.5k|BER_Object BER_Decoder::get_next_object() {
  427|  13.5k|   BER_Object next;
  428|       |
  429|  13.5k|   if(m_pushed.is_set()) {
  ------------------
  |  Branch (429:7): [True: 887, False: 12.6k]
  ------------------
  430|    887|      std::swap(next, m_pushed);
  431|    887|      return next;
  432|    887|   }
  433|       |
  434|  12.6k|   for(;;) {
  435|  12.6k|      ASN1_Type type_tag = ASN1_Type::NoObject;
  436|  12.6k|      ASN1_Class class_tag = ASN1_Class::NoObject;
  437|  12.6k|      decode_tag(m_source, type_tag, class_tag);
  438|  12.6k|      next.set_tagging(type_tag, class_tag);
  439|  12.6k|      if(next.is_set() == false) {  // no more objects
  ------------------
  |  Branch (439:10): [True: 775, False: 11.8k]
  ------------------
  440|    775|         return next;
  441|    775|      }
  442|       |
  443|  11.8k|      const size_t allow_indef = m_limits.allow_ber_encoding() ? m_limits.max_nested_indefinite_length() : 0;
  ------------------
  |  Branch (443:34): [True: 0, False: 11.8k]
  ------------------
  444|  11.8k|      const bool der_mode = m_limits.require_der_encoding();
  445|  11.8k|      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|  11.8k|      if(type_tag == ASN1_Type::Eoc && class_tag == ASN1_Class::Universal &&
  ------------------
  |  Branch (450:10): [True: 998, False: 10.8k]
  |  Branch (450:40): [True: 39, False: 959]
  ------------------
  451|     39|         (dl.content_length() != 0 || dl.indefinite_length())) {
  ------------------
  |  Branch (451:11): [True: 34, False: 5]
  |  Branch (451:39): [True: 0, False: 5]
  ------------------
  452|     34|         throw BER_Decoding_Error("EOC marker with non-zero length");
  453|     34|      }
  454|       |
  455|  11.8k|      if(!m_source->check_available(dl.total_length())) {
  ------------------
  |  Branch (455:10): [True: 160, False: 11.6k]
  ------------------
  456|    160|         throw BER_Decoding_Error("Value truncated");
  457|    160|      }
  458|       |
  459|  11.6k|      uint8_t* out = next.mutable_bits(dl.content_length());
  460|  11.6k|      if(m_source->read(out, dl.content_length()) != dl.content_length()) {
  ------------------
  |  Branch (460:10): [True: 0, False: 11.6k]
  ------------------
  461|      0|         throw BER_Decoding_Error("Value truncated");
  462|      0|      }
  463|       |
  464|  11.6k|      if(dl.indefinite_length()) {
  ------------------
  |  Branch (464:10): [True: 0, False: 11.6k]
  ------------------
  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.6k|      if(next.tagging() == static_cast<uint32_t>(ASN1_Type::Eoc)) {
  ------------------
  |  Branch (472:10): [True: 5, False: 11.6k]
  ------------------
  473|      5|         if(m_limits.require_der_encoding()) {
  ------------------
  |  Branch (473:13): [True: 5, False: 0]
  ------------------
  474|      5|            throw BER_Decoding_Error("Detected EOC marker in DER structure");
  475|      5|         }
  476|      0|         continue;
  477|  11.6k|      } else {
  478|  11.6k|         break;
  479|  11.6k|      }
  480|  11.6k|   }
  481|       |
  482|  11.6k|   return next;
  483|  12.6k|}
_ZN5Botan11BER_Decoder9push_backERKNS_10BER_ObjectE:
  500|    570|void BER_Decoder::push_back(const BER_Object& obj) {
  501|    570|   if(m_pushed.is_set()) {
  ------------------
  |  Branch (501:7): [True: 0, False: 570]
  ------------------
  502|      0|      throw Invalid_State("BER_Decoder: Only one push back is allowed");
  503|      0|   }
  504|    570|   m_pushed = obj;
  505|    570|}
_ZN5Botan11BER_Decoder9push_backEONS_10BER_ObjectE:
  507|  1.00k|void BER_Decoder::push_back(BER_Object&& obj) {
  508|  1.00k|   if(m_pushed.is_set()) {
  ------------------
  |  Branch (508:7): [True: 0, False: 1.00k]
  ------------------
  509|      0|      throw Invalid_State("BER_Decoder: Only one push back is allowed");
  510|      0|   }
  511|  1.00k|   m_pushed = std::move(obj);
  512|  1.00k|}
_ZN5Botan11BER_Decoder10start_consENS_9ASN1_TypeENS_10ASN1_ClassE:
  514|  6.56k|BER_Decoder BER_Decoder::start_cons(ASN1_Type type_tag, ASN1_Class class_tag) {
  515|  6.56k|   BER_Object obj = get_next_object();
  516|  6.56k|   obj.assert_is_a(type_tag, class_tag | ASN1_Class::Constructed);
  517|  6.56k|   BER_Decoder child(std::move(obj), this);
  518|  6.56k|   return child;
  519|  6.56k|}
_ZN5Botan11BER_Decoder8end_consEv:
  524|  1.70k|BER_Decoder& BER_Decoder::end_cons() {
  525|  1.70k|   if(m_parent == nullptr) {
  ------------------
  |  Branch (525:7): [True: 0, False: 1.70k]
  ------------------
  526|      0|      throw Invalid_State("BER_Decoder::end_cons called with null parent");
  527|      0|   }
  528|  1.70k|   if(!m_source->end_of_data() || m_pushed.is_set()) {
  ------------------
  |  Branch (528:7): [True: 9, False: 1.69k]
  |  Branch (528:35): [True: 0, False: 1.69k]
  ------------------
  529|      9|      throw Decoding_Error("BER_Decoder::end_cons called with data left");
  530|      9|   }
  531|  1.69k|   return (*m_parent);
  532|  1.70k|}
_ZN5Botan11BER_DecoderC2EONS_10BER_ObjectEPS0_:
  535|  6.06k|      m_limits(parent != nullptr ? parent->limits() : BER_Decoder::Limits::BER()), m_parent(parent) {
  ------------------
  |  Branch (535:16): [True: 6.06k, False: 0]
  ------------------
  536|  6.06k|   m_data_src = std::make_unique<DataSource_BERObject>(std::move(obj));
  537|  6.06k|   m_source = m_data_src.get();
  538|  6.06k|}
_ZN5Botan11BER_DecoderC2ENSt3__14spanIKhLm18446744073709551615EEENS0_6LimitsE:
  548|  3.62k|BER_Decoder::BER_Decoder(std::span<const uint8_t> buf, Limits limits) : m_limits(limits) {
  549|  3.62k|   m_data_src = std::make_unique<DataSource_Memory>(buf);
  550|  3.62k|   m_source = m_data_src.get();
  551|  3.62k|}
_ZN5Botan11BER_Decoder6decodeERNS_11ASN1_ObjectENS_9ASN1_TypeENS_10ASN1_ClassE:
  560|  3.43k|BER_Decoder& BER_Decoder::decode(ASN1_Object& obj, ASN1_Type /*unused*/, ASN1_Class /*unused*/) {
  561|  3.43k|   obj.decode_from(*this);
  562|  3.43k|   return (*this);
  563|  3.43k|}
_ZN5Botan11BER_Decoder6decodeERmNS_9ASN1_TypeENS_10ASN1_ClassE:
  610|  1.35k|BER_Decoder& BER_Decoder::decode(size_t& out, ASN1_Type type_tag, ASN1_Class class_tag) {
  611|  1.35k|   BigInt integer;
  612|  1.35k|   decode(integer, type_tag, class_tag);
  613|       |
  614|  1.35k|   if(integer.signum() < 0) {
  ------------------
  |  Branch (614:7): [True: 104, False: 1.24k]
  ------------------
  615|    104|      throw BER_Decoding_Error("Decoded small integer value was negative");
  616|    104|   }
  617|       |
  618|  1.24k|   if(integer.bits() > 32) {
  ------------------
  |  Branch (618:7): [True: 103, False: 1.14k]
  ------------------
  619|    103|      throw BER_Decoding_Error("Decoded integer value larger than expected");
  620|    103|   }
  621|       |
  622|  1.14k|   out = 0;
  623|  5.29k|   for(size_t i = 0; i != 4; ++i) {
  ------------------
  |  Branch (623:22): [True: 4.14k, False: 1.14k]
  ------------------
  624|  4.14k|      out = (out << 8) | integer.byte_at(3 - i);
  625|  4.14k|   }
  626|       |
  627|  1.14k|   return (*this);
  628|  1.24k|}
_ZN5Botan11BER_Decoder6decodeERNS_6BigIntENS_9ASN1_TypeENS_10ASN1_ClassE:
  660|  1.35k|BER_Decoder& BER_Decoder::decode(BigInt& out, ASN1_Type type_tag, ASN1_Class class_tag) {
  661|  1.35k|   const BER_Object obj = get_next_object();
  662|  1.35k|   obj.assert_is_a(type_tag, class_tag);
  663|       |
  664|       |   // DER requires minimal INTEGER encoding (X.690 section 8.3.2)
  665|  1.35k|   if(m_limits.require_der_encoding()) {
  ------------------
  |  Branch (665:7): [True: 1.26k, False: 92]
  ------------------
  666|  1.26k|      if(obj.length() == 0) {
  ------------------
  |  Branch (666:10): [True: 3, False: 1.25k]
  ------------------
  667|      3|         throw BER_Decoding_Error("Detected empty INTEGER encoding in DER structure");
  668|      3|      }
  669|  1.25k|      if(obj.length() > 1) {
  ------------------
  |  Branch (669:10): [True: 277, False: 982]
  ------------------
  670|    277|         if(obj.bits()[0] == 0x00 && (obj.bits()[1] & 0x80) == 0) {
  ------------------
  |  Branch (670:13): [True: 55, False: 222]
  |  Branch (670:38): [True: 4, False: 51]
  ------------------
  671|      4|            throw BER_Decoding_Error("Detected non-minimal INTEGER encoding in DER structure");
  672|      4|         }
  673|    273|         if(obj.bits()[0] == 0xFF && (obj.bits()[1] & 0x80) != 0) {
  ------------------
  |  Branch (673:13): [True: 26, False: 247]
  |  Branch (673:38): [True: 12, False: 14]
  ------------------
  674|     12|            throw BER_Decoding_Error("Detected non-minimal INTEGER encoding in DER structure");
  675|     12|         }
  676|    273|      }
  677|  1.25k|   }
  678|       |
  679|  1.33k|   if(obj.length() == 0) {
  ------------------
  |  Branch (679:7): [True: 0, False: 1.33k]
  ------------------
  680|      0|      out.clear();
  681|  1.33k|   } else {
  682|  1.33k|      const uint8_t first = obj.bits()[0];
  683|  1.33k|      const bool negative = (first & 0x80) == 0x80;
  684|       |
  685|  1.33k|      if(negative) {
  ------------------
  |  Branch (685:10): [True: 104, False: 1.23k]
  ------------------
  686|    104|         secure_vector<uint8_t> vec(obj.bits(), obj.bits() + obj.length());
  687|    406|         for(size_t i = obj.length(); i > 0; --i) {
  ------------------
  |  Branch (687:39): [True: 406, False: 0]
  ------------------
  688|    406|            const bool gt0 = (vec[i - 1] > 0);
  689|    406|            vec[i - 1] -= 1;
  690|    406|            if(gt0) {
  ------------------
  |  Branch (690:16): [True: 104, False: 302]
  ------------------
  691|    104|               break;
  692|    104|            }
  693|    406|         }
  694|  23.2k|         for(size_t i = 0; i != obj.length(); ++i) {
  ------------------
  |  Branch (694:28): [True: 23.1k, False: 104]
  ------------------
  695|  23.1k|            vec[i] = ~vec[i];
  696|  23.1k|         }
  697|    104|         out._assign_from_bytes(vec);
  698|    104|         out.flip_sign();
  699|  1.23k|      } else {
  700|  1.23k|         out._assign_from_bytes(obj.data());
  701|  1.23k|      }
  702|  1.33k|   }
  703|       |
  704|  1.33k|   return (*this);
  705|  1.35k|}
_ZN5Botan11BER_Decoder6decodeERNSt3__16vectorIhNS1_9allocatorIhEEEENS_9ASN1_TypeES7_NS_10ASN1_ClassE:
  782|  1.22k|                                 ASN1_Class class_tag) {
  783|  1.22k|   if(real_type != ASN1_Type::OctetString && real_type != ASN1_Type::BitString) {
  ------------------
  |  Branch (783:7): [True: 601, False: 624]
  |  Branch (783:46): [True: 0, False: 601]
  ------------------
  784|      0|      throw BER_Bad_Tag("Bad tag for {BIT,OCTET} STRING", static_cast<uint32_t>(real_type));
  785|      0|   }
  786|       |
  787|  1.22k|   asn1_decode_binary_string(
  788|  1.22k|      buffer, get_next_object(), real_type, type_tag, class_tag, m_limits.require_der_encoding());
  789|  1.22k|   return (*this);
  790|  1.22k|}
ber_dec.cpp:_ZN5Botan12_GLOBAL__N_110decode_tagEPNS_10DataSourceERNS_9ASN1_TypeERNS_10ASN1_ClassE:
   27|  12.6k|size_t decode_tag(DataSource* ber, ASN1_Type& type_tag, ASN1_Class& class_tag) {
   28|  12.6k|   auto b = ber->read_byte();
   29|       |
   30|  12.6k|   if(!b) {
  ------------------
  |  Branch (30:7): [True: 775, False: 11.8k]
  ------------------
   31|    775|      type_tag = ASN1_Type::NoObject;
   32|    775|      class_tag = ASN1_Class::NoObject;
   33|    775|      return 0;
   34|    775|   }
   35|       |
   36|  11.8k|   if((*b & 0x1F) != 0x1F) {
  ------------------
  |  Branch (36:7): [True: 11.4k, False: 441]
  ------------------
   37|  11.4k|      type_tag = ASN1_Type(*b & 0x1F);
   38|  11.4k|      class_tag = ASN1_Class(*b & 0xE0);
   39|  11.4k|      return 1;
   40|  11.4k|   }
   41|       |
   42|    441|   size_t tag_bytes = 1;
   43|    441|   class_tag = ASN1_Class(*b & 0xE0);
   44|       |
   45|    441|   uint32_t tag_buf = 0;
   46|  1.49k|   while(true) {
  ------------------
  |  Branch (46:10): [True: 1.49k, Folded]
  ------------------
   47|  1.49k|      b = ber->read_byte();
   48|  1.49k|      if(!b) {
  ------------------
  |  Branch (48:10): [True: 15, False: 1.47k]
  ------------------
   49|     15|         throw BER_Decoding_Error("Long-form tag truncated");
   50|     15|      }
   51|  1.47k|      if((tag_buf >> 24) != 0) {
  ------------------
  |  Branch (51:10): [True: 10, False: 1.46k]
  ------------------
   52|     10|         throw BER_Decoding_Error("Long-form tag overflowed 32 bits");
   53|     10|      }
   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.46k|      if(tag_bytes == 1 && (*b & 0x7F) == 0) {
  ------------------
  |  Branch (58:10): [True: 439, False: 1.02k]
  |  Branch (58:28): [True: 1, False: 438]
  ------------------
   59|      1|         throw BER_Decoding_Error("Long form tag with leading zero");
   60|      1|      }
   61|  1.46k|      ++tag_bytes;
   62|  1.46k|      tag_buf = (tag_buf << 7) | (*b & 0x7F);
   63|  1.46k|      if((*b & 0x80) == 0) {
  ------------------
  |  Branch (63:10): [True: 415, False: 1.05k]
  ------------------
   64|    415|         break;
   65|    415|      }
   66|  1.46k|   }
   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|    415|   if(tag_buf <= 30) {
  ------------------
  |  Branch (70:7): [True: 7, False: 408]
  ------------------
   71|      7|      throw BER_Decoding_Error("Long-form tag encoding used for small tag value");
   72|      7|   }
   73|       |
   74|    408|   if(tag_buf == static_cast<uint32_t>(ASN1_Type::NoObject)) {
  ------------------
  |  Branch (74:7): [True: 1, False: 407]
  ------------------
   75|      1|      throw BER_Decoding_Error("Tag value collides with internal sentinel");
   76|      1|   }
   77|       |
   78|       |   // NOLINTNEXTLINE(clang-analyzer-optin.core.EnumCastOutOfRange)
   79|    407|   type_tag = ASN1_Type(tag_buf);
   80|    407|   return tag_bytes;
   81|    408|}
ber_dec.cpp:_ZN5Botan12_GLOBAL__N_113decode_lengthEPNS_10DataSourceEmbb:
  126|  11.8k|BerDecodedLength decode_length(DataSource* ber, size_t allow_indef, bool der_mode, bool constructed) {
  127|  11.8k|   uint8_t b = 0;
  128|  11.8k|   if(ber->read_byte(b) == 0) {
  ------------------
  |  Branch (128:7): [True: 111, False: 11.7k]
  ------------------
  129|    111|      throw BER_Decoding_Error("Length field not found");
  130|    111|   }
  131|  11.7k|   if((b & 0x80) == 0) {
  ------------------
  |  Branch (131:7): [True: 11.4k, False: 309]
  ------------------
  132|  11.4k|      return BerDecodedLength(b, 1);
  133|  11.4k|   }
  134|       |
  135|    309|   const size_t num_length_bytes = (b & 0x7F);
  136|    309|   if(num_length_bytes > 4) {
  ------------------
  |  Branch (136:7): [True: 14, False: 295]
  ------------------
  137|     14|      throw BER_Decoding_Error("Length field is too large");
  138|     14|   }
  139|       |
  140|    295|   const size_t field_size = 1 + num_length_bytes;
  141|       |
  142|    295|   if(num_length_bytes == 0) {
  ------------------
  |  Branch (142:7): [True: 3, False: 292]
  ------------------
  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|    292|   size_t length = 0;
  162|       |
  163|    954|   for(size_t i = 0; i != num_length_bytes; ++i) {
  ------------------
  |  Branch (163:22): [True: 670, False: 284]
  ------------------
  164|    670|      if(ber->read_byte(b) == 0) {
  ------------------
  |  Branch (164:10): [True: 8, False: 662]
  ------------------
  165|      8|         throw BER_Decoding_Error("Corrupted length field");
  166|      8|      }
  167|       |      // Can't overflow since we already checked that num_length_bytes <= 4
  168|    662|      length = (length << 8) | b;
  169|    662|   }
  170|       |
  171|       |   // DER requires shortest possible length encoding
  172|    284|   if(der_mode) {
  ------------------
  |  Branch (172:7): [True: 284, False: 0]
  ------------------
  173|    284|      if(length < 128) {
  ------------------
  |  Branch (173:10): [True: 9, False: 275]
  ------------------
  174|      9|         throw BER_Decoding_Error("Detected non-canonical length encoding in DER structure");
  175|      9|      }
  176|    275|      if(num_length_bytes > 1 && length < (size_t(1) << ((num_length_bytes - 1) * 8))) {
  ------------------
  |  Branch (176:10): [True: 240, False: 35]
  |  Branch (176:34): [True: 1, False: 239]
  ------------------
  177|      1|         throw BER_Decoding_Error("Detected non-canonical length encoding in DER structure");
  178|      1|      }
  179|    275|   }
  180|       |
  181|    274|   return BerDecodedLength(length, field_size);
  182|    284|}
ber_dec.cpp:_ZN5Botan12_GLOBAL__N_116BerDecodedLengthC2Emm:
   99|  11.7k|            BerDecodedLength(content_length, field_length, false) {}
ber_dec.cpp:_ZN5Botan12_GLOBAL__N_116BerDecodedLengthC2Emmb:
  116|  11.7k|            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.0k|bool is_constructed(ASN1_Class class_tag) {
   21|  13.0k|   return (static_cast<uint32_t>(class_tag) & static_cast<uint32_t>(ASN1_Class::Constructed)) != 0;
   22|  13.0k|}
ber_dec.cpp:_ZNK5Botan12_GLOBAL__N_116BerDecodedLength14content_lengthEv:
  105|  34.5k|      size_t content_length() const { return m_content_length; }
ber_dec.cpp:_ZNK5Botan12_GLOBAL__N_116BerDecodedLength17indefinite_lengthEv:
  112|  11.5k|      bool indefinite_length() const { return m_indefinite; }
ber_dec.cpp:_ZNK5Botan12_GLOBAL__N_116BerDecodedLength12total_lengthEv:
  108|  11.6k|      size_t total_length() const { return m_indefinite ? m_content_length + 2 : m_content_length; }
  ------------------
  |  Branch (108:44): [True: 0, False: 11.6k]
  ------------------
ber_dec.cpp:_ZN5Botan12_GLOBAL__N_120DataSource_BERObjectC2EONS_10BER_ObjectE:
  357|  6.06k|      explicit DataSource_BERObject(BER_Object&& obj) : m_obj(std::move(obj)) {}
ber_dec.cpp:_ZN5Botan12_GLOBAL__N_120DataSource_BERObject4readEPhm:
  327|  42.4k|      size_t read(uint8_t out[], size_t length) override {
  328|  42.4k|         BOTAN_ASSERT_NOMSG(m_offset <= m_obj.length());
  ------------------
  |  |   77|  42.4k|   do {                                                                     \
  |  |   78|  42.4k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   79|  42.4k|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (79:10): [True: 0, False: 42.4k]
  |  |  ------------------
  |  |   80|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   81|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   82|      0|      }                                                                     \
  |  |   83|  42.4k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (83:12): [Folded, False: 42.4k]
  |  |  ------------------
  ------------------
  329|  42.4k|         const size_t got = std::min<size_t>(m_obj.length() - m_offset, length);
  330|  42.4k|         copy_mem(out, m_obj.bits() + m_offset, got);
  331|  42.4k|         m_offset += got;
  332|  42.4k|         return got;
  333|  42.4k|      }
ber_dec.cpp:_ZN5Botan12_GLOBAL__N_120DataSource_BERObject15check_availableEm:
  348|  8.22k|      bool check_available(size_t n) override {
  349|  8.22k|         BOTAN_ASSERT_NOMSG(m_offset <= m_obj.length());
  ------------------
  |  |   77|  8.22k|   do {                                                                     \
  |  |   78|  8.22k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   79|  8.22k|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (79:10): [True: 0, False: 8.22k]
  |  |  ------------------
  |  |   80|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   81|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   82|      0|      }                                                                     \
  |  |   83|  8.22k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (83:12): [Folded, False: 8.22k]
  |  |  ------------------
  ------------------
  350|  8.22k|         return (n <= (m_obj.length() - m_offset));
  351|  8.22k|      }
ber_dec.cpp:_ZNK5Botan12_GLOBAL__N_120DataSource_BERObject11end_of_dataEv:
  353|  3.74k|      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.74k|      size_t get_bytes_read() const override { return m_offset; }
ber_dec.cpp:_ZN5Botan12_GLOBAL__N_114is_constructedERKNS_10BER_ObjectE:
  709|  1.21k|bool is_constructed(const BER_Object& obj) {
  710|  1.21k|   return is_constructed(obj.class_tag());
  711|  1.21k|}
ber_dec.cpp:_ZN5Botan12_GLOBAL__N_125asn1_decode_binary_stringINSt3__19allocatorIhEEEEvRNS2_6vectorIhT_EERKNS_10BER_ObjectENS_9ASN1_TypeESC_NS_10ASN1_ClassEb:
  719|  1.22k|                               bool require_der) {
  720|  1.22k|   obj.assert_is_a(type_tag, class_tag);
  721|       |
  722|       |   // DER requires BIT STRING and OCTET STRING to use primitive encoding
  723|  1.22k|   if(require_der && is_constructed(obj)) {
  ------------------
  |  Branch (723:7): [True: 1.21k, False: 7]
  |  Branch (723:22): [True: 0, False: 1.21k]
  ------------------
  724|      0|      throw BER_Decoding_Error("Detected constructed string encoding in DER structure");
  725|      0|   }
  726|       |
  727|  1.22k|   if(real_type == ASN1_Type::OctetString) {
  ------------------
  |  Branch (727:7): [True: 620, False: 604]
  ------------------
  728|    620|      buffer.assign(obj.bits(), obj.bits() + obj.length());
  729|    620|   } else {
  730|    604|      if(obj.length() == 0) {
  ------------------
  |  Branch (730:10): [True: 1, False: 603]
  ------------------
  731|      1|         throw BER_Decoding_Error("Invalid BIT STRING");
  732|      1|      }
  733|       |
  734|    603|      const uint8_t unused_bits = obj.bits()[0];
  735|       |
  736|    603|      if(unused_bits >= 8) {
  ------------------
  |  Branch (736:10): [True: 5, False: 598]
  ------------------
  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|    598|      if(unused_bits > 0 && obj.length() < 2) {
  ------------------
  |  Branch (741:10): [True: 14, False: 584]
  |  Branch (741:29): [True: 3, False: 11]
  ------------------
  742|      3|         throw BER_Decoding_Error("Invalid BIT STRING");
  743|      3|      }
  744|       |
  745|       |      // DER requires unused bits in BIT STRING to be zero (X.690 section 11.2.2)
  746|    595|      if(require_der && unused_bits > 0) {
  ------------------
  |  Branch (746:10): [True: 588, False: 7]
  |  Branch (746:25): [True: 11, False: 577]
  ------------------
  747|     11|         const uint8_t last_byte = obj.bits()[obj.length() - 1];
  748|     11|         if((last_byte & ((1 << unused_bits) - 1)) != 0) {
  ------------------
  |  Branch (748:13): [True: 6, False: 5]
  ------------------
  749|      6|            throw BER_Decoding_Error("Detected non-zero padding bits in BIT STRING in DER structure");
  750|      6|         }
  751|     11|      }
  752|       |
  753|    589|      buffer.resize(obj.length() - 1);
  754|       |
  755|    589|      if(obj.length() > 1) {
  ------------------
  |  Branch (755:10): [True: 42, False: 547]
  ------------------
  756|     42|         copy_mem(buffer.data(), obj.bits() + 1, obj.length() - 1);
  757|     42|      }
  758|    589|   }
  759|  1.22k|}

_ZNK5Botan6BigInt7byte_atEm:
  118|  4.14k|uint8_t BigInt::byte_at(size_t n) const {
  119|  4.14k|   return get_byte_var(sizeof(word) - (n % sizeof(word)) - 1, word_at(n / sizeof(word)));
  120|  4.14k|}
_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|  20.2k|   for(size_t i = 0; i != sz; ++i) {
  ------------------
  |  Branch (221:22): [True: 18.9k, False: 1.24k]
  ------------------
  222|  18.9k|      const word w = m_reg[sz - i - 1];
  223|  18.9k|      sub &= ct_is_zero(w);
  224|  18.9k|      sig -= sub;
  225|  18.9k|   }
  226|       |
  227|       |   /*
  228|       |   * This depends on the data so is poisoned, but unpoison it here as
  229|       |   * later conditionals are made on the size.
  230|       |   */
  231|  1.24k|   CT::unpoison(sig);
  232|       |
  233|  1.24k|   return sig;
  234|  1.24k|}
_ZNK5Botan6BigInt13top_bits_freeEv:
  298|    189|size_t BigInt::top_bits_free() const {
  299|    189|   const size_t words = sig_words();
  300|       |
  301|    189|   const word top_word = word_at(words - 1);
  302|    189|   const size_t bits_used = high_bit(CT::value_barrier(top_word));
  303|    189|   CT::unpoison(bits_used);
  304|    189|   return WordInfo<word>::bits - bits_used;
  305|    189|}
_ZNK5Botan6BigInt4bitsEv:
  307|  1.13k|size_t BigInt::bits() const {
  308|  1.13k|   const size_t words = sig_words();
  309|       |
  310|  1.13k|   if(words == 0) {
  ------------------
  |  Branch (310:7): [True: 950, False: 189]
  ------------------
  311|    950|      return 0;
  312|    950|   }
  313|       |
  314|    189|   const size_t full_words = (words - 1) * WordInfo<word>::bits;
  315|    189|   const size_t top_bits = WordInfo<word>::bits - top_bits_free();
  316|       |
  317|    189|   return full_words + top_bits;
  318|  1.13k|}
_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: 9]
  ------------------
  433|       |
  434|  10.7k|   for(size_t i = 0; i != full_words; ++i) {
  ------------------
  |  Branch (434:22): [True: 9.46k, False: 1.24k]
  ------------------
  435|  9.46k|      reg[i] = load_be<word>(bytes.last<sizeof(word)>());
  436|  9.46k|      bytes = bytes.first(bytes.size() - sizeof(word));
  437|  9.46k|   }
  438|       |
  439|  1.24k|   if(!bytes.empty()) {
  ------------------
  |  Branch (439:7): [True: 1.23k, False: 9]
  ------------------
  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.35k|void BigInt::_const_time_unpoison() const {
  560|  1.35k|   CT::unpoison(m_data.const_data(), m_data.size());
  561|  1.35k|}

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

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

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

_ZN5Botan10DataSource9read_byteERh:
   27|  29.0k|size_t DataSource::read_byte(uint8_t& out) {
   28|  29.0k|   return read(&out, 1);
   29|  29.0k|}
_ZN5Botan10DataSource9read_byteEv:
   34|  14.1k|std::optional<uint8_t> DataSource::read_byte() {
   35|  14.1k|   uint8_t b = 0;
   36|  14.1k|   if(this->read(&b, 1) == 1) {
  ------------------
  |  Branch (36:7): [True: 13.3k, False: 790]
  ------------------
   37|  13.3k|      return b;
   38|  13.3k|   } else {
   39|    790|      return {};
   40|    790|   }
   41|  14.1k|}
_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.45k|bool DataSource_Memory::check_available(size_t n) {
   81|  3.45k|   return (n <= (m_source.size() - m_offset));
   82|  3.45k|}
_ZNK5Botan17DataSource_Memory11end_of_dataEv:
  101|  1.15k|bool DataSource_Memory::end_of_data() const {
  102|  1.15k|   return (m_offset == m_source.size());
  103|  1.15k|}

_ZN5Botan9ExceptionC2ENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
   71|  1.93k|Exception::Exception(std::string_view msg) : m_msg(msg) {}
_ZN5Botan16Invalid_ArgumentC2ENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
   77|    101|Invalid_Argument::Invalid_Argument(std::string_view msg) : Exception(msg) {}
_ZN5Botan14Decoding_ErrorC2ENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
  125|  1.83k|Decoding_Error::Decoding_Error(std::string_view name) : Exception(name) {}

_ZN5Botan19secure_scrub_memoryEPvm:
   25|  35.1k|void secure_scrub_memory(void* ptr, size_t n) {
   26|  35.1k|   return secure_zeroize_buffer(ptr, n);
   27|  35.1k|}
_ZN5Botan21secure_zeroize_bufferEPvm:
   29|  35.1k|void secure_zeroize_buffer(void* ptr, size_t n) {
   30|  35.1k|   if(n == 0) {
  ------------------
  |  Branch (30:7): [True: 19.0k, False: 16.0k]
  ------------------
   31|  19.0k|      return;
   32|  19.0k|   }
   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.0k|   ::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.0k|}

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

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

_ZN5Botan7X509_DN11decode_fromERNS_11BER_DecoderE:
  395|    338|void X509_DN::decode_from(BER_Decoder& source) {
  396|    338|   std::vector<uint8_t> bits;
  397|       |
  398|    338|   source.start_sequence().raw_bytes(bits).end_cons();
  399|       |
  400|    338|   BER_Decoder sequence(bits, source.limits());
  401|       |
  402|    338|   m_rdn.clear();
  403|       |
  404|       |   // Cap AVAs per RDN to bound work for downstream set-based matching.
  405|       |   // No legitimate cert has anywhere near this many AVAs in a single RDN.
  406|    338|   constexpr size_t MAX_AVAS_PER_RDN = 32;
  407|       |
  408|    665|   while(sequence.more_items()) {
  ------------------
  |  Branch (408:10): [True: 335, False: 330]
  ------------------
  409|    335|      BER_Decoder rdn_decoder = sequence.start_set();
  410|       |
  411|    335|      std::vector<std::pair<OID, ASN1_String>> rdn;
  412|    670|      while(rdn_decoder.more_items()) {
  ------------------
  |  Branch (412:13): [True: 335, False: 335]
  ------------------
  413|    335|         OID oid;
  414|    335|         ASN1_String str;
  415|       |
  416|    335|         rdn_decoder.start_sequence()
  417|    335|            .decode(oid)
  418|    335|            .decode(str)  // TODO support Any
  419|    335|            .end_cons();
  420|       |
  421|    335|         rdn.emplace_back(std::move(oid), std::move(str));
  422|       |
  423|    335|         if(rdn.size() > MAX_AVAS_PER_RDN) {
  ------------------
  |  Branch (423:13): [True: 0, False: 335]
  ------------------
  424|      0|            throw Decoding_Error("X.500 RDN has too many attribute-value assertions");
  425|      0|         }
  426|    335|      }
  427|       |
  428|       |      /*
  429|       |      RFC 5280 4.1.2.4:
  430|       |         RelativeDistinguishedName ::=
  431|       |           SET SIZE (1..MAX) OF AttributeTypeAndValue
  432|       |      */
  433|    335|      if(rdn.empty()) {
  ------------------
  |  Branch (433:10): [True: 8, False: 327]
  ------------------
  434|      8|         throw Decoding_Error("X.500 RDN must contain at least one attribute-value assertion");
  435|      8|      }
  436|    327|      m_rdn.push_back(std::move(rdn));
  437|    327|   }
  438|       |
  439|    330|   m_dn_bits = bits;
  440|    330|}

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

