_ZN5Botan10BER_ObjectC2Ev:
  122|  16.5k|      BER_Object() : m_type_tag(ASN1_Type::NoObject), m_class_tag(ASN1_Class::Universal) {}
_ZNK5Botan10BER_Object6is_setEv:
  132|  21.3k|      bool is_set() const { return m_type_tag != ASN1_Type::NoObject; }
_ZNK5Botan10BER_Object7taggingEv:
  134|  11.9k|      uint32_t tagging() const { return type_tag() | class_tag(); }
_ZNK5Botan10BER_Object8type_tagEv:
  136|  11.9k|      ASN1_Type type_tag() const { return m_type_tag; }
_ZNK5Botan10BER_Object9class_tagEv:
  138|  11.9k|      ASN1_Class class_tag() const { return m_class_tag; }
_ZNK5Botan10BER_Object4typeEv:
  140|  2.79k|      ASN1_Type type() const { return m_type_tag; }
_ZNK5Botan10BER_Object4bitsEv:
  144|  90.5k|      const uint8_t* bits() const { return m_value.data(); }
_ZNK5Botan10BER_Object6lengthEv:
  146|   192k|      size_t length() const { return m_value.size(); }
_ZN5Botan10BER_Object12mutable_bitsEm:
  163|  10.4k|      uint8_t* mutable_bits(size_t length) {
  164|  10.4k|         m_value.resize(length);
  165|  10.4k|         return m_value.data();
  166|  10.4k|      }
_ZN5Botan3OIDC2Ev:
  212|  1.58k|      explicit OID() {}
_ZN5Botan3OIDC2ESt16initializer_listIjE:
  223|     30|      explicit OID(std::initializer_list<uint32_t> init) : m_id(init) {
  224|     30|         BOTAN_ARG_CHECK(m_id.size() > 2 && m_id[0] <= 2 && (m_id[0] != 2 || m_id[1] <= 39), "Invalid OID");
  ------------------
  |  |   30|     30|   do {                                                          \
  |  |   31|    180|      if(!(expr))                                                \
  |  |  ------------------
  |  |  |  Branch (31:12): [True: 30, False: 0]
  |  |  |  Branch (31:12): [True: 30, False: 0]
  |  |  |  Branch (31:12): [True: 0, False: 30]
  |  |  |  Branch (31:12): [True: 30, False: 0]
  |  |  ------------------
  |  |   32|     30|         Botan::throw_invalid_argument(msg, __func__, __FILE__); \
  |  |   33|     30|   } while(0)
  |  |  ------------------
  |  |  |  Branch (33:12): [Folded - Ignored]
  |  |  ------------------
  ------------------
  225|     30|      }
_ZNK5Botan3OID14get_componentsEv:
  271|    208|      const std::vector<uint32_t>& get_components() const { return m_id; }
_ZNK5Botan11ASN1_String5emptyEv:
  411|  1.14k|      bool empty() const { return m_utf8_str.empty(); }
_ZN5BotanorENS_10ASN1_ClassES0_:
   76|  5.15k|inline ASN1_Class operator|(ASN1_Class x, ASN1_Class y) {
   77|  5.15k|   return static_cast<ASN1_Class>(static_cast<uint32_t>(x) | static_cast<uint32_t>(y));
   78|  5.15k|}
_ZN5BotanorENS_9ASN1_TypeENS_10ASN1_ClassE:
   80|  11.9k|inline uint32_t operator|(ASN1_Type x, ASN1_Class y) { return static_cast<uint32_t>(x) | static_cast<uint32_t>(y); }
_ZN5BotanorENS_10ASN1_ClassENS_9ASN1_TypeE:
   82|  1.50k|inline uint32_t operator|(ASN1_Class x, ASN1_Type y) { return static_cast<uint32_t>(x) | static_cast<uint32_t>(y); }
_ZN5Botan11ASN1_ObjectD2Ev:
  114|  7.49k|      virtual ~ASN1_Object() = default;
_ZN5Botan11ASN1_ObjectC2ERKS0_:
  112|  2.47k|      ASN1_Object(const ASN1_Object&) = default;
_ZN5Botan11ASN1_ObjectC2Ev:
  111|  5.05k|      ASN1_Object() = default;
_ZN5Botan10BER_ObjectC2EOS0_:
  128|  4.89k|      BER_Object(BER_Object&& other) = default;

_ZN5Botan13ignore_paramsIJRhEEEvDpOT_:
  114|  1.58k|void ignore_params(T&&... args) {
  115|  1.58k|   (ignore_param(args), ...);
  116|  1.58k|}
_ZN5Botan12ignore_paramIRhEEvOT_:
  111|  1.58k|void ignore_param(T&&) {}

_ZN5Botan11BER_Decoder14start_sequenceEv:
  112|  3.43k|      BER_Decoder start_sequence() { return start_cons(ASN1_Type::Sequence, ASN1_Class::Universal); }
_ZN5Botan11BER_Decoder9raw_bytesINSt3__19allocatorIhEEEERS0_RNS2_6vectorIhT_EE:
  160|  1.55k|      BER_Decoder& raw_bytes(std::vector<uint8_t, Alloc>& out) {
  161|  1.55k|         out.clear();
  162|  1.55k|         uint8_t buf;
  163|  70.6k|         while(m_source->read_byte(buf))
  ------------------
  |  Branch (163:16): [True: 69.1k, False: 1.55k]
  ------------------
  164|  69.1k|            out.push_back(buf);
  165|  1.55k|         return (*this);
  166|  1.55k|      }
_ZN5Botan11BER_Decoder9start_setEv:
  114|  1.89k|      BER_Decoder start_set() { return start_cons(ASN1_Type::Set, ASN1_Class::Universal); }

_ZN5Botan20Buffered_Computation6updateEPKhm:
   34|      3|      void update(const uint8_t in[], size_t length) { add_data(in, length); }
_ZN5Botan20Buffered_Computation6updateENSt3__14spanIKhLm18446744073709551615EEE:
   40|  2.50k|      void update(std::span<const uint8_t> in) { add_data(in.data(), in.size()); }
_ZN5Botan20Buffered_Computation5finalEPh:
   69|      4|      void final(uint8_t out[]) { final_result(out); }
_ZN5Botan20Buffered_Computation5finalINSt3__16vectorIhNS_16secure_allocatorIhEEEEEET_v:
   77|      2|      T final() {
   78|      2|         T output(output_length());
   79|      2|         final_result(output.data());
   80|      2|         return output;
   81|      2|      }
_ZN5Botan20Buffered_ComputationD2Ev:
  133|  2.62k|      virtual ~Buffered_Computation() = default;
_ZN5Botan20Buffered_Computation5finalINSt3__16vectorIhNS2_9allocatorIhEEEEEEvRT_:
   91|  2.50k|      void final(T& out) {
   92|  2.50k|         out.resize(output_length());
   93|  2.50k|         final_result(out.data());
   94|  2.50k|      }

_ZNK5Botan10ChaCha_RNG31max_number_of_bytes_per_requestEv:
  106|  2.50k|      size_t max_number_of_bytes_per_request() const override { return 0; }

_ZN5Botan19Credentials_ManagerD2Ev:
   33|  2.50k|      virtual ~Credentials_Manager() = default;

_ZN5Botan17DataSource_MemoryC2EPKhm:
  118|  3.40k|      DataSource_Memory(const uint8_t in[], size_t length) : m_source(in, in + length), m_offset(0) {}
_ZN5Botan17DataSource_MemoryC2ENSt3__16vectorIhNS_16secure_allocatorIhEEEE:
  124|  9.45k|      explicit DataSource_Memory(secure_vector<uint8_t> in) : m_source(std::move(in)), m_offset(0) {}
_ZN5Botan10DataSourceC2Ev:
   91|  17.7k|      DataSource() = default;
_ZN5Botan10DataSourceD2Ev:
   92|  17.7k|      virtual ~DataSource() = default;

_ZN5Botan14expand_top_bitIhEET_S1_:
   25|  1.93k|{
   26|  1.93k|   return static_cast<T>(0) - (a >> (sizeof(T) * 8 - 1));
   27|  1.93k|}
_ZN5Botan10ct_is_zeroIhEET_S1_:
   35|  1.93k|{
   36|  1.93k|   return expand_top_bit<T>(~x & (x - 1));
   37|  1.93k|}
_ZN5Botan14expand_top_bitImEET_S1_:
   25|    256|{
   26|    256|   return static_cast<T>(0) - (a >> (sizeof(T) * 8 - 1));
   27|    256|}
_ZN5Botan6chooseIjEET_S1_S1_S1_:
  168|   321k|inline constexpr T choose(T mask, T a, T b) {
  169|       |   //return (mask & a) | (~mask & b);
  170|   321k|   return (b ^ (mask & (a ^ b)));
  171|   321k|}
_ZN5Botan8majorityIjEET_S1_S1_S1_:
  174|   160k|inline constexpr T majority(T a, T b, T c) {
  175|       |   /*
  176|       |   Considering each bit of a, b, c individually
  177|       |
  178|       |   If a xor b is set, then c is the deciding vote.
  179|       |
  180|       |   If a xor b is not set then either a and b are both set or both unset.
  181|       |   In either case the value of c doesn't matter, and examining b (or a)
  182|       |   allows us to determine which case we are in.
  183|       |   */
  184|   160k|   return choose(a ^ b, c, b);
  185|   160k|}
_ZN5Botan9ceil_log2ImEEhT_:
  124|  2.62k|{
  125|  2.62k|   if(x >> (sizeof(T) * 8 - 1))
  ------------------
  |  Branch (125:7): [True: 0, False: 2.62k]
  ------------------
  126|      0|      return sizeof(T) * 8;
  127|       |
  128|  2.62k|   uint8_t result = 0;
  129|  2.62k|   T compare = 1;
  130|       |
  131|  18.4k|   while(compare < x) {
  ------------------
  |  Branch (131:10): [True: 15.7k, False: 2.62k]
  ------------------
  132|  15.7k|      compare <<= 1;
  133|  15.7k|      result++;
  134|  15.7k|   }
  135|       |
  136|  2.62k|   return result;
  137|  2.62k|}
_ZN5Botan13is_power_of_2ImEEbT_:
   47|  2.62k|{
   48|  2.62k|   return (arg != 0) && (arg != 1) && ((arg & static_cast<T>(arg - 1)) == 0);
  ------------------
  |  Branch (48:11): [True: 2.62k, False: 0]
  |  Branch (48:25): [True: 2.62k, False: 0]
  |  Branch (48:39): [True: 2.62k, False: 0]
  ------------------
   49|  2.62k|}
_ZN5Botan6chooseImEET_S1_S1_S1_:
  168|    128|inline constexpr T choose(T mask, T a, T b) {
  169|       |   //return (mask & a) | (~mask & b);
  170|    128|   return (b ^ (mask & (a ^ b)));
  171|    128|}

_ZN5Botan13reverse_bytesEt:
   19|  4.99k|inline constexpr uint16_t reverse_bytes(uint16_t x) {
   20|  4.99k|#if BOTAN_COMPILER_HAS_BUILTIN(__builtin_bswap16)
   21|  4.99k|   return __builtin_bswap16(x);
   22|       |#else
   23|       |   return static_cast<uint16_t>((x << 8) | (x >> 8));
   24|       |#endif
   25|  4.99k|}
_ZN5Botan13reverse_bytesEj:
   33|  62.9k|inline constexpr uint32_t reverse_bytes(uint32_t x) {
   34|  62.9k|#if BOTAN_COMPILER_HAS_BUILTIN(__builtin_bswap32)
   35|  62.9k|   return __builtin_bswap32(x);
   36|       |#else
   37|       |   // MSVC at least recognizes this as a bswap
   38|       |   return ((x & 0x000000FF) << 24) | ((x & 0x0000FF00) << 8) | ((x & 0x00FF0000) >> 8) | ((x & 0xFF000000) >> 24);
   39|       |#endif
   40|  62.9k|}
_ZN5Botan13reverse_bytesEm:
   48|  2.50k|inline constexpr uint64_t reverse_bytes(uint64_t x) {
   49|  2.50k|#if BOTAN_COMPILER_HAS_BUILTIN(__builtin_bswap64)
   50|  2.50k|   return __builtin_bswap64(x);
   51|       |#else
   52|       |   uint32_t hi = static_cast<uint32_t>(x >> 32);
   53|       |   uint32_t lo = static_cast<uint32_t>(x);
   54|       |
   55|       |   hi = reverse_bytes(hi);
   56|       |   lo = reverse_bytes(lo);
   57|       |
   58|       |   return (static_cast<uint64_t>(lo) << 32) | hi;
   59|       |#endif
   60|  2.50k|}

_ZN5Botan5CPUID13has_cpuid_bitENS0_10CPUID_bitsE:
  333|  8.00k|      static bool has_cpuid_bit(CPUID_bits elem) {
  334|  8.00k|         const uint32_t elem32 = static_cast<uint32_t>(elem);
  335|  8.00k|         return state().has_bit(elem32);
  336|  8.00k|      }
_ZN5Botan5CPUID5stateEv:
  362|  8.00k|      static CPUID_Data& state() {
  363|  8.00k|         static CPUID::CPUID_Data g_cpuid;
  364|  8.00k|         return g_cpuid;
  365|  8.00k|      }
_ZNK5Botan5CPUID10CPUID_Data7has_bitEj:
  350|  8.00k|            bool has_bit(uint32_t bit) const { return (m_processor_features & bit) == bit; }
_ZN5Botan5CPUID8has_sse2Ev:
  208|  2.66k|      static bool has_sse2() { return has_cpuid_bit(CPUID_SSE2_BIT); }
_ZN5Botan5CPUID8has_avx2Ev:
  218|    160|      static bool has_avx2() { return has_cpuid_bit(CPUID_AVX2_BIT); }
_ZN5Botan5CPUID10has_avx512Ev:
  225|    160|      static bool has_avx512() { return has_cpuid_bit(CPUID_AVX512_BIT); }
_ZN5Botan5CPUID8has_bmi2Ev:
  240|  2.51k|      static bool has_bmi2() { return has_cpuid_bit(CPUID_BMI_BIT); }
_ZN5Botan5CPUID13has_intel_shaEv:
  255|  2.51k|      static bool has_intel_sha() { return has_sse2() && has_cpuid_bit(CPUID_SHA_BIT); }
  ------------------
  |  Branch (255:44): [True: 2.51k, False: 0]
  |  Branch (255:58): [True: 0, False: 2.51k]
  ------------------

_ZN5Botan2CT4MaskIhEC2Eh:
  279|  3.52k|      Mask(T m) : m_mask(m) {}
_ZNK5Botan2CT4MaskIhE5valueEv:
  276|  3.52k|      T value() const { return m_mask; }
_ZN5Botan2CT4MaskIhE7is_zeroEh:
  123|  1.93k|      static Mask<T> is_zero(T x) { return Mask<T>(ct_is_zero<T>(x)); }
_ZN5Botan2CT4MaskIhE3setEv:
   99|  1.58k|      static Mask<T> set() { return Mask<T>(static_cast<T>(~0)); }
_ZNK5Botan2CT4MaskIhE6is_setEv:
  271|  1.58k|      bool is_set() const { return unpoisoned_value() != 0; }
_ZNK5Botan2CT4MaskIhE16unpoisoned_valueEv:
  262|  1.58k|      T unpoisoned_value() const {
  263|  1.58k|         T r = value();
  264|  1.58k|         CT::unpoison(r);
  265|  1.58k|         return r;
  266|  1.58k|      }
_ZN5Botan2CT8unpoisonIhEEvRT_:
   66|  1.58k|inline void unpoison(T& p) {
   67|       |#if defined(BOTAN_HAS_VALGRIND)
   68|       |   VALGRIND_MAKE_MEM_DEFINED(&p, sizeof(T));
   69|       |#else
   70|  1.58k|   BOTAN_UNUSED(p);
  ------------------
  |  |  118|  1.58k|#define BOTAN_UNUSED Botan::ignore_params
  ------------------
   71|  1.58k|#endif
   72|  1.58k|}
_ZN5Botan2CT4MaskImEC2Em:
  279|    384|      Mask(T m) : m_mask(m) {}
_ZNK5Botan2CT4MaskImEcoEv:
  213|    128|      Mask<T> operator~() const { return Mask<T>(~value()); }
_ZNK5Botan2CT4MaskImE5valueEv:
  276|    256|      T value() const { return m_mask; }
_ZNK5Botan2CT4MaskImE6selectEmm:
  228|    128|      T select(T x, T y) const { return choose(value(), x, y); }
_ZN5Botan2CT4MaskImE5is_ltEmm:
  133|    256|      static Mask<T> is_lt(T x, T y) { return Mask<T>(expand_top_bit<T>(x ^ ((x ^ y) | ((x - y) ^ x)))); }
_ZNK5Botan2CT4MaskImE13if_set_returnEm:
  218|    128|      T if_set_return(T x) const { return m_mask & x; }
_ZN5Botan2CT4MaskImE6is_lteEmm:
  143|    128|      static Mask<T> is_lte(T x, T y) { return ~Mask<T>::is_gt(x, y); }
_ZN5Botan2CT4MaskImE5is_gtEmm:
  138|    128|      static Mask<T> is_gt(T x, T y) { return Mask<T>::is_lt(y, x); }

_ZN5Botan8FE_25519C2ESt16initializer_listIiE:
   36|  1.53k|      FE_25519(std::initializer_list<int32_t> x) {
   37|  1.53k|         if(x.size() != 10)
  ------------------
  |  Branch (37:13): [True: 0, False: 1.53k]
  ------------------
   38|      0|            throw Invalid_Argument("Invalid FE_25519 initializer list");
   39|  1.53k|         copy_mem(m_fe, x.begin(), 10);
   40|  1.53k|      }

_ZN5Botan10fmt_detail6do_fmtERNSt3__119basic_ostringstreamIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS1_17basic_string_viewIcS4_EE:
   20|  1.14k|inline void do_fmt(std::ostringstream& oss, std::string_view format) { oss << format; }
_ZN5Botan10fmt_detail6do_fmtINSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEJEEEvRNS2_19basic_ostringstreamIcS5_NS2_9allocatorIcEEEES6_RKT_DpRKT0_:
   23|    985|void do_fmt(std::ostringstream& oss, std::string_view format, const T& val, const Ts&... rest) {
   24|    985|   size_t i = 0;
   25|       |
   26|  4.48k|   while(i < format.size()) {
  ------------------
  |  Branch (26:10): [True: 4.48k, False: 0]
  ------------------
   27|  4.48k|      if(format[i] == '{' && (format.size() > (i + 1)) && format.at(i + 1) == '}') {
  ------------------
  |  Branch (27:10): [True: 985, False: 3.49k]
  |  Branch (27:30): [True: 985, False: 0]
  |  Branch (27:59): [True: 985, False: 0]
  ------------------
   28|    985|         oss << val;
   29|    985|         return do_fmt(oss, format.substr(i + 2), rest...);
   30|  3.49k|      } else {
   31|  3.49k|         oss << format[i];
   32|  3.49k|      }
   33|       |
   34|  3.49k|      i += 1;
   35|  3.49k|   }
   36|    985|}
_ZN5Botan3fmtIJPKcNSt3__117basic_string_viewIcNS3_11char_traitsIcEEEEEEENS3_12basic_stringIcS6_NS3_9allocatorIcEEEES7_DpRKT_:
   51|    472|std::string fmt(std::string_view format, const T&... args) {
   52|    472|   std::ostringstream oss;
   53|    472|   oss.imbue(std::locale::classic());
   54|    472|   fmt_detail::do_fmt(oss, format, args...);
   55|    472|   return oss.str();
   56|    472|}
_ZN5Botan10fmt_detail6do_fmtIPKcJNSt3__117basic_string_viewIcNS4_11char_traitsIcEEEEEEEvRNS4_19basic_ostringstreamIcS7_NS4_9allocatorIcEEEES8_RKT_DpRKT0_:
   23|    472|void do_fmt(std::ostringstream& oss, std::string_view format, const T& val, const Ts&... rest) {
   24|    472|   size_t i = 0;
   25|       |
   26|  4.13k|   while(i < format.size()) {
  ------------------
  |  Branch (26:10): [True: 4.13k, False: 0]
  ------------------
   27|  4.13k|      if(format[i] == '{' && (format.size() > (i + 1)) && format.at(i + 1) == '}') {
  ------------------
  |  Branch (27:10): [True: 472, False: 3.66k]
  |  Branch (27:30): [True: 472, False: 0]
  |  Branch (27:59): [True: 472, False: 0]
  ------------------
   28|    472|         oss << val;
   29|    472|         return do_fmt(oss, format.substr(i + 2), rest...);
   30|  3.66k|      } else {
   31|  3.66k|         oss << format[i];
   32|  3.66k|      }
   33|       |
   34|  3.66k|      i += 1;
   35|  3.66k|   }
   36|    472|}
_ZN5Botan3fmtIJNSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEEEENS1_12basic_stringIcS4_NS1_9allocatorIcEEEES5_DpRKT_:
   51|    513|std::string fmt(std::string_view format, const T&... args) {
   52|    513|   std::ostringstream oss;
   53|    513|   oss.imbue(std::locale::classic());
   54|    513|   fmt_detail::do_fmt(oss, format, args...);
   55|    513|   return oss.str();
   56|    513|}
_ZN5Botan3fmtIJNSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEjEEENS1_12basic_stringIcS4_NS1_9allocatorIcEEEES5_DpRKT_:
   51|     52|std::string fmt(std::string_view format, const T&... args) {
   52|     52|   std::ostringstream oss;
   53|     52|   oss.imbue(std::locale::classic());
   54|     52|   fmt_detail::do_fmt(oss, format, args...);
   55|     52|   return oss.str();
   56|     52|}
_ZN5Botan10fmt_detail6do_fmtINSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEJjEEEvRNS2_19basic_ostringstreamIcS5_NS2_9allocatorIcEEEES6_RKT_DpRKT0_:
   23|     52|void do_fmt(std::ostringstream& oss, std::string_view format, const T& val, const Ts&... rest) {
   24|     52|   size_t i = 0;
   25|       |
   26|     52|   while(i < format.size()) {
  ------------------
  |  Branch (26:10): [True: 52, False: 0]
  ------------------
   27|     52|      if(format[i] == '{' && (format.size() > (i + 1)) && format.at(i + 1) == '}') {
  ------------------
  |  Branch (27:10): [True: 52, False: 0]
  |  Branch (27:30): [True: 52, False: 0]
  |  Branch (27:59): [True: 52, False: 0]
  ------------------
   28|     52|         oss << val;
   29|     52|         return do_fmt(oss, format.substr(i + 2), rest...);
   30|     52|      } else {
   31|      0|         oss << format[i];
   32|      0|      }
   33|       |
   34|      0|      i += 1;
   35|      0|   }
   36|     52|}
_ZN5Botan10fmt_detail6do_fmtIjJEEEvRNSt3__119basic_ostringstreamIcNS2_11char_traitsIcEENS2_9allocatorIcEEEENS2_17basic_string_viewIcS5_EERKT_DpRKT0_:
   23|    158|void do_fmt(std::ostringstream& oss, std::string_view format, const T& val, const Ts&... rest) {
   24|    158|   size_t i = 0;
   25|       |
   26|  3.76k|   while(i < format.size()) {
  ------------------
  |  Branch (26:10): [True: 3.76k, False: 0]
  ------------------
   27|  3.76k|      if(format[i] == '{' && (format.size() > (i + 1)) && format.at(i + 1) == '}') {
  ------------------
  |  Branch (27:10): [True: 158, False: 3.60k]
  |  Branch (27:30): [True: 158, False: 0]
  |  Branch (27:59): [True: 158, False: 0]
  ------------------
   28|    158|         oss << val;
   29|    158|         return do_fmt(oss, format.substr(i + 2), rest...);
   30|  3.60k|      } else {
   31|  3.60k|         oss << format[i];
   32|  3.60k|      }
   33|       |
   34|  3.60k|      i += 1;
   35|  3.60k|   }
   36|    158|}
_ZN5Botan3fmtIJjEEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS1_17basic_string_viewIcS4_EEDpRKT_:
   51|    106|std::string fmt(std::string_view format, const T&... args) {
   52|    106|   std::ostringstream oss;
   53|    106|   oss.imbue(std::locale::classic());
   54|    106|   fmt_detail::do_fmt(oss, format, args...);
   55|    106|   return oss.str();
   56|    106|}

_ZN5Botan11make_uint16Ehh:
   63|  34.0k|inline constexpr uint16_t make_uint16(uint8_t i0, uint8_t i1) {
   64|  34.0k|   return static_cast<uint16_t>((static_cast<uint16_t>(i0) << 8) | i1);
   65|  34.0k|}
_ZN5Botan11make_uint32Ehhhh:
   75|  3.94k|inline constexpr uint32_t make_uint32(uint8_t i0, uint8_t i1, uint8_t i2, uint8_t i3) {
   76|  3.94k|   return ((static_cast<uint32_t>(i0) << 24) | (static_cast<uint32_t>(i1) << 16) | (static_cast<uint32_t>(i2) << 8) |
   77|  3.94k|           (static_cast<uint32_t>(i3)));
   78|  3.94k|}
_ZN5Botan7load_beItEET_PKhm:
  136|  4.99k|inline constexpr uint16_t load_be<uint16_t>(const uint8_t in[], size_t off) {
  137|  4.99k|   in += off * sizeof(uint16_t);
  138|       |
  139|  4.99k|#if defined(BOTAN_ENDIAN_N2B)
  140|  4.99k|   uint16_t x = 0;
  141|  4.99k|   typecast_copy(x, in);
  142|  4.99k|   return BOTAN_ENDIAN_N2B(x);
  ------------------
  |  |   26|  4.99k|   #define BOTAN_ENDIAN_N2B(x) reverse_bytes(x)
  ------------------
  143|       |#else
  144|       |   return make_uint16(in[0], in[1]);
  145|       |#endif
  146|  4.99k|}
_ZN5Botan7load_beIjEET_PKhm:
  174|  40.4k|inline constexpr uint32_t load_be<uint32_t>(const uint8_t in[], size_t off) {
  175|  40.4k|   in += off * sizeof(uint32_t);
  176|  40.4k|#if defined(BOTAN_ENDIAN_N2B)
  177|  40.4k|   uint32_t x = 0;
  178|  40.4k|   typecast_copy(x, in);
  179|  40.4k|   return BOTAN_ENDIAN_N2B(x);
  ------------------
  |  |   26|  40.4k|   #define BOTAN_ENDIAN_N2B(x) reverse_bytes(x)
  ------------------
  180|       |#else
  181|       |   return make_uint32(in[0], in[1], in[2], in[3]);
  182|       |#endif
  183|  40.4k|}
_ZN5Botan8store_beEjPh:
  437|  22.5k|inline constexpr void store_be(uint32_t in, uint8_t out[4]) {
  438|  22.5k|#if defined(BOTAN_ENDIAN_B2N)
  439|  22.5k|   uint32_t o = BOTAN_ENDIAN_B2N(in);
  ------------------
  |  |   27|  22.5k|   #define BOTAN_ENDIAN_B2N(x) reverse_bytes(x)
  ------------------
  440|  22.5k|   typecast_copy(out, o);
  441|       |#else
  442|       |   out[0] = get_byte<0>(in);
  443|       |   out[1] = get_byte<1>(in);
  444|       |   out[2] = get_byte<2>(in);
  445|       |   out[3] = get_byte<3>(in);
  446|       |#endif
  447|  22.5k|}
_ZN5Botan8store_beEmPh:
  471|  2.50k|inline constexpr void store_be(uint64_t in, uint8_t out[8]) {
  472|  2.50k|#if defined(BOTAN_ENDIAN_B2N)
  473|  2.50k|   uint64_t o = BOTAN_ENDIAN_B2N(in);
  ------------------
  |  |   27|  2.50k|   #define BOTAN_ENDIAN_B2N(x) reverse_bytes(x)
  ------------------
  474|  2.50k|   typecast_copy(out, o);
  475|       |#else
  476|       |   out[0] = get_byte<0>(in);
  477|       |   out[1] = get_byte<1>(in);
  478|       |   out[2] = get_byte<2>(in);
  479|       |   out[3] = get_byte<3>(in);
  480|       |   out[4] = get_byte<4>(in);
  481|       |   out[5] = get_byte<5>(in);
  482|       |   out[6] = get_byte<6>(in);
  483|       |   out[7] = get_byte<7>(in);
  484|       |#endif
  485|  2.50k|}
_ZN5Botan8get_byteILm0EmEEhT0_:
   52|  1.22k|{
   53|  1.22k|   const size_t shift = ((~B) & (sizeof(T) - 1)) << 3;
   54|  1.22k|   return static_cast<uint8_t>((input >> shift) & 0xFF);
   55|  1.22k|}
_ZN5Botan12get_byte_varImEEhmT_:
   40|  12.5k|inline constexpr uint8_t get_byte_var(size_t byte_num, T input) {
   41|  12.5k|   return static_cast<uint8_t>(input >> (((~byte_num) & (sizeof(T) - 1)) << 3));
   42|  12.5k|}
_ZN5Botan8get_byteILm1EjEEhT0_:
   52|  4.45k|{
   53|  4.45k|   const size_t shift = ((~B) & (sizeof(T) - 1)) << 3;
   54|  4.45k|   return static_cast<uint8_t>((input >> shift) & 0xFF);
   55|  4.45k|}
_ZN5Botan8get_byteILm2EjEEhT0_:
   52|  4.45k|{
   53|  4.45k|   const size_t shift = ((~B) & (sizeof(T) - 1)) << 3;
   54|  4.45k|   return static_cast<uint8_t>((input >> shift) & 0xFF);
   55|  4.45k|}
_ZN5Botan8get_byteILm3EjEEhT0_:
   52|  4.45k|{
   53|  4.45k|   const size_t shift = ((~B) & (sizeof(T) - 1)) << 3;
   54|  4.45k|   return static_cast<uint8_t>((input >> shift) & 0xFF);
   55|  4.45k|}
_ZN5Botan7load_leIjEEvPT_PKhm:
  298|      2|inline constexpr void load_le(T out[], const uint8_t in[], size_t count) {
  299|      2|   if(count > 0) {
  ------------------
  |  Branch (299:7): [True: 2, False: 0]
  ------------------
  300|      2|#if defined(BOTAN_TARGET_CPU_IS_LITTLE_ENDIAN)
  301|      2|      typecast_copy(out, in, count);
  302|       |
  303|       |#elif defined(BOTAN_TARGET_CPU_IS_BIG_ENDIAN)
  304|       |      typecast_copy(out, in, count);
  305|       |
  306|       |      const size_t blocks = count - (count % 4);
  307|       |      const size_t left = count - blocks;
  308|       |
  309|       |      for(size_t i = 0; i != blocks; i += 4)
  310|       |         bswap_4(out + i);
  311|       |
  312|       |      for(size_t i = 0; i != left; ++i)
  313|       |         out[blocks + i] = reverse_bytes(out[blocks + i]);
  314|       |#else
  315|       |      for(size_t i = 0; i != count; ++i)
  316|       |         out[i] = load_le<T>(in, i);
  317|       |#endif
  318|      2|   }
  319|      2|}
_ZN5Botan15copy_out_vec_beIjNS_16secure_allocatorIjEEEEvPhmRKNSt3__16vectorIT_T0_EE:
  626|  2.50k|void copy_out_vec_be(uint8_t out[], size_t out_bytes, const std::vector<T, Alloc>& in) {
  627|  2.50k|   copy_out_be(out, out_bytes, in.data());
  628|  2.50k|}
_ZN5Botan11copy_out_beIjEEvPhmPKT_:
  613|  2.50k|void copy_out_be(uint8_t out[], size_t out_bytes, const T in[]) {
  614|  22.5k|   while(out_bytes >= sizeof(T)) {
  ------------------
  |  Branch (614:10): [True: 20.0k, False: 2.50k]
  ------------------
  615|  20.0k|      store_be(in[0], out);
  616|  20.0k|      out += sizeof(T);
  617|  20.0k|      out_bytes -= sizeof(T);
  618|  20.0k|      in += 1;
  619|  20.0k|   }
  620|       |
  621|  2.50k|   for(size_t i = 0; i != out_bytes; ++i)
  ------------------
  |  Branch (621:22): [True: 0, False: 2.50k]
  ------------------
  622|      0|      out[i] = get_byte_var(i % 8, in[0]);
  623|  2.50k|}
_ZN5Botan7load_beIhEET_PKhm:
  106|   477k|inline constexpr T load_be(const uint8_t in[], size_t off) {
  107|   477k|   in += off * sizeof(T);
  108|   477k|   T out = 0;
  109|   955k|   for(size_t i = 0; i != sizeof(T); ++i)
  ------------------
  |  Branch (109:22): [True: 477k, False: 477k]
  ------------------
  110|   477k|      out = static_cast<T>((out << 8) | in[i]);
  111|   477k|   return out;
  112|   477k|}
_ZN5Botan8get_byteILm0EtEEhT0_:
   52|  97.2k|{
   53|  97.2k|   const size_t shift = ((~B) & (sizeof(T) - 1)) << 3;
   54|  97.2k|   return static_cast<uint8_t>((input >> shift) & 0xFF);
   55|  97.2k|}
_ZN5Botan8get_byteILm1EtEEhT0_:
   52|  97.2k|{
   53|  97.2k|   const size_t shift = ((~B) & (sizeof(T) - 1)) << 3;
   54|  97.2k|   return static_cast<uint8_t>((input >> shift) & 0xFF);
   55|  97.2k|}
_ZN5Botan12get_byte_varIhEEhmT_:
   40|  2.50k|inline constexpr uint8_t get_byte_var(size_t byte_num, T input) {
   41|  2.50k|   return static_cast<uint8_t>(input >> (((~byte_num) & (sizeof(T) - 1)) << 3));
   42|  2.50k|}
_ZN5Botan8get_byteILm0ENS_3TLS16Signature_Scheme4CodeEEEhT0_:
   52|  22.5k|{
   53|  22.5k|   const size_t shift = ((~B) & (sizeof(T) - 1)) << 3;
   54|  22.5k|   return static_cast<uint8_t>((input >> shift) & 0xFF);
   55|  22.5k|}
_ZN5Botan8get_byteILm1ENS_3TLS16Signature_Scheme4CodeEEEhT0_:
   52|  22.5k|{
   53|  22.5k|   const size_t shift = ((~B) & (sizeof(T) - 1)) << 3;
   54|  22.5k|   return static_cast<uint8_t>((input >> shift) & 0xFF);
   55|  22.5k|}

_ZNK5Botan16MDx_HashFunction15hash_block_sizeEv:
   29|      1|      size_t hash_block_size() const override final { return m_buffer.size(); }

_ZN5Botan4rotrILm18EjEET0_S1_:
   35|   160k|{
   36|   160k|   return static_cast<T>((input >> ROT) | (input << (8 * sizeof(T) - ROT)));
   37|   160k|}
_ZN5Botan4rotrILm6EjEET0_S1_:
   35|   160k|{
   36|   160k|   return static_cast<T>((input >> ROT) | (input << (8 * sizeof(T) - ROT)));
   37|   160k|}
_ZN5Botan4rotrILm2EjEET0_S1_:
   35|   160k|{
   36|   160k|   return static_cast<T>((input >> ROT) | (input << (8 * sizeof(T) - ROT)));
   37|   160k|}
_ZN5Botan4rotrILm22EjEET0_S1_:
   35|   160k|{
   36|   160k|   return static_cast<T>((input >> ROT) | (input << (8 * sizeof(T) - ROT)));
   37|   160k|}
_ZN5Botan4rotrILm7EjEET0_S1_:
   35|   160k|{
   36|   160k|   return static_cast<T>((input >> ROT) | (input << (8 * sizeof(T) - ROT)));
   37|   160k|}
_ZN5Botan4rotrILm13EjEET0_S1_:
   35|   160k|{
   36|   160k|   return static_cast<T>((input >> ROT) | (input << (8 * sizeof(T) - ROT)));
   37|   160k|}
_ZN5Botan3rhoILm2ELm13ELm22EjEET2_S1_:
   51|   160k|inline constexpr T rho(T x) {
   52|   160k|   return rotr<R1>(x) ^ rotr<R2>(x) ^ rotr<R3>(x);
   53|   160k|}
_ZN5Botan3rhoILm6ELm11ELm25EjEET2_S1_:
   51|   160k|inline constexpr T rho(T x) {
   52|   160k|   return rotr<R1>(x) ^ rotr<R2>(x) ^ rotr<R3>(x);
   53|   160k|}
_ZN5Botan4rotrILm11EjEET0_S1_:
   35|   160k|{
   36|   160k|   return static_cast<T>((input >> ROT) | (input << (8 * sizeof(T) - ROT)));
   37|   160k|}
_ZN5Botan4rotrILm25EjEET0_S1_:
   35|   160k|{
   36|   160k|   return static_cast<T>((input >> ROT) | (input << (8 * sizeof(T) - ROT)));
   37|   160k|}
_ZN5Botan5sigmaILm7ELm18ELm3EjEET2_S1_:
   43|   160k|inline constexpr T sigma(T x) {
   44|   160k|   return rotr<R1>(x) ^ rotr<R2>(x) ^ (x >> S);
   45|   160k|}
_ZN5Botan5sigmaILm17ELm19ELm10EjEET2_S1_:
   43|   160k|inline constexpr T sigma(T x) {
   44|   160k|   return rotr<R1>(x) ^ rotr<R2>(x) ^ (x >> S);
   45|   160k|}
_ZN5Botan4rotrILm17EjEET0_S1_:
   35|   160k|{
   36|   160k|   return static_cast<T>((input >> ROT) | (input << (8 * sizeof(T) - ROT)));
   37|   160k|}
_ZN5Botan4rotrILm19EjEET0_S1_:
   35|   160k|{
   36|   160k|   return static_cast<T>((input >> ROT) | (input << (8 * sizeof(T) - ROT)));
   37|   160k|}

_ZN5Botan11checked_mulEmm:
   47|  48.2k|inline std::optional<size_t> checked_mul(size_t x, size_t y) {
   48|  48.2k|#if BOTAN_COMPILER_HAS_BUILTIN(__builtin_add_overflow)
   49|  48.2k|   size_t z;
   50|  48.2k|   if(__builtin_mul_overflow(x, y, &z)) [[unlikely]]
  ------------------
  |  Branch (50:7): [True: 0, False: 48.2k]
  ------------------
   51|       |#elif defined(_MSC_VER)
   52|       |   size_t z;
   53|       |   if(SizeTMult(x, y, &z) != S_OK) [[unlikely]]
   54|       |#else
   55|       |   size_t z = x * y;
   56|       |   if(y && z / y != x) [[unlikely]]
   57|       |#endif
   58|      0|   {
   59|      0|      return std::nullopt;
   60|      0|   }
   61|  48.2k|   return z;
   62|  48.2k|}
_ZN5Botan11checked_addEmmPKci:
   30|  79.8k|inline size_t checked_add(size_t x, size_t y, const char* file, int line) {
   31|  79.8k|#if BOTAN_COMPILER_HAS_BUILTIN(__builtin_add_overflow)
   32|  79.8k|   size_t z;
   33|  79.8k|   if(__builtin_add_overflow(x, y, &z)) [[unlikely]]
  ------------------
  |  Branch (33:7): [True: 0, False: 79.8k]
  ------------------
   34|       |#elif defined(_MSC_VER)
   35|       |   size_t z;
   36|       |   if(SizeTAdd(x, y, &z) != S_OK) [[unlikely]]
   37|       |#else
   38|       |   size_t z = x + y;
   39|       |   if(z < x) [[unlikely]]
   40|       |#endif
   41|      0|   {
   42|      0|      throw Integer_Overflow_Detected(file, line);
   43|      0|   }
   44|  79.8k|   return z;
   45|  79.8k|}

_ZNK5Botan9SCAN_Name9algo_nameEv:
   44|      7|      const std::string algo_name() const { return m_alg_name; }
_ZNK5Botan9SCAN_Name9arg_countEv:
   49|      3|      size_t arg_count() const { return m_args.size(); }
_ZN5Botan18probe_providers_ofINS_11BlockCipherEEENSt3__16vectorINS2_12basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEENS7_IS9_EEEENS2_17basic_string_viewIcS6_EERKSB_:
  106|     88|                                            const std::vector<std::string>& possible = {"base"}) {
  107|     88|   std::vector<std::string> providers;
  108|    176|   for(auto&& prov : possible) {
  ------------------
  |  Branch (108:20): [True: 176, False: 88]
  ------------------
  109|    176|      auto o = T::create(algo_spec, prov);
  110|    176|      if(o) {
  ------------------
  |  Branch (110:10): [True: 88, False: 88]
  ------------------
  111|     88|         providers.push_back(prov);  // available
  112|     88|      }
  113|    176|   }
  114|     88|   return providers;
  115|     88|}
_ZN5Botan18probe_providers_ofINS_12HashFunctionEEENSt3__16vectorINS2_12basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEENS7_IS9_EEEENS2_17basic_string_viewIcS6_EERKSB_:
  106|    124|                                            const std::vector<std::string>& possible = {"base"}) {
  107|    124|   std::vector<std::string> providers;
  108|    248|   for(auto&& prov : possible) {
  ------------------
  |  Branch (108:20): [True: 248, False: 124]
  ------------------
  109|    248|      auto o = T::create(algo_spec, prov);
  110|    248|      if(o) {
  ------------------
  |  Branch (110:10): [True: 124, False: 124]
  ------------------
  111|    124|         providers.push_back(prov);  // available
  112|    124|      }
  113|    248|   }
  114|    124|   return providers;
  115|    124|}

_ZN5Botan5SHA_1C2Ev:
   32|     36|      SHA_1() : MDx_HashFunction(64, true, true), m_digest(5) { clear(); }

_ZN5Botan7SHA_256C2Ev:
   59|  2.56k|      SHA_256() : MDx_HashFunction(64, true, true), m_digest(8) { clear(); }
_ZNK5Botan7SHA_25613output_lengthEv:
   49|  7.50k|      size_t output_length() const override { return 32; }

_ZN5Botan9SHA2_32_FEjjjRjjjjS0_S0_jjjj:
   31|   160k|                                  uint32_t magic) {
   32|   160k|   uint32_t A_rho = rho<2, 13, 22>(A);
   33|   160k|   uint32_t E_rho = rho<6, 11, 25>(E);
   34|   160k|   uint32_t M2_sigma = sigma<17, 19, 10>(M2);
   35|   160k|   uint32_t M4_sigma = sigma<7, 18, 3>(M4);
   36|   160k|   H += magic + E_rho + choose(E, F, G) + M1;
   37|   160k|   D += H;
   38|   160k|   H += A_rho + majority(A, B, C);
   39|   160k|   M1 += M2_sigma + M3 + M4_sigma;
   40|   160k|}

_ZN5Botan7SHA_384C2Ev:
   31|     25|      SHA_384() : MDx_HashFunction(128, true, true, 16), m_digest(8) { clear(); }

_ZN5Botan9SIMD_4x32C2EDv2_x:
  605|      2|      explicit SIMD_4x32(native_simd_type x) noexcept : m_simd(x) {}
_ZN5Botan9SIMD_4x32C2Ejjjj:
  113|     96|      SIMD_4x32(uint32_t B0, uint32_t B1, uint32_t B2, uint32_t B3) noexcept {
  114|     96|#if defined(BOTAN_SIMD_USE_SSE2)
  115|     96|         m_simd = _mm_set_epi32(B3, B2, B1, B0);
  116|       |#elif defined(BOTAN_SIMD_USE_ALTIVEC)
  117|       |         __vector unsigned int val = {B0, B1, B2, B3};
  118|       |         m_simd = val;
  119|       |#elif defined(BOTAN_SIMD_USE_NEON)
  120|       |         // Better way to do this?
  121|       |         const uint32_t B[4] = {B0, B1, B2, B3};
  122|       |         m_simd = vld1q_u32(B);
  123|       |#endif
  124|     96|      }
_ZN5Botan9SIMD_4x328splat_u8Eh:
  142|      2|      static SIMD_4x32 splat_u8(uint8_t B) noexcept {
  143|      2|#if defined(BOTAN_SIMD_USE_SSE2)
  144|      2|         return SIMD_4x32(_mm_set1_epi8(B));
  145|       |#elif defined(BOTAN_SIMD_USE_NEON)
  146|       |         return SIMD_4x32(vreinterpretq_u32_u8(vdupq_n_u8(B)));
  147|       |#else
  148|       |         const uint32_t B4 = make_uint32(B, B, B, B);
  149|       |         return SIMD_4x32(B4, B4, B4, B4);
  150|       |#endif
  151|      2|      }

_ZN5Botan9SIMD_8x3215reset_registersEv:
  303|    158|      static void reset_registers() noexcept { _mm256_zeroupper(); }
_ZN5Botan9SIMD_8x32C2EDv4_x:
  311|  58.1k|      SIMD_8x32(__m256i x) noexcept : m_avx2(x) {}
_ZN5Botan9SIMD_8x329transposeERS0_S1_S1_S1_:
  254|    632|      static void transpose(SIMD_8x32& B0, SIMD_8x32& B1, SIMD_8x32& B2, SIMD_8x32& B3) noexcept {
  255|    632|         const __m256i T0 = _mm256_unpacklo_epi32(B0.m_avx2, B1.m_avx2);
  256|    632|         const __m256i T1 = _mm256_unpacklo_epi32(B2.m_avx2, B3.m_avx2);
  257|    632|         const __m256i T2 = _mm256_unpackhi_epi32(B0.m_avx2, B1.m_avx2);
  258|    632|         const __m256i T3 = _mm256_unpackhi_epi32(B2.m_avx2, B3.m_avx2);
  259|       |
  260|    632|         B0.m_avx2 = _mm256_unpacklo_epi64(T0, T1);
  261|    632|         B1.m_avx2 = _mm256_unpackhi_epi64(T0, T1);
  262|    632|         B2.m_avx2 = _mm256_unpacklo_epi64(T2, T3);
  263|    632|         B3.m_avx2 = _mm256_unpackhi_epi64(T2, T3);
  264|    632|      }
_ZNK5Botan9SIMD_8x328store_leEPh:
   59|  2.52k|      void store_le(uint8_t out[]) const noexcept { _mm256_storeu_si256(reinterpret_cast<__m256i*>(out), m_avx2); }
_ZN5Botan9SIMD_8x3214zero_registersEv:
  306|    158|      static void zero_registers() noexcept { _mm256_zeroall(); }
_ZN5Botan9SIMD_8x325splatEj:
   48|  5.05k|      static SIMD_8x32 splat(uint32_t B) noexcept { return SIMD_8x32(_mm256_set1_epi32(B)); }
_ZN5Botan9SIMD_8x32eOERKS0_:
  209|  50.5k|      void operator^=(const SIMD_8x32& other) { m_avx2 = _mm256_xor_si256(m_avx2, other.m_avx2); }
_ZNK5Botan9SIMD_8x324rotlILm7EEES0_v:
   67|  12.6k|      {
   68|       |#if defined(__AVX512VL__)
   69|       |         return SIMD_8x32(_mm256_rol_epi32(m_avx2, ROT));
   70|       |#else
   71|  12.6k|         if constexpr(ROT == 8) {
  ------------------
  |  Branch (71:23): [Folded - Ignored]
  ------------------
   72|  12.6k|            const __m256i shuf_rotl_8 = _mm256_set_epi8(14,
   73|  12.6k|                                                        13,
   74|  12.6k|                                                        12,
   75|  12.6k|                                                        15,
   76|  12.6k|                                                        10,
   77|  12.6k|                                                        9,
   78|  12.6k|                                                        8,
   79|  12.6k|                                                        11,
   80|  12.6k|                                                        6,
   81|  12.6k|                                                        5,
   82|  12.6k|                                                        4,
   83|  12.6k|                                                        7,
   84|  12.6k|                                                        2,
   85|  12.6k|                                                        1,
   86|  12.6k|                                                        0,
   87|  12.6k|                                                        3,
   88|  12.6k|                                                        14,
   89|  12.6k|                                                        13,
   90|  12.6k|                                                        12,
   91|  12.6k|                                                        15,
   92|  12.6k|                                                        10,
   93|  12.6k|                                                        9,
   94|  12.6k|                                                        8,
   95|  12.6k|                                                        11,
   96|  12.6k|                                                        6,
   97|  12.6k|                                                        5,
   98|  12.6k|                                                        4,
   99|  12.6k|                                                        7,
  100|  12.6k|                                                        2,
  101|  12.6k|                                                        1,
  102|  12.6k|                                                        0,
  103|  12.6k|                                                        3);
  104|       |
  105|  12.6k|            return SIMD_8x32(_mm256_shuffle_epi8(m_avx2, shuf_rotl_8));
  106|  12.6k|         } else if constexpr(ROT == 16) {
  ------------------
  |  Branch (106:30): [Folded - Ignored]
  ------------------
  107|  12.6k|            const __m256i shuf_rotl_16 = _mm256_set_epi8(13,
  108|  12.6k|                                                         12,
  109|  12.6k|                                                         15,
  110|  12.6k|                                                         14,
  111|  12.6k|                                                         9,
  112|  12.6k|                                                         8,
  113|  12.6k|                                                         11,
  114|  12.6k|                                                         10,
  115|  12.6k|                                                         5,
  116|  12.6k|                                                         4,
  117|  12.6k|                                                         7,
  118|  12.6k|                                                         6,
  119|  12.6k|                                                         1,
  120|  12.6k|                                                         0,
  121|  12.6k|                                                         3,
  122|  12.6k|                                                         2,
  123|  12.6k|                                                         13,
  124|  12.6k|                                                         12,
  125|  12.6k|                                                         15,
  126|  12.6k|                                                         14,
  127|  12.6k|                                                         9,
  128|  12.6k|                                                         8,
  129|  12.6k|                                                         11,
  130|  12.6k|                                                         10,
  131|  12.6k|                                                         5,
  132|  12.6k|                                                         4,
  133|  12.6k|                                                         7,
  134|  12.6k|                                                         6,
  135|  12.6k|                                                         1,
  136|  12.6k|                                                         0,
  137|  12.6k|                                                         3,
  138|  12.6k|                                                         2);
  139|       |
  140|  12.6k|            return SIMD_8x32(_mm256_shuffle_epi8(m_avx2, shuf_rotl_16));
  141|  12.6k|         } else {
  142|  12.6k|            return SIMD_8x32(_mm256_or_si256(_mm256_slli_epi32(m_avx2, static_cast<int>(ROT)),
  143|  12.6k|                                             _mm256_srli_epi32(m_avx2, static_cast<int>(32 - ROT))));
  144|  12.6k|         }
  145|  12.6k|#endif
  146|  12.6k|      }
_ZN5Botan9SIMD_8x32C2Ejjjjjjjj:
   43|    316|                         uint32_t B7) noexcept {
   44|    316|         m_avx2 = _mm256_set_epi32(B7, B6, B5, B4, B3, B2, B1, B0);
   45|    316|      }
_ZNK5Botan9SIMD_8x32plERKS0_:
  168|    632|      SIMD_8x32 operator+(const SIMD_8x32& other) const noexcept {
  169|    632|         SIMD_8x32 retval(*this);
  170|    632|         retval += other;
  171|    632|         return retval;
  172|    632|      }
_ZN5Botan9SIMD_8x32pLERKS0_:
  203|  53.7k|      void operator+=(const SIMD_8x32& other) { m_avx2 = _mm256_add_epi32(m_avx2, other.m_avx2); }
_ZN5Botan9SIMD_8x329transposeERS0_S1_S1_S1_S1_S1_S1_S1_:
  274|    316|                            SIMD_8x32& B7) noexcept {
  275|    316|         transpose(B0, B1, B2, B3);
  276|    316|         transpose(B4, B5, B6, B7);
  277|       |
  278|    316|         swap_tops(B0, B4);
  279|    316|         swap_tops(B1, B5);
  280|    316|         swap_tops(B2, B6);
  281|    316|         swap_tops(B3, B7);
  282|    316|      }
_ZNK5Botan9SIMD_8x326handleEv:
  308|  5.05k|      __m256i BOTAN_AVX2_FN handle() const noexcept { return m_avx2; }
_ZN5Botan9SIMD_8x329swap_topsERS0_S1_:
  315|  1.26k|      static void swap_tops(SIMD_8x32& A, SIMD_8x32& B) {
  316|  1.26k|         SIMD_8x32 T0 = _mm256_permute2x128_si256(A.handle(), B.handle(), 0 + (2 << 4));
  317|  1.26k|         SIMD_8x32 T1 = _mm256_permute2x128_si256(A.handle(), B.handle(), 1 + (3 << 4));
  318|  1.26k|         A = T0;
  319|  1.26k|         B = T1;
  320|  1.26k|      }
_ZNK5Botan9SIMD_8x324rotlILm16EEES0_v:
   67|  12.6k|      {
   68|       |#if defined(__AVX512VL__)
   69|       |         return SIMD_8x32(_mm256_rol_epi32(m_avx2, ROT));
   70|       |#else
   71|  12.6k|         if constexpr(ROT == 8) {
  ------------------
  |  Branch (71:23): [Folded - Ignored]
  ------------------
   72|  12.6k|            const __m256i shuf_rotl_8 = _mm256_set_epi8(14,
   73|  12.6k|                                                        13,
   74|  12.6k|                                                        12,
   75|  12.6k|                                                        15,
   76|  12.6k|                                                        10,
   77|  12.6k|                                                        9,
   78|  12.6k|                                                        8,
   79|  12.6k|                                                        11,
   80|  12.6k|                                                        6,
   81|  12.6k|                                                        5,
   82|  12.6k|                                                        4,
   83|  12.6k|                                                        7,
   84|  12.6k|                                                        2,
   85|  12.6k|                                                        1,
   86|  12.6k|                                                        0,
   87|  12.6k|                                                        3,
   88|  12.6k|                                                        14,
   89|  12.6k|                                                        13,
   90|  12.6k|                                                        12,
   91|  12.6k|                                                        15,
   92|  12.6k|                                                        10,
   93|  12.6k|                                                        9,
   94|  12.6k|                                                        8,
   95|  12.6k|                                                        11,
   96|  12.6k|                                                        6,
   97|  12.6k|                                                        5,
   98|  12.6k|                                                        4,
   99|  12.6k|                                                        7,
  100|  12.6k|                                                        2,
  101|  12.6k|                                                        1,
  102|  12.6k|                                                        0,
  103|  12.6k|                                                        3);
  104|       |
  105|  12.6k|            return SIMD_8x32(_mm256_shuffle_epi8(m_avx2, shuf_rotl_8));
  106|  12.6k|         } else if constexpr(ROT == 16) {
  ------------------
  |  Branch (106:30): [Folded - Ignored]
  ------------------
  107|  12.6k|            const __m256i shuf_rotl_16 = _mm256_set_epi8(13,
  108|  12.6k|                                                         12,
  109|  12.6k|                                                         15,
  110|  12.6k|                                                         14,
  111|  12.6k|                                                         9,
  112|  12.6k|                                                         8,
  113|  12.6k|                                                         11,
  114|  12.6k|                                                         10,
  115|  12.6k|                                                         5,
  116|  12.6k|                                                         4,
  117|  12.6k|                                                         7,
  118|  12.6k|                                                         6,
  119|  12.6k|                                                         1,
  120|  12.6k|                                                         0,
  121|  12.6k|                                                         3,
  122|  12.6k|                                                         2,
  123|  12.6k|                                                         13,
  124|  12.6k|                                                         12,
  125|  12.6k|                                                         15,
  126|  12.6k|                                                         14,
  127|  12.6k|                                                         9,
  128|  12.6k|                                                         8,
  129|  12.6k|                                                         11,
  130|  12.6k|                                                         10,
  131|  12.6k|                                                         5,
  132|  12.6k|                                                         4,
  133|  12.6k|                                                         7,
  134|  12.6k|                                                         6,
  135|  12.6k|                                                         1,
  136|  12.6k|                                                         0,
  137|  12.6k|                                                         3,
  138|  12.6k|                                                         2);
  139|       |
  140|  12.6k|            return SIMD_8x32(_mm256_shuffle_epi8(m_avx2, shuf_rotl_16));
  141|  12.6k|         } else {
  142|  12.6k|            return SIMD_8x32(_mm256_or_si256(_mm256_slli_epi32(m_avx2, static_cast<int>(ROT)),
  143|  12.6k|                                             _mm256_srli_epi32(m_avx2, static_cast<int>(32 - ROT))));
  144|  12.6k|         }
  145|  12.6k|#endif
  146|  12.6k|      }
_ZNK5Botan9SIMD_8x324rotlILm12EEES0_v:
   67|  12.6k|      {
   68|       |#if defined(__AVX512VL__)
   69|       |         return SIMD_8x32(_mm256_rol_epi32(m_avx2, ROT));
   70|       |#else
   71|  12.6k|         if constexpr(ROT == 8) {
  ------------------
  |  Branch (71:23): [Folded - Ignored]
  ------------------
   72|  12.6k|            const __m256i shuf_rotl_8 = _mm256_set_epi8(14,
   73|  12.6k|                                                        13,
   74|  12.6k|                                                        12,
   75|  12.6k|                                                        15,
   76|  12.6k|                                                        10,
   77|  12.6k|                                                        9,
   78|  12.6k|                                                        8,
   79|  12.6k|                                                        11,
   80|  12.6k|                                                        6,
   81|  12.6k|                                                        5,
   82|  12.6k|                                                        4,
   83|  12.6k|                                                        7,
   84|  12.6k|                                                        2,
   85|  12.6k|                                                        1,
   86|  12.6k|                                                        0,
   87|  12.6k|                                                        3,
   88|  12.6k|                                                        14,
   89|  12.6k|                                                        13,
   90|  12.6k|                                                        12,
   91|  12.6k|                                                        15,
   92|  12.6k|                                                        10,
   93|  12.6k|                                                        9,
   94|  12.6k|                                                        8,
   95|  12.6k|                                                        11,
   96|  12.6k|                                                        6,
   97|  12.6k|                                                        5,
   98|  12.6k|                                                        4,
   99|  12.6k|                                                        7,
  100|  12.6k|                                                        2,
  101|  12.6k|                                                        1,
  102|  12.6k|                                                        0,
  103|  12.6k|                                                        3);
  104|       |
  105|  12.6k|            return SIMD_8x32(_mm256_shuffle_epi8(m_avx2, shuf_rotl_8));
  106|  12.6k|         } else if constexpr(ROT == 16) {
  ------------------
  |  Branch (106:30): [Folded - Ignored]
  ------------------
  107|  12.6k|            const __m256i shuf_rotl_16 = _mm256_set_epi8(13,
  108|  12.6k|                                                         12,
  109|  12.6k|                                                         15,
  110|  12.6k|                                                         14,
  111|  12.6k|                                                         9,
  112|  12.6k|                                                         8,
  113|  12.6k|                                                         11,
  114|  12.6k|                                                         10,
  115|  12.6k|                                                         5,
  116|  12.6k|                                                         4,
  117|  12.6k|                                                         7,
  118|  12.6k|                                                         6,
  119|  12.6k|                                                         1,
  120|  12.6k|                                                         0,
  121|  12.6k|                                                         3,
  122|  12.6k|                                                         2,
  123|  12.6k|                                                         13,
  124|  12.6k|                                                         12,
  125|  12.6k|                                                         15,
  126|  12.6k|                                                         14,
  127|  12.6k|                                                         9,
  128|  12.6k|                                                         8,
  129|  12.6k|                                                         11,
  130|  12.6k|                                                         10,
  131|  12.6k|                                                         5,
  132|  12.6k|                                                         4,
  133|  12.6k|                                                         7,
  134|  12.6k|                                                         6,
  135|  12.6k|                                                         1,
  136|  12.6k|                                                         0,
  137|  12.6k|                                                         3,
  138|  12.6k|                                                         2);
  139|       |
  140|  12.6k|            return SIMD_8x32(_mm256_shuffle_epi8(m_avx2, shuf_rotl_16));
  141|  12.6k|         } else {
  142|  12.6k|            return SIMD_8x32(_mm256_or_si256(_mm256_slli_epi32(m_avx2, static_cast<int>(ROT)),
  143|  12.6k|                                             _mm256_srli_epi32(m_avx2, static_cast<int>(32 - ROT))));
  144|  12.6k|         }
  145|  12.6k|#endif
  146|  12.6k|      }
_ZNK5Botan9SIMD_8x324rotlILm8EEES0_v:
   67|  12.6k|      {
   68|       |#if defined(__AVX512VL__)
   69|       |         return SIMD_8x32(_mm256_rol_epi32(m_avx2, ROT));
   70|       |#else
   71|  12.6k|         if constexpr(ROT == 8) {
  ------------------
  |  Branch (71:23): [Folded - Ignored]
  ------------------
   72|  12.6k|            const __m256i shuf_rotl_8 = _mm256_set_epi8(14,
   73|  12.6k|                                                        13,
   74|  12.6k|                                                        12,
   75|  12.6k|                                                        15,
   76|  12.6k|                                                        10,
   77|  12.6k|                                                        9,
   78|  12.6k|                                                        8,
   79|  12.6k|                                                        11,
   80|  12.6k|                                                        6,
   81|  12.6k|                                                        5,
   82|  12.6k|                                                        4,
   83|  12.6k|                                                        7,
   84|  12.6k|                                                        2,
   85|  12.6k|                                                        1,
   86|  12.6k|                                                        0,
   87|  12.6k|                                                        3,
   88|  12.6k|                                                        14,
   89|  12.6k|                                                        13,
   90|  12.6k|                                                        12,
   91|  12.6k|                                                        15,
   92|  12.6k|                                                        10,
   93|  12.6k|                                                        9,
   94|  12.6k|                                                        8,
   95|  12.6k|                                                        11,
   96|  12.6k|                                                        6,
   97|  12.6k|                                                        5,
   98|  12.6k|                                                        4,
   99|  12.6k|                                                        7,
  100|  12.6k|                                                        2,
  101|  12.6k|                                                        1,
  102|  12.6k|                                                        0,
  103|  12.6k|                                                        3);
  104|       |
  105|  12.6k|            return SIMD_8x32(_mm256_shuffle_epi8(m_avx2, shuf_rotl_8));
  106|  12.6k|         } else if constexpr(ROT == 16) {
  107|  12.6k|            const __m256i shuf_rotl_16 = _mm256_set_epi8(13,
  108|  12.6k|                                                         12,
  109|  12.6k|                                                         15,
  110|  12.6k|                                                         14,
  111|  12.6k|                                                         9,
  112|  12.6k|                                                         8,
  113|  12.6k|                                                         11,
  114|  12.6k|                                                         10,
  115|  12.6k|                                                         5,
  116|  12.6k|                                                         4,
  117|  12.6k|                                                         7,
  118|  12.6k|                                                         6,
  119|  12.6k|                                                         1,
  120|  12.6k|                                                         0,
  121|  12.6k|                                                         3,
  122|  12.6k|                                                         2,
  123|  12.6k|                                                         13,
  124|  12.6k|                                                         12,
  125|  12.6k|                                                         15,
  126|  12.6k|                                                         14,
  127|  12.6k|                                                         9,
  128|  12.6k|                                                         8,
  129|  12.6k|                                                         11,
  130|  12.6k|                                                         10,
  131|  12.6k|                                                         5,
  132|  12.6k|                                                         4,
  133|  12.6k|                                                         7,
  134|  12.6k|                                                         6,
  135|  12.6k|                                                         1,
  136|  12.6k|                                                         0,
  137|  12.6k|                                                         3,
  138|  12.6k|                                                         2);
  139|       |
  140|  12.6k|            return SIMD_8x32(_mm256_shuffle_epi8(m_avx2, shuf_rotl_16));
  141|  12.6k|         } else {
  142|  12.6k|            return SIMD_8x32(_mm256_or_si256(_mm256_slli_epi32(m_avx2, static_cast<int>(ROT)),
  143|  12.6k|                                             _mm256_srli_epi32(m_avx2, static_cast<int>(32 - ROT))));
  144|  12.6k|         }
  145|  12.6k|#endif
  146|  12.6k|      }

_ZN5Botan12value_existsINSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS1_17basic_string_viewIcS4_EEEEbRKNS1_6vectorIT_NS5_ISB_EEEERKT0_:
   89|  45.0k|bool value_exists(const std::vector<T>& vec, const OT& val) {
   90|  82.5k|   for(size_t i = 0; i != vec.size(); ++i)
  ------------------
  |  Branch (90:22): [True: 82.5k, False: 0]
  ------------------
   91|  82.5k|      if(vec[i] == val)
  ------------------
  |  Branch (91:10): [True: 45.0k, False: 37.5k]
  ------------------
   92|  45.0k|         return true;
   93|      0|   return false;
   94|  45.0k|}
_ZN5Botan12value_existsINS_3TLS12Group_ParamsES2_EEbRKNSt3__16vectorIT_NS3_9allocatorIS5_EEEERKT0_:
   89|  2.67k|bool value_exists(const std::vector<T>& vec, const OT& val) {
   90|   214k|   for(size_t i = 0; i != vec.size(); ++i)
  ------------------
  |  Branch (90:22): [True: 212k, False: 1.61k]
  ------------------
   91|   212k|      if(vec[i] == val)
  ------------------
  |  Branch (91:10): [True: 1.06k, False: 211k]
  ------------------
   92|  1.06k|         return true;
   93|  1.61k|   return false;
   94|  2.67k|}

_ZNK5Botan3TLS12Channel_Impl14is_downgradingEv:
  255|    292|      bool is_downgrading() const { return m_downgrade_info && m_downgrade_info->will_downgrade; }
  ------------------
  |  Branch (255:44): [True: 0, False: 292]
  |  Branch (255:64): [True: 0, False: 0]
  ------------------
_ZN5Botan3TLS12Channel_Impl18send_warning_alertENS0_9AlertTypeE:
   70|    590|      void send_warning_alert(Alert::Type type) { send_alert(Alert(type, false)); }
_ZN5Botan3TLS12Channel_Impl16send_fatal_alertENS0_9AlertTypeE:
   75|  2.20k|      void send_fatal_alert(Alert::Type type) { send_alert(Alert(type, true)); }
_ZN5Botan3TLS12Channel_ImplD2Ev:
   45|  2.50k|      virtual ~Channel_Impl() = default;

_ZN5Botan3TLS15Channel_Impl_123rngEv:
  169|  2.50k|      RandomNumberGenerator& rng() { return *m_rng; }
_ZN5Botan3TLS15Channel_Impl_1215session_managerEv:
  171|  2.50k|      Session_Manager& session_manager() { return *m_session_manager; }
_ZNK5Botan3TLS15Channel_Impl_126policyEv:
  173|  5.00k|      const Policy& policy() const { return *m_policy; }
_ZNK5Botan3TLS15Channel_Impl_129callbacksEv:
  175|  16.6k|      Callbacks& callbacks() const { return *m_callbacks; }
_ZNK5Botan3TLS15Channel_Impl_1212active_stateEv:
  201|  21.8k|      const Handshake_State* active_state() const { return m_active_state.get(); }
_ZNK5Botan3TLS15Channel_Impl_1213pending_stateEv:
  203|  16.1k|      const Handshake_State* pending_state() const { return m_pending_state.get(); }

_ZN5Botan3TLS14Handshake_Hash6updateERKNSt3__16vectorIhNS2_9allocatorIhEEEE:
   25|  4.45k|      void update(const std::vector<uint8_t>& in) { m_data += in; }

_ZN5Botan3TLS19Stream_Handshake_IOC2ENSt3__18functionIFvNS0_11Record_TypeERKNS2_6vectorIhNS2_9allocatorIhEEEEEEE:
   87|  3.66k|      explicit Stream_Handshake_IO(writer_fn writer) : m_send_hs(writer) {}
_ZN5Botan3TLS12Handshake_IOC2Ev:
   71|  3.66k|      Handshake_IO() = default;
_ZN5Botan3TLS12Handshake_IOD2Ev:
   77|  3.66k|      virtual ~Handshake_IO() = default;

_ZN5Botan3TLS15Handshake_State12handshake_ioEv:
   67|  9.88k|      Handshake_IO& handshake_io() { return *m_handshake_io; }
_ZNK5Botan3TLS15Handshake_State7versionEv:
  104|  7.20k|      Protocol_Version version() const { return m_version; }
_ZNK5Botan3TLS15Handshake_State12client_helloEv:
  131|  5.03k|      const Client_Hello_12* client_hello() const { return m_client_hello.get(); }
_ZNK5Botan3TLS15Handshake_State12server_helloEv:
  133|  4.43k|      const Server_Hello_12* server_hello() const { return m_server_hello.get(); }
_ZN5Botan3TLS15Handshake_State4hashEv:
  169|  4.45k|      Handshake_Hash& hash() { return m_handshake_hash; }

_ZN5Botan3TLS15TLS_Data_Reader12get_uint16_tEv:
   67|  25.9k|      uint16_t get_uint16_t() {
   68|  25.9k|         assert_at_least(2);
   69|  25.9k|         uint16_t result = make_uint16(m_buf[m_offset], m_buf[m_offset + 1]);
   70|  25.9k|         m_offset += 2;
   71|  25.9k|         return result;
   72|  25.9k|      }
_ZNK5Botan3TLS15TLS_Data_Reader15assert_at_leastEm:
  157|  74.8k|      void assert_at_least(size_t n) const {
  158|  74.8k|         if(m_buf.size() - m_offset < n)
  ------------------
  |  Branch (158:13): [True: 403, False: 74.4k]
  ------------------
  159|    403|            throw_decode_error("Expected " + std::to_string(n) + " bytes remaining, only " +
  160|    403|                               std::to_string(m_buf.size() - m_offset) + " left");
  161|  74.8k|      }
_ZNK5Botan3TLS15TLS_Data_Reader18throw_decode_errorENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEE:
  163|    458|      [[noreturn]] void throw_decode_error(std::string_view why) const {
  164|    458|         throw Decoding_Error(fmt("Invalid {}: {}", m_typename, why));
  165|    458|      }
_ZNK5Botan3TLS15TLS_Data_Reader13has_remainingEv:
   40|  17.2k|      bool has_remaining() const { return (remaining_bytes() > 0); }
_ZNK5Botan3TLS15TLS_Data_Reader15remaining_bytesEv:
   38|  27.2k|      size_t remaining_bytes() const { return m_buf.size() - m_offset; }
_ZN5Botan3TLS15TLS_Data_Reader20get_tls_length_valueEm:
  100|  1.90k|      std::vector<uint8_t> get_tls_length_value(size_t len_bytes) {
  101|  1.90k|         return get_fixed<uint8_t>(get_length_field(len_bytes));
  102|  1.90k|      }
_ZN5Botan3TLS15TLS_Data_Reader9get_fixedIhEENSt3__16vectorIT_NS3_9allocatorIS5_EEEEm:
  125|  16.1k|      std::vector<T> get_fixed(size_t size) {
  126|  16.1k|         return get_elem<T, std::vector<T>>(size);
  127|  16.1k|      }
_ZN5Botan3TLS15TLS_Data_Reader8get_elemIhNSt3__16vectorIhNS3_9allocatorIhEEEEEET0_m:
   87|  21.8k|      Container get_elem(size_t num_elems) {
   88|  21.8k|         assert_at_least(num_elems * sizeof(T));
   89|       |
   90|  21.8k|         Container result(num_elems);
   91|       |
   92|   499k|         for(size_t i = 0; i != num_elems; ++i)
  ------------------
  |  Branch (92:28): [True: 477k, False: 21.8k]
  ------------------
   93|   477k|            result[i] = load_be<T>(&m_buf[m_offset], i);
   94|       |
   95|  21.8k|         m_offset += num_elems * sizeof(T);
   96|       |
   97|  21.8k|         return result;
   98|  21.8k|      }
_ZN5Botan3TLS15TLS_Data_Reader16get_length_fieldEm:
  130|  7.65k|      size_t get_length_field(size_t len_bytes) {
  131|  7.65k|         assert_at_least(len_bytes);
  132|       |
  133|  7.65k|         if(len_bytes == 1)
  ------------------
  |  Branch (133:13): [True: 5.51k, False: 2.13k]
  ------------------
  134|  5.51k|            return get_byte();
  135|  2.13k|         else if(len_bytes == 2)
  ------------------
  |  Branch (135:18): [True: 2.11k, False: 22]
  ------------------
  136|  2.11k|            return get_uint16_t();
  137|     22|         else if(len_bytes == 3)
  ------------------
  |  Branch (137:18): [True: 0, False: 22]
  ------------------
  138|      0|            return get_uint24_t();
  139|       |
  140|     22|         throw_decode_error("Bad length size");
  141|     22|      }
_ZN5Botan3TLS15TLS_Data_Reader8get_byteEv:
   79|  19.4k|      uint8_t get_byte() {
   80|  19.4k|         assert_at_least(1);
   81|  19.4k|         uint8_t result = m_buf[m_offset];
   82|  19.4k|         m_offset += 1;
   83|  19.4k|         return result;
   84|  19.4k|      }
_ZN5Botan3TLS23append_tls_length_valueIhNSt3__19allocatorIhEES4_EEvRNS2_6vectorIhT0_EERKNS5_IT_T1_EEm:
  196|  7.50k|void append_tls_length_value(std::vector<uint8_t, Alloc>& buf, const std::vector<T, Alloc2>& vals, size_t tag_size) {
  197|  7.50k|   append_tls_length_value(buf, vals.data(), vals.size(), tag_size);
  198|  7.50k|}
_ZN5Botan3TLS23append_tls_length_valueIhNSt3__19allocatorIhEEEEvRNS2_6vectorIhT0_EEPKT_mm:
  176|  7.50k|void append_tls_length_value(std::vector<uint8_t, Alloc>& buf, const T* vals, size_t vals_size, size_t tag_size) {
  177|  7.50k|   const size_t T_size = sizeof(T);
  178|  7.50k|   const size_t val_bytes = T_size * vals_size;
  179|       |
  180|  7.50k|   if(tag_size != 1 && tag_size != 2 && tag_size != 3)
  ------------------
  |  Branch (180:7): [True: 0, False: 7.50k]
  |  Branch (180:24): [True: 0, False: 0]
  |  Branch (180:41): [True: 0, False: 0]
  ------------------
  181|      0|      throw Invalid_Argument("append_tls_length_value: invalid tag size");
  182|       |
  183|  7.50k|   if((tag_size == 1 && val_bytes > 255) || (tag_size == 2 && val_bytes > 65535) ||
  ------------------
  |  Branch (183:8): [True: 7.50k, False: 0]
  |  Branch (183:25): [True: 0, False: 7.50k]
  |  Branch (183:46): [True: 0, False: 7.50k]
  |  Branch (183:63): [True: 0, False: 0]
  ------------------
  184|  7.50k|      (tag_size == 3 && val_bytes > 16777215))
  ------------------
  |  Branch (184:8): [True: 0, False: 7.50k]
  |  Branch (184:25): [True: 0, False: 0]
  ------------------
  185|      0|      throw Invalid_Argument("append_tls_length_value: value too large");
  186|       |
  187|  15.0k|   for(size_t i = 0; i != tag_size; ++i)
  ------------------
  |  Branch (187:22): [True: 7.50k, False: 7.50k]
  ------------------
  188|  7.50k|      buf.push_back(get_byte_var(sizeof(val_bytes) - tag_size + i, val_bytes));
  189|       |
  190|  10.0k|   for(size_t i = 0; i != vals_size; ++i)
  ------------------
  |  Branch (190:22): [True: 2.50k, False: 7.50k]
  ------------------
  191|  5.00k|      for(size_t j = 0; j != T_size; ++j)
  ------------------
  |  Branch (191:25): [True: 2.50k, False: 2.50k]
  ------------------
  192|  2.50k|         buf.push_back(get_byte_var(j, vals[i]));
  193|  7.50k|}
_ZN5Botan3TLS15TLS_Data_ReaderC2EPKcNSt3__14spanIKhLm18446744073709551615EEE:
   29|  9.05k|            m_typename(type), m_buf(buf_in), m_offset(0) {}
_ZNK5Botan3TLS15TLS_Data_Reader11assert_doneEv:
   31|  5.82k|      void assert_done() const {
   32|  5.82k|         if(has_remaining())
  ------------------
  |  Branch (32:13): [True: 39, False: 5.78k]
  ------------------
   33|     39|            throw_decode_error("Extra bytes at end of message");
   34|  5.82k|      }
_ZN5Botan3TLS15TLS_Data_Reader12discard_nextEm:
   48|     32|      void discard_next(size_t bytes) {
   49|     32|         assert_at_least(bytes);
   50|     32|         m_offset += bytes;
   51|     32|      }
_ZN5Botan3TLS15TLS_Data_Reader10get_stringEmmm:
  118|  3.70k|      std::string get_string(size_t len_bytes, size_t min_bytes, size_t max_bytes) {
  119|  3.70k|         std::vector<uint8_t> v = get_range_vector<uint8_t>(len_bytes, min_bytes, max_bytes);
  120|       |
  121|  3.70k|         return std::string(cast_uint8_ptr_to_char(v.data()), v.size());
  122|  3.70k|      }
_ZN5Botan3TLS15TLS_Data_Reader13get_num_elemsEmmmm:
  143|  5.75k|      size_t get_num_elems(size_t len_bytes, size_t T_size, size_t min_elems, size_t max_elems) {
  144|  5.75k|         const size_t byte_length = get_length_field(len_bytes);
  145|       |
  146|  5.75k|         if(byte_length % T_size != 0)
  ------------------
  |  Branch (146:13): [True: 1, False: 5.74k]
  ------------------
  147|      1|            throw_decode_error("Size isn't multiple of T");
  148|       |
  149|  5.75k|         const size_t num_elems = byte_length / T_size;
  150|       |
  151|  5.75k|         if(num_elems < min_elems || num_elems > max_elems)
  ------------------
  |  Branch (151:13): [True: 19, False: 5.73k]
  |  Branch (151:38): [True: 12, False: 5.71k]
  ------------------
  152|     15|            throw_decode_error("Length field outside parameters");
  153|       |
  154|  5.75k|         return num_elems;
  155|  5.75k|      }
_ZN5Botan3TLS15TLS_Data_Reader16get_range_vectorIhEENSt3__16vectorIT_NS3_9allocatorIS5_EEEEmmm:
  112|  3.70k|      std::vector<T> get_range_vector(size_t len_bytes, size_t min_elems, size_t max_elems) {
  113|  3.70k|         const size_t num_elems = get_num_elems(len_bytes, sizeof(T), min_elems, max_elems);
  114|       |
  115|  3.70k|         return get_elem<T, std::vector<T>>(num_elems);
  116|  3.70k|      }
_ZN5Botan3TLS15TLS_Data_Reader9get_rangeIhEENSt3__16vectorIT_NS3_9allocatorIS5_EEEEmmm:
  105|  2.00k|      std::vector<T> get_range(size_t len_bytes, size_t min_elems, size_t max_elems) {
  106|  2.00k|         const size_t num_elems = get_num_elems(len_bytes, sizeof(T), min_elems, max_elems);
  107|       |
  108|  2.00k|         return get_elem<T, std::vector<T>>(num_elems);
  109|  2.00k|      }
_ZN5Botan3TLS15TLS_Data_Reader9get_rangeItEENSt3__16vectorIT_NS3_9allocatorIS5_EEEEmmm:
  105|     38|      std::vector<T> get_range(size_t len_bytes, size_t min_elems, size_t max_elems) {
  106|     38|         const size_t num_elems = get_num_elems(len_bytes, sizeof(T), min_elems, max_elems);
  107|       |
  108|     38|         return get_elem<T, std::vector<T>>(num_elems);
  109|     38|      }
_ZN5Botan3TLS15TLS_Data_Reader8get_elemItNSt3__16vectorItNS3_9allocatorItEEEEEET0_m:
   87|     36|      Container get_elem(size_t num_elems) {
   88|     36|         assert_at_least(num_elems * sizeof(T));
   89|       |
   90|     36|         Container result(num_elems);
   91|       |
   92|  2.11k|         for(size_t i = 0; i != num_elems; ++i)
  ------------------
  |  Branch (92:28): [True: 2.08k, False: 36]
  ------------------
   93|  2.08k|            result[i] = load_be<T>(&m_buf[m_offset], i);
   94|       |
   95|     36|         m_offset += num_elems * sizeof(T);
   96|       |
   97|     36|         return result;
   98|     36|      }
_ZN5Botan3TLS23append_tls_length_valueItNSt3__19allocatorIhEENS3_ItEEEEvRNS2_6vectorIhT0_EERKNS6_IT_T1_EEm:
  196|  2.50k|void append_tls_length_value(std::vector<uint8_t, Alloc>& buf, const std::vector<T, Alloc2>& vals, size_t tag_size) {
  197|  2.50k|   append_tls_length_value(buf, vals.data(), vals.size(), tag_size);
  198|  2.50k|}
_ZN5Botan3TLS23append_tls_length_valueItNSt3__19allocatorIhEEEEvRNS2_6vectorIhT0_EEPKT_mm:
  176|  2.50k|void append_tls_length_value(std::vector<uint8_t, Alloc>& buf, const T* vals, size_t vals_size, size_t tag_size) {
  177|  2.50k|   const size_t T_size = sizeof(T);
  178|  2.50k|   const size_t val_bytes = T_size * vals_size;
  179|       |
  180|  2.50k|   if(tag_size != 1 && tag_size != 2 && tag_size != 3)
  ------------------
  |  Branch (180:7): [True: 2.50k, False: 0]
  |  Branch (180:24): [True: 0, False: 2.50k]
  |  Branch (180:41): [True: 0, False: 0]
  ------------------
  181|      0|      throw Invalid_Argument("append_tls_length_value: invalid tag size");
  182|       |
  183|  2.50k|   if((tag_size == 1 && val_bytes > 255) || (tag_size == 2 && val_bytes > 65535) ||
  ------------------
  |  Branch (183:8): [True: 0, False: 2.50k]
  |  Branch (183:25): [True: 0, False: 0]
  |  Branch (183:46): [True: 2.50k, False: 0]
  |  Branch (183:63): [True: 0, False: 2.50k]
  ------------------
  184|  2.50k|      (tag_size == 3 && val_bytes > 16777215))
  ------------------
  |  Branch (184:8): [True: 0, False: 2.50k]
  |  Branch (184:25): [True: 0, False: 0]
  ------------------
  185|      0|      throw Invalid_Argument("append_tls_length_value: value too large");
  186|       |
  187|  7.50k|   for(size_t i = 0; i != tag_size; ++i)
  ------------------
  |  Branch (187:22): [True: 5.00k, False: 2.50k]
  ------------------
  188|  5.00k|      buf.push_back(get_byte_var(sizeof(val_bytes) - tag_size + i, val_bytes));
  189|       |
  190|  2.50k|   for(size_t i = 0; i != vals_size; ++i)
  ------------------
  |  Branch (190:22): [True: 0, False: 2.50k]
  ------------------
  191|      0|      for(size_t j = 0; j != T_size; ++j)
  ------------------
  |  Branch (191:25): [True: 0, False: 0]
  ------------------
  192|      0|         buf.push_back(get_byte_var(j, vals[i]));
  193|  2.50k|}

_ZN5Botan3TLS13Record_HeaderC2EmNS0_16Protocol_VersionENS0_11Record_TypeE:
   75|  8.21k|            m_needed(0), m_sequence(sequence), m_version(version), m_type(type) {}
_ZN5Botan3TLS13Record_HeaderC2Em:
   78|     89|            m_needed(needed), m_sequence(0), m_version(Protocol_Version()), m_type(Record_Type::Invalid) {}
_ZNK5Botan3TLS13Record_Header6neededEv:
   80|  8.30k|      size_t needed() const { return m_needed; }
_ZNK5Botan3TLS13Record_Header7versionEv:
   82|  6.59k|      Protocol_Version version() const {
   83|  6.59k|         BOTAN_ASSERT_NOMSG(m_needed == 0);
  ------------------
  |  |   60|  6.59k|   do {                                                                     \
  |  |   61|  6.59k|      if(!(expr))                                                           \
  |  |  ------------------
  |  |  |  Branch (61:10): [True: 0, False: 6.59k]
  |  |  ------------------
  |  |   62|  6.59k|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   63|  6.59k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (63:12): [Folded - Ignored]
  |  |  ------------------
  ------------------
   84|  6.59k|         return m_version;
   85|  6.59k|      }
_ZNK5Botan3TLS13Record_Header8sequenceEv:
   87|  5.43k|      uint64_t sequence() const {
   88|  5.43k|         BOTAN_ASSERT_NOMSG(m_needed == 0);
  ------------------
  |  |   60|  5.43k|   do {                                                                     \
  |  |   61|  5.43k|      if(!(expr))                                                           \
  |  |  ------------------
  |  |  |  Branch (61:10): [True: 0, False: 5.43k]
  |  |  ------------------
  |  |   62|  5.43k|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   63|  5.43k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (63:12): [Folded - Ignored]
  |  |  ------------------
  ------------------
   89|  5.43k|         return m_sequence;
   90|  5.43k|      }
_ZNK5Botan3TLS13Record_Header4typeEv:
   94|  30.7k|      Record_Type type() const {
   95|  30.7k|         BOTAN_ASSERT_NOMSG(m_needed == 0);
  ------------------
  |  |   60|  30.7k|   do {                                                                     \
  |  |   61|  30.7k|      if(!(expr))                                                           \
  |  |  ------------------
  |  |  |  Branch (61:10): [True: 0, False: 30.7k]
  |  |  ------------------
  |  |   62|  30.7k|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   63|  30.7k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (63:12): [Folded - Ignored]
  |  |  ------------------
  ------------------
   96|  30.7k|         return m_type;
   97|  30.7k|      }

_ZN5Botan3TLS27Connection_Sequence_NumbersD2Ev:
   20|  2.50k|      virtual ~Connection_Sequence_Numbers() = default;
_ZN5Botan3TLS23Stream_Sequence_NumbersC2Ev:
   39|  2.50k|      Stream_Sequence_Numbers() { Stream_Sequence_Numbers::reset(); }
_ZN5Botan3TLS23Stream_Sequence_Numbers5resetEv:
   41|  2.50k|      void reset() override {
   42|  2.50k|         m_write_seq_no = 0;
   43|  2.50k|         m_read_seq_no = 0;
   44|  2.50k|         m_read_epoch = 0;
   45|  2.50k|         m_write_epoch = 0;
   46|  2.50k|      }
_ZNK5Botan3TLS23Stream_Sequence_Numbers18current_read_epochEv:
   58|  8.21k|      uint16_t current_read_epoch() const override { return m_read_epoch; }
_ZNK5Botan3TLS23Stream_Sequence_Numbers19current_write_epochEv:
   60|  4.71k|      uint16_t current_write_epoch() const override { return m_write_epoch; }
_ZN5Botan3TLS23Stream_Sequence_Numbers19next_write_sequenceEt:
   62|  4.70k|      uint64_t next_write_sequence(uint16_t) override { return m_write_seq_no++; }
_ZN5Botan3TLS23Stream_Sequence_Numbers18next_read_sequenceEv:
   64|  8.21k|      uint64_t next_read_sequence() override { return m_read_seq_no; }

_ZN5Botan3TLS12Session_KeysC2Ev:
   58|  3.66k|      Session_Keys() = default;

_ZN5Botan25MessageAuthenticationCodeD2Ev:
   50|      1|      virtual ~MessageAuthenticationCode() = default;

_ZN5Botan13typecast_copyImEEvPhPT_m:
  133|  2.50k|{
  134|  2.50k|   std::memcpy(out, in, sizeof(T) * N);
  135|  2.50k|}
_ZN5Botan21constant_time_compareEPKhS1_m:
   80|  1.93k|inline bool constant_time_compare(const uint8_t x[], const uint8_t y[], size_t len) {
   81|  1.93k|   return ct_compare_u8(x, y, len) == 0xFF;
   82|  1.93k|}
_ZN5Botan11clear_bytesEPvm:
   92|  7.67k|inline constexpr void clear_bytes(void* ptr, size_t bytes) {
   93|  7.67k|   if(bytes > 0) {
  ------------------
  |  Branch (93:7): [True: 7.64k, False: 36]
  ------------------
   94|  7.64k|      std::memset(ptr, 0, bytes);
   95|  7.64k|   }
   96|  7.67k|}
_ZN5Botan22cast_char_ptr_to_uint8EPKc:
  177|  2.50k|inline const uint8_t* cast_char_ptr_to_uint8(const char* s) { return reinterpret_cast<const uint8_t*>(s); }
_ZN5Botan22cast_uint8_ptr_to_charEPKh:
  179|    542|inline const char* cast_uint8_ptr_to_char(const uint8_t* b) { return reinterpret_cast<const char*>(b); }
_ZN5Botan22cast_uint8_ptr_to_charEPh:
  183|  3.64k|inline char* cast_uint8_ptr_to_char(uint8_t* b) { return reinterpret_cast<char*>(b); }
_ZN5Botan9clear_memIhEEvPT_m:
  109|  7.63k|inline constexpr void clear_mem(T* ptr, size_t n) {
  110|  7.63k|   clear_bytes(ptr, sizeof(T) * n);
  111|  7.63k|}
_ZN5Botan8copy_memIhEEvPT_PKS1_m:
  122|   207k|{
  123|   207k|   BOTAN_ASSERT_IMPLICATION(n > 0, in != nullptr && out != nullptr, "If n > 0 then args are not null");
  ------------------
  |  |   78|   207k|   do {                                                                                          \
  |  |   79|   391k|      if((expr1) && !(expr2))                                                                    \
  |  |  ------------------
  |  |  |  Branch (79:10): [True: 195k, False: 12.1k]
  |  |  |  Branch (79:23): [True: 195k, False: 0]
  |  |  |  Branch (79:23): [True: 195k, False: 0]
  |  |  ------------------
  |  |   80|   207k|         Botan::assertion_failure(#expr1 " implies " #expr2, msg, __func__, __FILE__, __LINE__); \
  |  |   81|   207k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (81:12): [Folded - Ignored]
  |  |  ------------------
  ------------------
  124|       |
  125|   207k|   if(in != nullptr && out != nullptr && n > 0) {
  ------------------
  |  Branch (125:7): [True: 206k, False: 1.09k]
  |  Branch (125:24): [True: 203k, False: 3.23k]
  |  Branch (125:42): [True: 195k, False: 7.80k]
  ------------------
  126|   195k|      std::memmove(out, in, sizeof(T) * n);
  127|   195k|   }
  128|   207k|}
_ZN5Botan13typecast_copyItEEvPT_PKhm:
  140|  4.99k|{
  141|  4.99k|   std::memcpy(out, in, sizeof(T) * N);
  142|  4.99k|}
_ZN5Botan13typecast_copyItEEvRT_PKh:
  152|  4.99k|{
  153|  4.99k|   typecast_copy(&out, in, 1);
  154|  4.99k|}
_ZN5Botan13typecast_copyIjEEvPT_PKhm:
  140|  40.4k|{
  141|  40.4k|   std::memcpy(out, in, sizeof(T) * N);
  142|  40.4k|}
_ZN5Botan13typecast_copyIjEEvRT_PKh:
  152|  40.4k|{
  153|  40.4k|   typecast_copy(&out, in, 1);
  154|  40.4k|}
_ZN5Botan13typecast_copyIjEEvPhPT_m:
  133|  22.5k|{
  134|  22.5k|   std::memcpy(out, in, sizeof(T) * N);
  135|  22.5k|}
_ZN5Botan13typecast_copyIjEEvPhT_:
  145|  22.5k|inline constexpr void typecast_copy(uint8_t out[], T in) {
  146|  22.5k|   typecast_copy(out, &in, 1);
  147|  22.5k|}
_ZN5Botan13typecast_copyImEEvPhT_:
  145|  2.50k|inline constexpr void typecast_copy(uint8_t out[], T in) {
  146|  2.50k|   typecast_copy(out, &in, 1);
  147|  2.50k|}
_ZN5Botan9clear_memIjEEvPT_m:
  109|     37|inline constexpr void clear_mem(T* ptr, size_t n) {
  110|     37|   clear_bytes(ptr, sizeof(T) * n);
  111|     37|}
_ZN5Botan13buffer_insertIhNS_16secure_allocatorIhEEEEmRNSt3__16vectorIT_T0_EEmPKS5_m:
  203|  2.50k|size_t buffer_insert(std::vector<T, Alloc>& buf, size_t buf_offset, const T input[], size_t input_length) {
  204|  2.50k|   BOTAN_ASSERT_NOMSG(buf_offset <= buf.size());
  ------------------
  |  |   60|  2.50k|   do {                                                                     \
  |  |   61|  2.50k|      if(!(expr))                                                           \
  |  |  ------------------
  |  |  |  Branch (61:10): [True: 0, False: 2.50k]
  |  |  ------------------
  |  |   62|  2.50k|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   63|  2.50k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (63:12): [Folded - Ignored]
  |  |  ------------------
  ------------------
  205|  2.50k|   const size_t to_copy = std::min(input_length, buf.size() - buf_offset);
  206|  2.50k|   if(to_copy > 0) {
  ------------------
  |  Branch (206:7): [True: 2.50k, False: 6]
  ------------------
  207|  2.50k|      copy_mem(&buf[buf_offset], input, to_copy);
  208|  2.50k|   }
  209|  2.50k|   return to_copy;
  210|  2.50k|}
_ZN5Botan8copy_memIiEEvPT_PKS1_m:
  122|  1.53k|{
  123|  1.53k|   BOTAN_ASSERT_IMPLICATION(n > 0, in != nullptr && out != nullptr, "If n > 0 then args are not null");
  ------------------
  |  |   78|  1.53k|   do {                                                                                          \
  |  |   79|  3.07k|      if((expr1) && !(expr2))                                                                    \
  |  |  ------------------
  |  |  |  Branch (79:10): [True: 1.53k, False: 0]
  |  |  |  Branch (79:23): [True: 1.53k, False: 0]
  |  |  |  Branch (79:23): [True: 1.53k, False: 0]
  |  |  ------------------
  |  |   80|  1.53k|         Botan::assertion_failure(#expr1 " implies " #expr2, msg, __func__, __FILE__, __LINE__); \
  |  |   81|  1.53k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (81:12): [Folded - Ignored]
  |  |  ------------------
  ------------------
  124|       |
  125|  1.53k|   if(in != nullptr && out != nullptr && n > 0) {
  ------------------
  |  Branch (125:7): [True: 1.53k, False: 0]
  |  Branch (125:24): [True: 1.53k, False: 0]
  |  Branch (125:42): [True: 1.53k, False: 0]
  ------------------
  126|  1.53k|      std::memmove(out, in, sizeof(T) * n);
  127|  1.53k|   }
  128|  1.53k|}

_ZN5Botan7X509_DNC2Ev:
   37|  1.84k|      X509_DN() = default;

_ZN5Botan21RandomNumberGeneratorD2Ev:
   32|  2.50k|      virtual ~RandomNumberGenerator() = default;
_ZN5Botan21RandomNumberGenerator9randomizeENSt3__14spanIhLm18446744073709551615EEE:
   52|  2.50k|      void randomize(std::span<uint8_t> output) { this->fill_bytes_with_input(output, {}); }
_ZN5Botan21RandomNumberGenerator11add_entropyENSt3__14spanIKhLm18446744073709551615EEE:
   75|      1|      void add_entropy(std::span<const uint8_t> input) { this->fill_bytes_with_input({}, input); }
_ZN5Botan21RandomNumberGenerator10random_vecENSt3__14spanIhLm18446744073709551615EEE:
  180|  2.50k|      void random_vec(std::span<uint8_t> v) { this->randomize(v); }
_ZN5Botan21RandomNumberGeneratorC2Ev:
   34|  2.50k|      RandomNumberGenerator() = default;
_ZN5Botan21RandomNumberGenerator10random_vecINSt3__16vectorIhNS2_9allocatorIhEEEEEEvRT_m:
  191|  2.50k|      void random_vec(T& v, size_t bytes) {
  192|  2.50k|         v.resize(bytes);
  193|  2.50k|         random_vec(v);
  194|  2.50k|      }
_ZN5Botan21RandomNumberGenerator10random_vecINSt3__16vectorIhNS2_9allocatorIhEEEEEET_m:
  206|  2.50k|      T random_vec(size_t bytes) {
  207|  2.50k|         T result;
  208|  2.50k|         random_vec(result, bytes);
  209|  2.50k|         return result;
  210|  2.50k|      }

_ZN5Botan16secure_allocatorIhE8allocateEm:
   45|  45.5k|      T* allocate(std::size_t n) { return static_cast<T*>(allocate_memory(n, sizeof(T))); }
_ZN5Botan16secure_allocatorIhE10deallocateEPhm:
   47|  45.5k|      void deallocate(T* p, std::size_t n) { deallocate_memory(p, n, sizeof(T)); }
_ZN5Botan16secure_allocatorImE10deallocateEPmm:
   47|     25|      void deallocate(T* p, std::size_t n) { deallocate_memory(p, n, sizeof(T)); }
_ZN5Botan16secure_allocatorImE8allocateEm:
   45|     25|      T* allocate(std::size_t n) { return static_cast<T*>(allocate_memory(n, sizeof(T))); }
_ZN5Botan7zeroiseIhNS_16secure_allocatorIhEEEEvRNSt3__16vectorIT_T0_EE:
  108|  5.13k|void zeroise(std::vector<T, Alloc>& vec) {
  109|  5.13k|   clear_mem(vec.data(), vec.size());
  110|  5.13k|}
_ZN5Botan16secure_allocatorIjE10deallocateEPjm:
   47|  2.60k|      void deallocate(T* p, std::size_t n) { deallocate_memory(p, n, sizeof(T)); }
_ZN5BotanpLIhNSt3__19allocatorIhEEmEERNS1_6vectorIT_T0_EES8_RKNS1_4pairIPKS5_T1_EE:
   92|  2.50k|std::vector<T, Alloc>& operator+=(std::vector<T, Alloc>& out, const std::pair<const T*, L>& in) {
   93|  2.50k|   out.insert(out.end(), in.first, in.first + in.second);
   94|  2.50k|   return out;
   95|  2.50k|}
_ZN5BotanpLIhNSt3__19allocatorIhEES3_EERNS1_6vectorIT_T0_EES8_RKNS4_IS5_T1_EE:
   80|  34.4k|std::vector<T, Alloc>& operator+=(std::vector<T, Alloc>& out, const std::vector<T, Alloc2>& in) {
   81|  34.4k|   out.insert(out.end(), in.begin(), in.end());
   82|  34.4k|   return out;
   83|  34.4k|}
_ZN5BotanpLIhNS_16secure_allocatorIhEEmEERNSt3__16vectorIT_T0_EES8_RKNS3_4pairIPS5_T1_EE:
   98|  8.63k|std::vector<T, Alloc>& operator+=(std::vector<T, Alloc>& out, const std::pair<T*, L>& in) {
   99|  8.63k|   out.insert(out.end(), in.first, in.first + in.second);
  100|  8.63k|   return out;
  101|  8.63k|}
_ZN5Botan16secure_allocatorIjE8allocateEm:
   45|  2.60k|      T* allocate(std::size_t n) { return static_cast<T*>(allocate_memory(n, sizeof(T))); }
_ZN5Botan7zeroiseIjNS_16secure_allocatorIjEEEEvRNSt3__16vectorIT_T0_EE:
  108|     36|void zeroise(std::vector<T, Alloc>& vec) {
  109|     36|   clear_mem(vec.data(), vec.size());
  110|     36|}

_ZN5Botan12Stateful_RNGC2Ev:
   58|      1|      Stateful_RNG() : m_reseed_interval(0) {}

_ZN5Botan12StreamCipher15write_keystreamENSt3__14spanIhLm18446744073709551615EEE:
   87|  2.50k|      void write_keystream(std::span<uint8_t> out) { generate_keystream(out.data(), out.size()); }
_ZN5Botan12StreamCipher6set_ivEPKhm:
  157|      2|      void set_iv(const uint8_t iv[], size_t iv_len) { set_iv_bytes(iv, iv_len); }
_ZN5Botan12StreamCipher15keystream_bytesINSt3__16vectorIhNS_16secure_allocatorIhEEEEEET_m:
   95|      1|      T keystream_bytes(size_t bytes) {
   96|      1|         T out(bytes);
   97|      1|         write_keystream(out);
   98|      1|         return out;
   99|      1|      }

_ZNK5Botan6detail11Strong_BaseINSt3__16vectorIhNS2_9allocatorIhEEEEE3getEv:
   52|  5.00k|      const T& get() const { return m_value; }
_ZN5Botan6detail11Strong_BaseINSt3__16vectorIhNS2_9allocatorIhEEEEEaSEOS7_:
   46|  1.91k|      Strong_Base& operator=(Strong_Base&&) = default;
_ZN5Botan6detail11Strong_BaseINSt3__16vectorIhNS2_9allocatorIhEEEEEC2Ev:
   42|  6.95k|      Strong_Base() = default;
_ZN5Botan6detail11Strong_BaseINSt3__16vectorIhNS2_9allocatorIhEEEEEC2ES6_:
   48|  1.95k|      constexpr explicit Strong_Base(T v) : m_value(std::move(v)) {}

_ZN5Botan24Key_Length_SpecificationC2Emmm:
   36|      4|            m_min_keylen(min_k), m_max_keylen(max_k ? max_k : min_k), m_keylen_mod(k_mod) {}
_ZNK5Botan24Key_Length_Specification15valid_keylengthEm:
   42|      4|      bool valid_keylength(size_t length) const {
   43|      4|         return ((length >= m_min_keylen) && (length <= m_max_keylen) && (length % m_keylen_mod == 0));
  ------------------
  |  Branch (43:18): [True: 4, False: 0]
  |  Branch (43:46): [True: 4, False: 0]
  |  Branch (43:74): [True: 4, False: 0]
  ------------------
   44|      4|      }
_ZNK5Botan18SymmetricAlgorithm15valid_keylengthEm:
  107|      4|      bool valid_keylength(size_t length) const { return key_spec().valid_keylength(length); }
_ZN5Botan18SymmetricAlgorithm7set_keyENSt3__14spanIKhLm18446744073709551615EEE:
  119|      4|      void set_key(std::span<const uint8_t> key) { set_key(key.data(), key.size()); }
_ZNK5Botan18SymmetricAlgorithm23assert_key_material_setEv:
  139|  2.50k|      void assert_key_material_set() const { assert_key_material_set(has_keying_material()); }
_ZNK5Botan18SymmetricAlgorithm23assert_key_material_setEb:
  141|  2.50k|      void assert_key_material_set(bool predicate) const {
  142|  2.50k|         if(!predicate)
  ------------------
  |  Branch (142:13): [True: 0, False: 2.50k]
  ------------------
  143|      0|            throw_key_not_set_error();
  144|  2.50k|      }
_ZN5Botan18SymmetricAlgorithmD2Ev:
   79|     90|      virtual ~SymmetricAlgorithm() = default;

_ZNK5Botan3TLS5Alert8is_validEv:
   79|  2.79k|      bool is_valid() const { return (m_type_code != AlertType::None); }
_ZNK5Botan3TLS5Alert8is_fatalEv:
   90|  12.0k|      bool is_fatal() const { return m_fatal; }
_ZNK5Botan3TLS5Alert4typeEv:
   95|  16.0k|      Type type() const { return m_type_code; }
_ZN5Botan3TLS5AlertC2ENS0_9AlertTypeEb:
  118|  2.79k|      Alert(Type type_code, bool fatal = false) : m_fatal(fatal), m_type_code(type_code) {}

_ZN5Botan3TLS9CallbacksD2Ev:
   46|  2.50k|      virtual ~Callbacks() = default;
_ZN5Botan3TLS9Callbacks26tls_peer_closed_connectionEv:
  115|    590|      virtual bool tls_peer_closed_connection() { return true; }

_ZN5Botan3TLS7Channel13received_dataEPKhm:
   48|  2.50k|      size_t received_data(const uint8_t buf[], size_t buf_size) { return this->from_peer(std::span(buf, buf_size)); }
_ZN5Botan3TLS7ChannelD2Ev:
   34|  2.50k|      virtual ~Channel() = default;

_ZNK5Botan3TLS11Ciphersuite5validEv:
  128|   235k|      bool valid() const { return m_usable; }
_ZNK5Botan3TLS11Ciphersuite16ciphersuite_codeEv:
   62|    973|      uint16_t ciphersuite_code() const { return m_ciphersuite_code; }
_ZNK5Botan3TLS11Ciphersuite10kex_methodEv:
   91|    211|      Kex_Algo kex_method() const { return m_kex_algo; }
_ZNK5Botan3TLS11Ciphersuite11auth_methodEv:
   98|    171|      Auth_Method auth_method() const { return m_auth_method; }
_ZNK5Botan3TLS11Ciphersuite11cipher_algoEv:
  103|    152|      std::string cipher_algo() const { return m_cipher_algo; }
_ZNK5Botan3TLS11Ciphersuite8mac_algoEv:
  108|    124|      std::string mac_algo() const { return m_mac_algo; }
_ZNK5Botan3TLS11Ciphersuite8prf_algoEv:
  110|     94|      std::string prf_algo() const { return kdf_algo_to_string(m_prf_algo); }
_ZNK5Botan3TLS11CiphersuiteltEt:
  134|    846|      bool operator<(const uint16_t c) const { return ciphersuite_code() < c; }
_ZN5Botan3TLS11CiphersuiteC2EtPKcNS0_11Auth_MethodENS0_8Kex_AlgoES3_mS3_mNS0_8KDF_AlgoENS0_12Nonce_FormatE:
  158|     94|            m_mac_keylen(mac_keylen) {
  159|     94|         m_usable = is_usable();
  160|     94|      }

_ZN5Botan3TLS13TLS_ExceptionC2ENS0_9AlertTypeENSt3__117basic_string_viewIcNS3_11char_traitsIcEEEE:
   26|    551|            Exception(err_msg), m_alert_type(type) {}
_ZNK5Botan3TLS13TLS_Exception4typeEv:
   23|    551|      Alert::Type type() const { return m_alert_type; }
_ZN5Botan3TLS18Unexpected_MessageC2ENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEE:
   41|     58|      explicit Unexpected_Message(std::string_view err) : TLS_Exception(AlertType::UnexpectedMessage, err) {}

_ZN5Botan3TLS21Server_Name_Indicator11static_typeEv:
  119|  19.0k|      static Extension_Code static_type() { return Extension_Code::ServerNameIndication; }
_ZNK5Botan3TLS21Server_Name_Indicator4typeEv:
  121|  19.0k|      Extension_Code type() const override { return static_type(); }
_ZN5Botan3TLS21Server_Name_IndicatorC2ENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEE:
  123|  2.50k|      explicit Server_Name_Indicator(std::string_view host_name) : m_sni_host_name(host_name) {}
_ZNK5Botan3TLS21Server_Name_Indicator5emptyEv:
  131|  2.50k|      bool empty() const override { return false; }
_ZN5Botan3TLS23Renegotiation_Extension11static_typeEv:
  142|  32.6k|      static Extension_Code static_type() { return Extension_Code::SafeRenegotiation; }
_ZNK5Botan3TLS23Renegotiation_Extension4typeEv:
  144|  27.6k|      Extension_Code type() const override { return static_type(); }
_ZN5Botan3TLS23Renegotiation_ExtensionC2ERKNSt3__16vectorIhNS2_9allocatorIhEEEE:
  148|  2.50k|      explicit Renegotiation_Extension(const std::vector<uint8_t>& bits) : m_reneg_data(bits) {}
_ZNK5Botan3TLS23Renegotiation_Extension18renegotiation_infoEv:
  152|  2.50k|      const std::vector<uint8_t>& renegotiation_info() const { return m_reneg_data; }
_ZNK5Botan3TLS23Renegotiation_Extension5emptyEv:
  156|  2.50k|      bool empty() const override { return false; }  // always send this
_ZN5Botan3TLS39Application_Layer_Protocol_Notification11static_typeEv:
  167|  2.77k|      static Extension_Code static_type() { return Extension_Code::ApplicationLayerProtocolNegotiation; }
_ZNK5Botan3TLS39Application_Layer_Protocol_Notification4typeEv:
  169|  2.77k|      Extension_Code type() const override { return static_type(); }
_ZN5Botan3TLS24Session_Ticket_Extension11static_typeEv:
  202|  31.4k|      static Extension_Code static_type() { return Extension_Code::SessionTicket; }
_ZNK5Botan3TLS24Session_Ticket_Extension4typeEv:
  204|  31.4k|      Extension_Code type() const override { return static_type(); }
_ZNK5Botan3TLS24Session_Ticket_Extension9serializeENS0_15Connection_SideE:
  226|  2.50k|      std::vector<uint8_t> serialize(Connection_Side) const override { return m_ticket.get(); }
_ZNK5Botan3TLS24Session_Ticket_Extension5emptyEv:
  228|  2.50k|      bool empty() const override { return false; }
_ZN5Botan3TLS16Supported_Groups11static_typeEv:
  239|  9.95k|      static Extension_Code static_type() { return Extension_Code::SupportedGroups; }
_ZNK5Botan3TLS16Supported_Groups4typeEv:
  241|  9.95k|      Extension_Code type() const override { return static_type(); }
_ZNK5Botan3TLS16Supported_Groups5emptyEv:
  253|  2.50k|      bool empty() const override { return m_groups.empty(); }
_ZN5Botan3TLS23Supported_Point_Formats11static_typeEv:
  273|  12.2k|      static Extension_Code static_type() { return Extension_Code::EcPointFormats; }
_ZNK5Botan3TLS23Supported_Point_Formats4typeEv:
  275|  12.2k|      Extension_Code type() const override { return static_type(); }
_ZN5Botan3TLS23Supported_Point_FormatsC2Eb:
  279|  2.50k|      explicit Supported_Point_Formats(bool prefer_compressed) : m_prefers_compressed(prefer_compressed) {}
_ZNK5Botan3TLS23Supported_Point_Formats5emptyEv:
  283|  2.50k|      bool empty() const override { return false; }
_ZN5Botan3TLS20Signature_Algorithms11static_typeEv:
  296|  5.46k|      static Extension_Code static_type() { return Extension_Code::SignatureAlgorithms; }
_ZNK5Botan3TLS20Signature_Algorithms4typeEv:
  298|  5.46k|      Extension_Code type() const override { return static_type(); }
_ZNK5Botan3TLS20Signature_Algorithms5emptyEv:
  304|  2.50k|      bool empty() const override { return m_schemes.empty(); }
_ZN5Botan3TLS20Signature_AlgorithmsC2ENSt3__16vectorINS0_16Signature_SchemeENS2_9allocatorIS4_EEEE:
  306|  2.50k|      explicit Signature_Algorithms(std::vector<Signature_Scheme> schemes) : m_schemes(std::move(schemes)) {}
_ZN5Botan3TLS25Signature_Algorithms_Cert11static_typeEv:
  329|    400|      static Extension_Code static_type() { return Extension_Code::CertSignatureAlgorithms; }
_ZNK5Botan3TLS25Signature_Algorithms_Cert4typeEv:
  331|    400|      Extension_Code type() const override { return static_type(); }
_ZN5Botan3TLS24SRTP_Protection_Profiles11static_typeEv:
  352|    436|      static Extension_Code static_type() { return Extension_Code::UseSrtp; }
_ZNK5Botan3TLS24SRTP_Protection_Profiles4typeEv:
  354|    436|      Extension_Code type() const override { return static_type(); }
_ZN5Botan3TLS22Extended_Master_Secret11static_typeEv:
  377|  36.7k|      static Extension_Code static_type() { return Extension_Code::ExtendedMasterSecret; }
_ZNK5Botan3TLS22Extended_Master_Secret4typeEv:
  379|  36.7k|      Extension_Code type() const override { return static_type(); }
_ZNK5Botan3TLS22Extended_Master_Secret5emptyEv:
  383|  2.50k|      bool empty() const override { return false; }
_ZN5Botan3TLS16Encrypt_then_MAC11static_typeEv:
  395|  35.9k|      static Extension_Code static_type() { return Extension_Code::EncryptThenMac; }
_ZNK5Botan3TLS16Encrypt_then_MAC4typeEv:
  397|  35.9k|      Extension_Code type() const override { return static_type(); }
_ZNK5Botan3TLS16Encrypt_then_MAC5emptyEv:
  401|  2.50k|      bool empty() const override { return false; }
_ZN5Botan3TLS26Certificate_Status_Request11static_typeEv:
  415|  15.7k|      static Extension_Code static_type() { return Extension_Code::CertificateStatusRequest; }
_ZNK5Botan3TLS26Certificate_Status_Request4typeEv:
  417|  15.7k|      Extension_Code type() const override { return static_type(); }
_ZNK5Botan3TLS26Certificate_Status_Request5emptyEv:
  421|  2.50k|      bool empty() const override { return false; }
_ZN5Botan3TLS18Supported_Versions11static_typeEv:
  453|  19.2k|      static Extension_Code static_type() { return Extension_Code::SupportedVersions; }
_ZNK5Botan3TLS18Supported_Versions4typeEv:
  455|  18.9k|      Extension_Code type() const override { return static_type(); }
_ZNK5Botan3TLS18Supported_Versions5emptyEv:
  459|  2.50k|      bool empty() const override { return m_versions.empty(); }
_ZN5Botan3TLS17Record_Size_Limit11static_typeEv:
  484|    320|      static Extension_Code static_type() { return Extension_Code::RecordSizeLimit; }
_ZNK5Botan3TLS17Record_Size_Limit4typeEv:
  486|    320|      Extension_Code type() const override { return static_type(); }
_ZN5Botan3TLS6Cookie11static_typeEv:
  510|  4.41k|      static Extension_Code static_type() { return Extension_Code::Cookie; }
_ZNK5Botan3TLS6Cookie4typeEv:
  512|  4.41k|      Extension_Code type() const override { return static_type(); }
_ZN5Botan3TLS22PSK_Key_Exchange_Modes11static_typeEv:
  533|    548|      static Extension_Code static_type() { return Extension_Code::PskKeyExchangeModes; }
_ZNK5Botan3TLS22PSK_Key_Exchange_Modes4typeEv:
  535|    548|      Extension_Code type() const override { return static_type(); }
_ZN5Botan3TLS23Certificate_Authorities11static_typeEv:
  556|    272|      static Extension_Code static_type() { return Extension_Code::CertificateAuthorities; }
_ZNK5Botan3TLS23Certificate_Authorities4typeEv:
  558|    272|      Extension_Code type() const override { return static_type(); }
_ZN5Botan3TLS3PSK11static_typeEv:
  578|    318|      static Extension_Code static_type() { return Extension_Code::PresharedKey; }
_ZNK5Botan3TLS3PSK4typeEv:
  580|    318|      Extension_Code type() const override { return static_type(); }
_ZN5Botan3TLS9Key_Share11static_typeEv:
  657|    637|      static Extension_Code static_type() { return Extension_Code::KeyShare; }
_ZNK5Botan3TLS9Key_Share4typeEv:
  659|    637|      Extension_Code type() const override { return static_type(); }
_ZN5Botan3TLS19EarlyDataIndication11static_typeEv:
  723|  1.19k|      static Extension_Code static_type() { return Extension_Code::EarlyData; }
_ZNK5Botan3TLS19EarlyDataIndication4typeEv:
  725|  1.19k|      Extension_Code type() const override { return static_type(); }
_ZNK5Botan3TLS17Unknown_Extension4typeEv:
  762|   492k|      Extension_Code type() const override { return m_type; }
_ZNK5Botan3TLS10Extensions3hasENS0_14Extension_CodeE:
  790|  38.0k|      bool has(Extension_Code type) const { return get(type) != nullptr; }
_ZN5Botan3TLS10Extensions3addEPNS0_9ExtensionE:
  796|  25.0k|      void add(Extension* extn) { add(std::unique_ptr<Extension>(extn)); }
_ZZNK5Botan3TLS10Extensions3getENS0_14Extension_CodeEENKUlRKT_E_clINSt3__110unique_ptrINS0_9ExtensionENS8_14default_deleteISA_EEEEEEDaS5_:
  800|   661k|            m_extensions.cbegin(), m_extensions.cend(), [type](const auto& ext) { return ext->type() == type; });
_ZNK5Botan3TLS10Extensions3getENS0_14Extension_CodeE:
  798|  43.3k|      Extension* get(Extension_Code type) const {
  799|  43.3k|         const auto i = std::find_if(
  800|  43.3k|            m_extensions.cbegin(), m_extensions.cend(), [type](const auto& ext) { return ext->type() == type; });
  801|       |
  802|  43.3k|         return (i != m_extensions.end()) ? i->get() : nullptr;
  ------------------
  |  Branch (802:17): [True: 5.02k, False: 38.2k]
  ------------------
  803|  43.3k|      }
_ZNK5Botan3TLS10Extensions3hasINS0_18Supported_VersionsEEEbv:
  786|    267|      bool has() const {
  787|    267|         return get<T>() != nullptr;
  788|    267|      }
_ZNK5Botan3TLS10Extensions3getINS0_18Supported_VersionsEEEPT_v:
  781|    267|      T* get() const {
  782|    267|         return dynamic_cast<T*>(get(T::static_type()));
  783|    267|      }
_ZN5Botan3TLS9ExtensionD2Ev:
  111|  32.1k|      virtual ~Extension() = default;
_ZN5Botan3TLS22Extended_Master_SecretC2Ev:
  385|  2.50k|      Extended_Master_Secret() = default;
_ZN5Botan3TLS16Encrypt_then_MACC2Ev:
  403|  2.50k|      Encrypt_then_MAC() = default;
_ZN5Botan3TLS24Session_Ticket_ExtensionC2Ev:
  214|  2.50k|      Session_Ticket_Extension() = default;
_ZN5Botan3TLS10ExtensionsC2Ev:
  859|  4.45k|      Extensions() = default;
_ZNK5Botan3TLS10Extensions3hasINS0_23Renegotiation_ExtensionEEEbv:
  786|  2.50k|      bool has() const {
  787|  2.50k|         return get<T>() != nullptr;
  788|  2.50k|      }
_ZNK5Botan3TLS10Extensions3getINS0_23Renegotiation_ExtensionEEEPT_v:
  781|  5.00k|      T* get() const {
  782|  5.00k|         return dynamic_cast<T*>(get(T::static_type()));
  783|  5.00k|      }

_ZNK5Botan3TLS17Handshake_Message9wire_typeEv:
   41|  2.50k|      virtual Handshake_Type wire_type() const {
   42|       |         // Usually equal to the Handshake_Type enum value,
   43|       |         // with the exception of TLS 1.3 Hello Retry Request.
   44|  2.50k|         return type();
   45|  2.50k|      }
_ZN5Botan3TLS17Handshake_MessageD2Ev:
   52|  2.76k|      virtual ~Handshake_Message() = default;
_ZN5Botan3TLS17Handshake_MessageC2Ev:
   53|  2.76k|      Handshake_Message() = default;

_ZN5Botan3TLS15Client_Hello_128SettingsC2ENS0_16Protocol_VersionENSt3__117basic_string_viewIcNS4_11char_traitsIcEEEE:
  151|  2.50k|                  m_new_session_version(version), m_hostname(hostname) {}
_ZNK5Botan3TLS15Client_Hello_128Settings16protocol_versionEv:
  153|  5.00k|            const Protocol_Version protocol_version() const { return m_new_session_version; }
_ZNK5Botan3TLS15Client_Hello_128Settings8hostnameEv:
  155|  5.00k|            const std::string hostname() const { return m_hostname; }

_ZN5Botan3TLS6PolicyD2Ev:
  441|  2.50k|      virtual ~Policy() = default;

_ZN5Botan3TLS18Server_InformationC2ENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEt:
   34|  2.50k|            m_hostname(hostname), m_service(""), m_port(port) {}
_ZNK5Botan3TLS18Server_Information8hostnameEv:
   49|  2.50k|      std::string hostname() const { return m_hostname; }
_ZNK5Botan3TLS18Server_Information5emptyEv:
   65|  2.50k|      bool empty() const { return m_hostname.empty(); }

_ZN5Botan3TLS15Session_ManagerD2Ev:
  214|  2.50k|      virtual ~Session_Manager() = default;
_ZN5Botan3TLS15Session_Manager5mutexEv:
  266|  2.50k|      recursive_mutex_type& mutex() { return m_mutex; }

_ZN5Botan3TLS20Session_Manager_Noop9find_someERKNS0_18Server_InformationEm:
   42|  2.50k|      std::vector<Session_with_Handle> find_some(const Server_Information&, const size_t) override { return {}; }

_ZNK5Botan3TLS16Signature_Scheme9wire_codeEv:
   68|  45.0k|      Signature_Scheme::Code wire_code() const noexcept { return m_code; }

_ZN5Botan3TLS16Protocol_VersionC2ENS0_12Version_CodeE:
   58|  31.4k|      Protocol_Version(Version_Code named_version) : Protocol_Version(static_cast<uint16_t>(named_version)) {}
_ZN5Botan3TLS16Protocol_VersionC2Et:
   53|  41.6k|      explicit Protocol_Version(uint16_t code) : m_version(code) {}
_ZN5Botan3TLS16Protocol_VersionC2Ev:
   51|  4.54k|      Protocol_Version() : m_version(0) {}
_ZN5Botan3TLS16Protocol_VersionC2Ehh:
   65|  10.2k|            Protocol_Version(static_cast<uint16_t>((static_cast<uint16_t>(major) << 8) | minor)) {}
_ZNK5Botan3TLS16Protocol_Version13major_versionEv:
   80|  52.5k|      uint8_t major_version() const { return static_cast<uint8_t>(m_version >> 8); }
_ZNK5Botan3TLS16Protocol_Version13minor_versionEv:
   85|  9.83k|      uint8_t minor_version() const { return static_cast<uint8_t>(m_version & 0xFF); }
_ZNK5Botan3TLS16Protocol_VersioneqERKS1_:
  115|  18.0k|      bool operator==(const Protocol_Version& other) const { return (m_version == other.m_version); }
_ZNK5Botan3TLS16Protocol_VersiongeERKS1_:
  130|  5.25k|      bool operator>=(const Protocol_Version& other) const { return (*this == other || *this > other); }
  ------------------
  |  Branch (130:70): [True: 2.50k, False: 2.75k]
  |  Branch (130:88): [True: 138, False: 2.61k]
  ------------------
_ZNK5Botan3TLS16Protocol_VersionltERKS1_:
  135|    255|      bool operator<(const Protocol_Version& other) const { return !(*this >= other); }
_ZNK5Botan3TLS16Protocol_VersionleERKS1_:
  140|    267|      bool operator<=(const Protocol_Version& other) const { return (*this == other || *this < other); }
  ------------------
  |  Branch (140:70): [True: 12, False: 255]
  |  Branch (140:88): [True: 117, False: 138]
  ------------------

LLVMFuzzerInitialize:
   24|      2|extern "C" int LLVMFuzzerInitialize(int*, char***) {
   25|       |   /*
   26|       |   * This disables the mlock pool, as overwrites within the pool are
   27|       |   * opaque to ASan or other instrumentation.
   28|       |   */
   29|      2|   ::setenv("BOTAN_MLOCK_POOL_SIZE", "0", 1);
   30|      2|   return 0;
   31|      2|}
LLVMFuzzerTestOneInput:
   34|  2.50k|extern "C" int LLVMFuzzerTestOneInput(const uint8_t in[], size_t len) {
   35|  2.50k|   if(len <= max_fuzzer_input_size) {
  ------------------
  |  Branch (35:7): [True: 2.50k, False: 9]
  ------------------
   36|  2.50k|      fuzz(in, len);
   37|  2.50k|   }
   38|  2.50k|   return 0;
   39|  2.50k|}
_Z20fuzzer_rng_as_sharedv:
   43|  2.50k|inline std::shared_ptr<Botan::RandomNumberGenerator> fuzzer_rng_as_shared() {
   44|  2.50k|   static std::shared_ptr<Botan::ChaCha_RNG> rng =
   45|  2.50k|      std::make_shared<Botan::ChaCha_RNG>(Botan::secure_vector<uint8_t>(32));
   46|  2.50k|   return rng;
   47|  2.50k|}

_Z4fuzzPKhm:
   67|  2.50k|void fuzz(const uint8_t in[], size_t len) {
   68|  2.50k|   if(len == 0)
  ------------------
  |  Branch (68:7): [True: 0, False: 2.50k]
  ------------------
   69|      0|      return;
   70|       |
   71|  2.50k|   auto session_manager = std::make_shared<Botan::TLS::Session_Manager_Noop>();
   72|  2.50k|   auto policy = std::make_shared<Fuzzer_TLS_Policy>();
   73|  2.50k|   Botan::TLS::Protocol_Version client_offer = Botan::TLS::Protocol_Version::TLS_V12;
   74|  2.50k|   Botan::TLS::Server_Information info("server.name", 443);
   75|  2.50k|   auto callbacks = std::make_shared<Fuzzer_TLS_Client_Callbacks>();
   76|  2.50k|   auto creds = std::make_shared<Fuzzer_TLS_Client_Creds>();
   77|       |
   78|  2.50k|   Botan::TLS::Client client(callbacks, session_manager, creds, policy, fuzzer_rng_as_shared(), info, client_offer);
   79|       |
   80|  2.50k|   try {
   81|  2.50k|      client.received_data(in, len);
   82|  2.50k|   } catch(std::exception& e) {}
   83|  2.50k|}
_ZNK17Fuzzer_TLS_Policy16ciphersuite_listEN5Botan3TLS16Protocol_VersionE:
   25|  2.50k|      std::vector<uint16_t> ciphersuite_list(Botan::TLS::Protocol_Version) const override {
   26|  2.50k|         std::vector<uint16_t> ciphersuites;
   27|       |
   28|   235k|         for(auto&& suite : Botan::TLS::Ciphersuite::all_known_ciphersuites()) {
  ------------------
  |  Branch (28:27): [True: 235k, False: 2.50k]
  ------------------
   29|   235k|            if(suite.valid() == false)
  ------------------
  |  Branch (29:16): [True: 0, False: 235k]
  ------------------
   30|      0|               ciphersuites.push_back(suite.ciphersuite_code());
   31|   235k|         }
   32|       |
   33|  2.50k|         return ciphersuites;
   34|  2.50k|      }
_ZN27Fuzzer_TLS_Client_Callbacks13tls_emit_dataENSt3__14spanIKhLm18446744073709551615EEE:
   39|  4.70k|      void tls_emit_data(std::span<const uint8_t>) override {
   40|       |         // discard
   41|  4.70k|      }
_ZN27Fuzzer_TLS_Client_Callbacks9tls_alertEN5Botan3TLS5AlertE:
   47|  2.73k|      void tls_alert(Botan::TLS::Alert) override {
   48|       |         // ignore alert
   49|  2.73k|      }

_ZNK5Botan10BER_Object11assert_is_aENS_9ASN1_TypeENS_10ASN1_ClassENSt3__117basic_string_viewIcNS3_11char_traitsIcEEEE:
   28|  5.15k|void BER_Object::assert_is_a(ASN1_Type expected_type_tag, ASN1_Class expected_class_tag, std::string_view descr) const {
   29|  5.15k|   if(this->is_a(expected_type_tag, expected_class_tag) == false) {
  ------------------
  |  Branch (29:7): [True: 252, False: 4.89k]
  ------------------
   30|    252|      std::stringstream msg;
   31|       |
   32|    252|      msg << "Tag mismatch when decoding " << descr << " got ";
   33|       |
   34|    252|      if(m_class_tag == ASN1_Class::NoObject && m_type_tag == ASN1_Type::NoObject) {
  ------------------
  |  Branch (34:10): [True: 30, False: 222]
  |  Branch (34:49): [True: 30, False: 0]
  ------------------
   35|     30|         msg << "EOF";
   36|    222|      } else {
   37|    222|         if(m_class_tag == ASN1_Class::Universal || m_class_tag == ASN1_Class::Constructed) {
  ------------------
  |  Branch (37:13): [True: 82, False: 140]
  |  Branch (37:53): [True: 110, False: 30]
  ------------------
   38|    192|            msg << asn1_tag_to_string(m_type_tag);
   39|    192|         } else {
   40|     30|            msg << std::to_string(static_cast<uint32_t>(m_type_tag));
   41|     30|         }
   42|       |
   43|    222|         msg << "/" << asn1_class_to_string(m_class_tag);
   44|    222|      }
   45|       |
   46|    252|      msg << " expected ";
   47|       |
   48|    252|      if(expected_class_tag == ASN1_Class::Universal || expected_class_tag == ASN1_Class::Constructed) {
  ------------------
  |  Branch (48:10): [True: 0, False: 252]
  |  Branch (48:57): [True: 252, False: 0]
  ------------------
   49|    252|         msg << asn1_tag_to_string(expected_type_tag);
   50|    252|      } else {
   51|      0|         msg << std::to_string(static_cast<uint32_t>(expected_type_tag));
   52|      0|      }
   53|       |
   54|    252|      msg << "/" << asn1_class_to_string(expected_class_tag);
   55|       |
   56|    252|      throw BER_Decoding_Error(msg.str());
   57|    252|   }
   58|  5.15k|}
_ZNK5Botan10BER_Object4is_aENS_9ASN1_TypeENS_10ASN1_ClassE:
   60|  5.15k|bool BER_Object::is_a(ASN1_Type expected_type_tag, ASN1_Class expected_class_tag) const {
   61|  5.15k|   return (m_type_tag == expected_type_tag && m_class_tag == expected_class_tag);
  ------------------
  |  Branch (61:12): [True: 4.90k, False: 246]
  |  Branch (61:47): [True: 4.89k, False: 6]
  ------------------
   62|  5.15k|}
_ZN5Botan10BER_Object11set_taggingENS_9ASN1_TypeENS_10ASN1_ClassE:
   68|  10.6k|void BER_Object::set_tagging(ASN1_Type type_tag, ASN1_Class class_tag) {
   69|  10.6k|   m_type_tag = type_tag;
   70|  10.6k|   m_class_tag = class_tag;
   71|  10.6k|}
_ZN5Botan20asn1_class_to_stringENS_10ASN1_ClassE:
   73|    474|std::string asn1_class_to_string(ASN1_Class type) {
   74|    474|   switch(type) {
   75|     82|      case ASN1_Class::Universal:
  ------------------
  |  Branch (75:7): [True: 82, False: 392]
  ------------------
   76|     82|         return "UNIVERSAL";
   77|    362|      case ASN1_Class::Constructed:
  ------------------
  |  Branch (77:7): [True: 362, False: 112]
  ------------------
   78|    362|         return "CONSTRUCTED";
   79|     10|      case ASN1_Class::ContextSpecific:
  ------------------
  |  Branch (79:7): [True: 10, False: 464]
  ------------------
   80|     10|         return "CONTEXT_SPECIFIC";
   81|      5|      case ASN1_Class::Application:
  ------------------
  |  Branch (81:7): [True: 5, False: 469]
  ------------------
   82|      5|         return "APPLICATION";
   83|      4|      case ASN1_Class::Private:
  ------------------
  |  Branch (83:7): [True: 4, False: 470]
  ------------------
   84|      4|         return "PRIVATE";
   85|      0|      case ASN1_Class::NoObject:
  ------------------
  |  Branch (85:7): [True: 0, False: 474]
  ------------------
   86|      0|         return "NO_OBJECT";
   87|     11|      default:
  ------------------
  |  Branch (87:7): [True: 11, False: 463]
  ------------------
   88|     11|         return "CLASS(" + std::to_string(static_cast<size_t>(type)) + ")";
   89|    474|   }
   90|    474|}
_ZN5Botan18asn1_tag_to_stringENS_9ASN1_TypeE:
   92|    444|std::string asn1_tag_to_string(ASN1_Type type) {
   93|    444|   switch(type) {
   94|    202|      case ASN1_Type::Sequence:
  ------------------
  |  Branch (94:7): [True: 202, False: 242]
  ------------------
   95|    202|         return "SEQUENCE";
   96|       |
   97|     65|      case ASN1_Type::Set:
  ------------------
  |  Branch (97:7): [True: 65, False: 379]
  ------------------
   98|     65|         return "SET";
   99|       |
  100|      4|      case ASN1_Type::PrintableString:
  ------------------
  |  Branch (100:7): [True: 4, False: 440]
  ------------------
  101|      4|         return "PRINTABLE STRING";
  102|       |
  103|      3|      case ASN1_Type::NumericString:
  ------------------
  |  Branch (103:7): [True: 3, False: 441]
  ------------------
  104|      3|         return "NUMERIC STRING";
  105|       |
  106|      2|      case ASN1_Type::Ia5String:
  ------------------
  |  Branch (106:7): [True: 2, False: 442]
  ------------------
  107|      2|         return "IA5 STRING";
  108|       |
  109|      2|      case ASN1_Type::TeletexString:
  ------------------
  |  Branch (109:7): [True: 2, False: 442]
  ------------------
  110|      2|         return "T61 STRING";
  111|       |
  112|      3|      case ASN1_Type::Utf8String:
  ------------------
  |  Branch (112:7): [True: 3, False: 441]
  ------------------
  113|      3|         return "UTF8 STRING";
  114|       |
  115|      1|      case ASN1_Type::VisibleString:
  ------------------
  |  Branch (115:7): [True: 1, False: 443]
  ------------------
  116|      1|         return "VISIBLE STRING";
  117|       |
  118|      1|      case ASN1_Type::BmpString:
  ------------------
  |  Branch (118:7): [True: 1, False: 443]
  ------------------
  119|      1|         return "BMP STRING";
  120|       |
  121|      1|      case ASN1_Type::UniversalString:
  ------------------
  |  Branch (121:7): [True: 1, False: 443]
  ------------------
  122|      1|         return "UNIVERSAL STRING";
  123|       |
  124|      3|      case ASN1_Type::UtcTime:
  ------------------
  |  Branch (124:7): [True: 3, False: 441]
  ------------------
  125|      3|         return "UTC TIME";
  126|       |
  127|      2|      case ASN1_Type::GeneralizedTime:
  ------------------
  |  Branch (127:7): [True: 2, False: 442]
  ------------------
  128|      2|         return "GENERALIZED TIME";
  129|       |
  130|      1|      case ASN1_Type::OctetString:
  ------------------
  |  Branch (130:7): [True: 1, False: 443]
  ------------------
  131|      1|         return "OCTET STRING";
  132|       |
  133|      3|      case ASN1_Type::BitString:
  ------------------
  |  Branch (133:7): [True: 3, False: 441]
  ------------------
  134|      3|         return "BIT STRING";
  135|       |
  136|      3|      case ASN1_Type::Enumerated:
  ------------------
  |  Branch (136:7): [True: 3, False: 441]
  ------------------
  137|      3|         return "ENUMERATED";
  138|       |
  139|      8|      case ASN1_Type::Integer:
  ------------------
  |  Branch (139:7): [True: 8, False: 436]
  ------------------
  140|      8|         return "INTEGER";
  141|       |
  142|      2|      case ASN1_Type::Null:
  ------------------
  |  Branch (142:7): [True: 2, False: 442]
  ------------------
  143|      2|         return "NULL";
  144|       |
  145|      2|      case ASN1_Type::ObjectId:
  ------------------
  |  Branch (145:7): [True: 2, False: 442]
  ------------------
  146|      2|         return "OBJECT";
  147|       |
  148|      6|      case ASN1_Type::Boolean:
  ------------------
  |  Branch (148:7): [True: 6, False: 438]
  ------------------
  149|      6|         return "BOOLEAN";
  150|       |
  151|      1|      case ASN1_Type::NoObject:
  ------------------
  |  Branch (151:7): [True: 1, False: 443]
  ------------------
  152|      1|         return "NO_OBJECT";
  153|       |
  154|    129|      default:
  ------------------
  |  Branch (154:7): [True: 129, False: 315]
  ------------------
  155|    129|         return "TAG(" + std::to_string(static_cast<uint32_t>(type)) + ")";
  156|    444|   }
  157|    444|}
_ZN5Botan18BER_Decoding_ErrorC2ENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
  162|    513|BER_Decoding_Error::BER_Decoding_Error(std::string_view str) : Decoding_Error(fmt("BER: {}", str)) {}
_ZN5Botan11BER_Bad_TagC2ENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEj:
  164|     52|BER_Bad_Tag::BER_Bad_Tag(std::string_view str, uint32_t tagging) : BER_Decoding_Error(fmt("{}: {}", str, tagging)) {}
_ZN5Botan4ASN19to_stringERKNS_10BER_ObjectE:
  184|    542|std::string to_string(const BER_Object& obj) { return std::string(cast_uint8_ptr_to_char(obj.bits()), obj.length()); }

_ZN5BotanltERKNS_3OIDES2_:
  127|    104|bool operator<(const OID& a, const OID& b) {
  128|    104|   const std::vector<uint32_t>& oid1 = a.get_components();
  129|    104|   const std::vector<uint32_t>& oid2 = b.get_components();
  130|       |
  131|    104|   return std::lexicographical_compare(oid1.begin(), oid1.end(), oid2.begin(), oid2.end());
  132|    104|}
_ZN5Botan3OID11decode_fromERNS_11BER_DecoderE:
  185|  1.51k|void OID::decode_from(BER_Decoder& decoder) {
  186|  1.51k|   BER_Object obj = decoder.get_next_object();
  187|  1.51k|   if(obj.tagging() != (ASN1_Class::Universal | ASN1_Type::ObjectId)) {
  ------------------
  |  Branch (187:7): [True: 52, False: 1.45k]
  ------------------
  188|     52|      throw BER_Bad_Tag("Error decoding OID, unknown tag", obj.tagging());
  189|     52|   }
  190|       |
  191|  1.45k|   const size_t length = obj.length();
  192|  1.45k|   const uint8_t* bits = obj.bits();
  193|       |
  194|  1.45k|   if(length < 2 && !(length == 1 && bits[0] == 0)) {
  ------------------
  |  Branch (194:7): [True: 999, False: 460]
  |  Branch (194:23): [True: 996, False: 3]
  |  Branch (194:38): [True: 993, False: 3]
  ------------------
  195|      6|      throw BER_Decoding_Error("OID encoding is too short");
  196|      6|   }
  197|       |
  198|  1.45k|   m_id.clear();
  199|  1.45k|   m_id.push_back(bits[0] / 40);
  200|  1.45k|   m_id.push_back(bits[0] % 40);
  201|       |
  202|  1.45k|   size_t i = 0;
  203|  10.6k|   while(i != length - 1) {
  ------------------
  |  Branch (203:10): [True: 9.24k, False: 1.41k]
  ------------------
  204|  9.24k|      uint32_t component = 0;
  205|  10.6k|      while(i != length - 1) {
  ------------------
  |  Branch (205:13): [True: 10.5k, False: 108]
  ------------------
  206|  10.5k|         ++i;
  207|       |
  208|  10.5k|         if(component >> (32 - 7)) {
  ------------------
  |  Branch (208:13): [True: 35, False: 10.5k]
  ------------------
  209|     35|            throw Decoding_Error("OID component overflow");
  210|     35|         }
  211|       |
  212|  10.5k|         component = (component << 7) + (bits[i] & 0x7F);
  213|       |
  214|  10.5k|         if(!(bits[i] & 0x80)) {
  ------------------
  |  Branch (214:13): [True: 9.10k, False: 1.44k]
  ------------------
  215|  9.10k|            break;
  216|  9.10k|         }
  217|  10.5k|      }
  218|  9.21k|      m_id.push_back(component);
  219|  9.21k|   }
  220|  1.45k|}

_ZN5Botan11ASN1_StringC2ENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEENS_9ASN1_TypeE:
   62|  1.58k|ASN1_String::ASN1_String(std::string_view str, ASN1_Type t) : m_utf8_str(str), m_tag(t) {
   63|  1.58k|   if(!is_utf8_subset_string_type(m_tag)) {
  ------------------
  |  Branch (63:7): [True: 0, False: 1.58k]
  ------------------
   64|      0|      throw Invalid_Argument("ASN1_String only supports encoding to UTF-8 or a UTF-8 subset");
   65|      0|   }
   66|  1.58k|}
_ZN5Botan11ASN1_StringC2ENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
   68|  1.58k|ASN1_String::ASN1_String(std::string_view str) : ASN1_String(str, choose_encoding(str)) {}
_ZN5Botan11ASN1_String11decode_fromERNS_11BER_DecoderE:
   86|  1.41k|void ASN1_String::decode_from(BER_Decoder& source) {
   87|  1.41k|   BER_Object obj = source.get_next_object();
   88|       |
   89|  1.41k|   if(!is_asn1_string_type(obj.type())) {
  ------------------
  |  Branch (89:7): [True: 106, False: 1.30k]
  ------------------
   90|    106|      auto typ = static_cast<uint32_t>(obj.type());
   91|    106|      throw Decoding_Error(fmt("ASN1_String: Unknown string type {}", typ));
   92|    106|   }
   93|       |
   94|  1.30k|   m_tag = obj.type();
   95|  1.30k|   m_data.assign(obj.bits(), obj.bits() + obj.length());
   96|       |
   97|  1.30k|   if(m_tag == ASN1_Type::BmpString) {
  ------------------
  |  Branch (97:7): [True: 330, False: 974]
  ------------------
   98|    330|      m_utf8_str = ucs2_to_utf8(m_data.data(), m_data.size());
   99|    974|   } else if(m_tag == ASN1_Type::UniversalString) {
  ------------------
  |  Branch (99:14): [True: 120, False: 854]
  ------------------
  100|    120|      m_utf8_str = ucs4_to_utf8(m_data.data(), m_data.size());
  101|    854|   } else if(m_tag == ASN1_Type::TeletexString) {
  ------------------
  |  Branch (101:14): [True: 297, False: 557]
  ------------------
  102|       |      /*
  103|       |      TeletexString is nominally ITU T.61 not ISO-8859-1 but it seems
  104|       |      the majority of implementations actually used that charset here.
  105|       |      */
  106|    297|      m_utf8_str = latin1_to_utf8(m_data.data(), m_data.size());
  107|    557|   } else {
  108|       |      // All other supported string types are UTF-8 or some subset thereof
  109|    557|      m_utf8_str = ASN1::to_string(obj);
  110|    557|   }
  111|  1.30k|}
asn1_str.cpp:_ZN5Botan12_GLOBAL__N_119is_asn1_string_typeENS_9ASN1_TypeE:
   52|  1.39k|bool is_asn1_string_type(ASN1_Type tag) {
   53|  1.39k|   return (is_utf8_subset_string_type(tag) || tag == ASN1_Type::TeletexString || tag == ASN1_Type::BmpString ||
  ------------------
  |  Branch (53:12): [True: 542, False: 853]
  |  Branch (53:47): [True: 297, False: 556]
  |  Branch (53:82): [True: 330, False: 226]
  ------------------
   54|  1.39k|           tag == ASN1_Type::UniversalString);
  ------------------
  |  Branch (54:12): [True: 120, False: 106]
  ------------------
   55|  1.39k|}
asn1_str.cpp:_ZN5Botan12_GLOBAL__N_126is_utf8_subset_string_typeENS_9ASN1_TypeE:
   47|  2.98k|bool is_utf8_subset_string_type(ASN1_Type tag) {
   48|  2.98k|   return (tag == ASN1_Type::NumericString || tag == ASN1_Type::PrintableString || tag == ASN1_Type::VisibleString ||
  ------------------
  |  Branch (48:12): [True: 223, False: 2.76k]
  |  Branch (48:47): [True: 1.67k, False: 1.08k]
  |  Branch (48:84): [True: 74, False: 1.00k]
  ------------------
   49|  2.98k|           tag == ASN1_Type::Ia5String || tag == ASN1_Type::Utf8String);
  ------------------
  |  Branch (49:12): [True: 138, False: 871]
  |  Branch (49:43): [True: 18, False: 853]
  ------------------
   50|  2.98k|}
asn1_str.cpp:_ZN5Botan12_GLOBAL__N_115choose_encodingENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
   23|  1.58k|ASN1_Type choose_encoding(std::string_view str) {
   24|  1.58k|   auto all_printable = CT::Mask<uint8_t>::set();
   25|       |
   26|  1.58k|   for(size_t i = 0; i != str.size(); ++i) {
  ------------------
  |  Branch (26:22): [True: 0, False: 1.58k]
  ------------------
   27|      0|      const uint8_t c = static_cast<uint8_t>(str[i]);
   28|       |
   29|      0|      auto is_alpha_lower = CT::Mask<uint8_t>::is_within_range(c, 'a', 'z');
   30|      0|      auto is_alpha_upper = CT::Mask<uint8_t>::is_within_range(c, 'A', 'Z');
   31|      0|      auto is_decimal = CT::Mask<uint8_t>::is_within_range(c, '0', '9');
   32|       |
   33|      0|      auto is_print_punc = CT::Mask<uint8_t>::is_any_of(c, {' ', '(', ')', '+', ',', '-', '.', '/', ':', '=', '?'});
   34|       |
   35|      0|      auto is_printable = is_alpha_lower | is_alpha_upper | is_decimal | is_print_punc;
   36|       |
   37|      0|      all_printable &= is_printable;
   38|      0|   }
   39|       |
   40|  1.58k|   if(all_printable.is_set()) {
  ------------------
  |  Branch (40:7): [True: 1.58k, False: 0]
  ------------------
   41|  1.58k|      return ASN1_Type::PrintableString;
   42|  1.58k|   } else {
   43|      0|      return ASN1_Type::Utf8String;
   44|      0|   }
   45|  1.58k|}

_ZNK5Botan11BER_Decoder10more_itemsEv:
  195|  5.91k|bool BER_Decoder::more_items() const {
  196|  5.91k|   if(m_source->end_of_data() && !m_pushed.is_set()) {
  ------------------
  |  Branch (196:7): [True: 2.43k, False: 3.48k]
  |  Branch (196:34): [True: 2.43k, False: 0]
  ------------------
  197|  2.43k|      return false;
  198|  2.43k|   }
  199|  3.48k|   return true;
  200|  5.91k|}
_ZN5Botan11BER_Decoder15get_next_objectEv:
  229|  8.25k|BER_Object BER_Decoder::get_next_object() {
  230|  8.25k|   BER_Object next;
  231|       |
  232|  8.25k|   if(m_pushed.is_set()) {
  ------------------
  |  Branch (232:7): [True: 0, False: 8.25k]
  ------------------
  233|      0|      std::swap(next, m_pushed);
  234|      0|      return next;
  235|      0|   }
  236|       |
  237|  10.7k|   for(;;) {
  238|  10.7k|      ASN1_Type type_tag;
  239|  10.7k|      ASN1_Class class_tag;
  240|  10.7k|      decode_tag(m_source, type_tag, class_tag);
  241|  10.7k|      next.set_tagging(type_tag, class_tag);
  242|  10.7k|      if(next.is_set() == false) {  // no more objects
  ------------------
  |  Branch (242:10): [True: 60, False: 10.6k]
  ------------------
  243|     60|         return next;
  244|     60|      }
  245|       |
  246|  10.6k|      size_t field_size;
  247|  10.6k|      const size_t length = decode_length(m_source, field_size, ALLOWED_EOC_NESTINGS);
  248|  10.6k|      if(!m_source->check_available(length)) {
  ------------------
  |  Branch (248:10): [True: 124, False: 10.5k]
  ------------------
  249|    124|         throw BER_Decoding_Error("Value truncated");
  250|    124|      }
  251|       |
  252|  10.5k|      uint8_t* out = next.mutable_bits(length);
  253|  10.5k|      if(m_source->read(out, length) != length) {
  ------------------
  |  Branch (253:10): [True: 0, False: 10.5k]
  ------------------
  254|      0|         throw BER_Decoding_Error("Value truncated");
  255|      0|      }
  256|       |
  257|  10.5k|      if(next.tagging() == static_cast<uint32_t>(ASN1_Type::Eoc)) {
  ------------------
  |  Branch (257:10): [True: 2.44k, False: 8.06k]
  ------------------
  258|  2.44k|         continue;
  259|  8.06k|      } else {
  260|  8.06k|         break;
  261|  8.06k|      }
  262|  10.5k|   }
  263|       |
  264|  8.06k|   return next;
  265|  8.25k|}
_ZN5Botan11BER_Decoder10start_consENS_9ASN1_TypeENS_10ASN1_ClassE:
  284|  5.33k|BER_Decoder BER_Decoder::start_cons(ASN1_Type type_tag, ASN1_Class class_tag) {
  285|  5.33k|   BER_Object obj = get_next_object();
  286|  5.33k|   obj.assert_is_a(type_tag, class_tag | ASN1_Class::Constructed);
  287|  5.33k|   return BER_Decoder(std::move(obj), this);
  288|  5.33k|}
_ZN5Botan11BER_Decoder8end_consEv:
  293|  2.75k|BER_Decoder& BER_Decoder::end_cons() {
  294|  2.75k|   if(!m_parent) {
  ------------------
  |  Branch (294:7): [True: 0, False: 2.75k]
  ------------------
  295|      0|      throw Invalid_State("BER_Decoder::end_cons called with null parent");
  296|      0|   }
  297|  2.75k|   if(!m_source->end_of_data()) {
  ------------------
  |  Branch (297:7): [True: 62, False: 2.69k]
  ------------------
  298|     62|      throw Decoding_Error("BER_Decoder::end_cons called with data left");
  299|     62|   }
  300|  2.69k|   return (*m_parent);
  301|  2.75k|}
_ZN5Botan11BER_DecoderC2EONS_10BER_ObjectEPS0_:
  303|  4.89k|BER_Decoder::BER_Decoder(BER_Object&& obj, BER_Decoder* parent) {
  304|  4.89k|   m_data_src = std::make_unique<DataSource_BERObject>(std::move(obj));
  305|  4.89k|   m_source = m_data_src.get();
  306|  4.89k|   m_parent = parent;
  307|  4.89k|}
_ZN5Botan11BER_DecoderC2EPKhm:
  317|  1.84k|BER_Decoder::BER_Decoder(const uint8_t data[], size_t length) {
  318|  1.84k|   m_data_src = std::make_unique<DataSource_Memory>(data, length);
  319|  1.84k|   m_source = m_data_src.get();
  320|  1.84k|}
_ZN5Botan11BER_DecoderC2ERKNSt3__16vectorIhNS1_9allocatorIhEEEE:
  333|  1.55k|BER_Decoder::BER_Decoder(const std::vector<uint8_t>& data) {
  334|  1.55k|   m_data_src = std::make_unique<DataSource_Memory>(data.data(), data.size());
  335|  1.55k|   m_source = m_data_src.get();
  336|  1.55k|}
_ZN5Botan11BER_Decoder6decodeERNS_11ASN1_ObjectENS_9ASN1_TypeENS_10ASN1_ClassE:
  352|  4.77k|BER_Decoder& BER_Decoder::decode(ASN1_Object& obj, ASN1_Type /*unused*/, ASN1_Class /*unused*/) {
  353|  4.77k|   obj.decode_from(*this);
  354|  4.77k|   return (*this);
  355|  4.77k|}
ber_dec.cpp:_ZN5Botan12_GLOBAL__N_110decode_tagEPNS_10DataSourceERNS_9ASN1_TypeERNS_10ASN1_ClassE:
   29|  43.1k|size_t decode_tag(DataSource* ber, ASN1_Type& type_tag, ASN1_Class& class_tag) {
   30|  43.1k|   uint8_t b;
   31|  43.1k|   if(!ber->read_byte(b)) {
  ------------------
  |  Branch (31:7): [True: 5.85k, False: 37.3k]
  ------------------
   32|  5.85k|      type_tag = ASN1_Type::NoObject;
   33|  5.85k|      class_tag = ASN1_Class::NoObject;
   34|  5.85k|      return 0;
   35|  5.85k|   }
   36|       |
   37|  37.3k|   if((b & 0x1F) != 0x1F) {
  ------------------
  |  Branch (37:7): [True: 36.6k, False: 712]
  ------------------
   38|  36.6k|      type_tag = ASN1_Type(b & 0x1F);
   39|  36.6k|      class_tag = ASN1_Class(b & 0xE0);
   40|  36.6k|      return 1;
   41|  36.6k|   }
   42|       |
   43|    712|   size_t tag_bytes = 1;
   44|    712|   class_tag = ASN1_Class(b & 0xE0);
   45|       |
   46|    712|   size_t tag_buf = 0;
   47|  2.41k|   while(true) {
  ------------------
  |  Branch (47:10): [Folded - Ignored]
  ------------------
   48|  2.41k|      if(!ber->read_byte(b)) {
  ------------------
  |  Branch (48:10): [True: 5, False: 2.40k]
  ------------------
   49|      5|         throw BER_Decoding_Error("Long-form tag truncated");
   50|      5|      }
   51|  2.40k|      if(tag_buf & 0xFF000000) {
  ------------------
  |  Branch (51:10): [True: 8, False: 2.40k]
  ------------------
   52|      8|         throw BER_Decoding_Error("Long-form tag overflowed 32 bits");
   53|      8|      }
   54|  2.40k|      ++tag_bytes;
   55|  2.40k|      tag_buf = (tag_buf << 7) | (b & 0x7F);
   56|  2.40k|      if((b & 0x80) == 0) {
  ------------------
  |  Branch (56:10): [True: 699, False: 1.70k]
  ------------------
   57|    699|         break;
   58|    699|      }
   59|  2.40k|   }
   60|    699|   type_tag = ASN1_Type(tag_buf);
   61|    699|   return tag_bytes;
   62|    712|}
ber_dec.cpp:_ZN5Botan12_GLOBAL__N_113decode_lengthEPNS_10DataSourceERmm:
   72|  37.3k|size_t decode_length(DataSource* ber, size_t& field_size, size_t allow_indef) {
   73|  37.3k|   uint8_t b;
   74|  37.3k|   if(!ber->read_byte(b)) {
  ------------------
  |  Branch (74:7): [True: 39, False: 37.2k]
  ------------------
   75|     39|      throw BER_Decoding_Error("Length field not found");
   76|     39|   }
   77|  37.2k|   field_size = 1;
   78|  37.2k|   if((b & 0x80) == 0) {
  ------------------
  |  Branch (78:7): [True: 27.1k, False: 10.0k]
  ------------------
   79|  27.1k|      return b;
   80|  27.1k|   }
   81|       |
   82|  10.0k|   field_size += (b & 0x7F);
   83|  10.0k|   if(field_size > 5) {
  ------------------
  |  Branch (83:7): [True: 13, False: 10.0k]
  ------------------
   84|     13|      throw BER_Decoding_Error("Length field is too large");
   85|     13|   }
   86|       |
   87|  10.0k|   if(field_size == 1) {
  ------------------
  |  Branch (87:7): [True: 9.45k, False: 629]
  ------------------
   88|  9.45k|      if(allow_indef == 0) {
  ------------------
  |  Branch (88:10): [True: 1, False: 9.45k]
  ------------------
   89|      1|         throw BER_Decoding_Error("Nested EOC markers too deep, rejecting to avoid stack exhaustion");
   90|  9.45k|      } else {
   91|  9.45k|         return find_eoc(ber, allow_indef - 1);
   92|  9.45k|      }
   93|  9.45k|   }
   94|       |
   95|    629|   size_t length = 0;
   96|       |
   97|  1.83k|   for(size_t i = 0; i != field_size - 1; ++i) {
  ------------------
  |  Branch (97:22): [True: 1.22k, False: 616]
  ------------------
   98|  1.22k|      if(get_byte<0>(length) != 0) {
  ------------------
  |  Branch (98:10): [True: 0, False: 1.22k]
  ------------------
   99|      0|         throw BER_Decoding_Error("Field length overflow");
  100|      0|      }
  101|  1.22k|      if(!ber->read_byte(b)) {
  ------------------
  |  Branch (101:10): [True: 13, False: 1.20k]
  ------------------
  102|     13|         throw BER_Decoding_Error("Corrupted length field");
  103|     13|      }
  104|  1.20k|      length = (length << 8) | b;
  105|  1.20k|   }
  106|    616|   return length;
  107|    629|}
ber_dec.cpp:_ZN5Botan12_GLOBAL__N_18find_eocEPNS_10DataSourceEm:
  112|  9.45k|size_t find_eoc(DataSource* ber, size_t allow_indef) {
  113|  9.45k|   secure_vector<uint8_t> buffer(BOTAN_DEFAULT_BUFFER_SIZE), data;
  ------------------
  |  |  372|  9.45k|#define BOTAN_DEFAULT_BUFFER_SIZE 4096
  ------------------
  114|       |
  115|  18.0k|   while(true) {
  ------------------
  |  Branch (115:10): [Folded - Ignored]
  ------------------
  116|  18.0k|      const size_t got = ber->peek(buffer.data(), buffer.size(), data.size());
  117|  18.0k|      if(got == 0) {
  ------------------
  |  Branch (117:10): [True: 9.45k, False: 8.63k]
  ------------------
  118|  9.45k|         break;
  119|  9.45k|      }
  120|       |
  121|  8.63k|      data += std::make_pair(buffer.data(), got);
  122|  8.63k|   }
  123|       |
  124|  9.45k|   DataSource_Memory source(data);
  125|  9.45k|   data.clear();
  126|       |
  127|  9.45k|   size_t length = 0;
  128|  32.5k|   while(true) {
  ------------------
  |  Branch (128:10): [Folded - Ignored]
  ------------------
  129|  32.4k|      ASN1_Type type_tag;
  130|  32.4k|      ASN1_Class class_tag;
  131|  32.4k|      size_t tag_size = decode_tag(&source, type_tag, class_tag);
  132|  32.4k|      if(type_tag == ASN1_Type::NoObject) {
  ------------------
  |  Branch (132:10): [True: 5.79k, False: 26.6k]
  ------------------
  133|  5.79k|         break;
  134|  5.79k|      }
  135|       |
  136|  26.6k|      size_t length_size = 0;
  137|  26.6k|      size_t item_size = decode_length(&source, length_size, allow_indef);
  138|  26.6k|      source.discard_next(item_size);
  139|       |
  140|  26.6k|      length = BOTAN_CHECKED_ADD(length, item_size);
  ------------------
  |  |   72|  26.6k|#define BOTAN_CHECKED_ADD(x, y) checked_add(x, y, __FILE__, __LINE__)
  ------------------
  141|  26.6k|      length = BOTAN_CHECKED_ADD(length, tag_size);
  ------------------
  |  |   72|  26.6k|#define BOTAN_CHECKED_ADD(x, y) checked_add(x, y, __FILE__, __LINE__)
  ------------------
  142|  26.6k|      length = BOTAN_CHECKED_ADD(length, length_size);
  ------------------
  |  |   72|  26.6k|#define BOTAN_CHECKED_ADD(x, y) checked_add(x, y, __FILE__, __LINE__)
  ------------------
  143|       |
  144|  26.6k|      if(type_tag == ASN1_Type::Eoc && class_tag == ASN1_Class::Universal) {
  ------------------
  |  Branch (144:10): [True: 5.47k, False: 21.2k]
  |  Branch (144:40): [True: 3.57k, False: 1.90k]
  ------------------
  145|  3.57k|         break;
  146|  3.57k|      }
  147|  26.6k|   }
  148|  9.45k|   return length;
  149|  9.45k|}
ber_dec.cpp:_ZN5Botan12_GLOBAL__N_120DataSource_BERObjectC2EONS_10BER_ObjectE:
  183|  4.89k|      explicit DataSource_BERObject(BER_Object&& obj) : m_obj(std::move(obj)), m_offset(0) {}
ber_dec.cpp:_ZN5Botan12_GLOBAL__N_120DataSource_BERObject4readEPhm:
  153|  85.4k|      size_t read(uint8_t out[], size_t length) override {
  154|  85.4k|         BOTAN_ASSERT_NOMSG(m_offset <= m_obj.length());
  ------------------
  |  |   60|  85.4k|   do {                                                                     \
  |  |   61|  85.4k|      if(!(expr))                                                           \
  |  |  ------------------
  |  |  |  Branch (61:10): [True: 0, False: 85.4k]
  |  |  ------------------
  |  |   62|  85.4k|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   63|  85.4k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (63:12): [Folded - Ignored]
  |  |  ------------------
  ------------------
  155|  85.4k|         const size_t got = std::min<size_t>(m_obj.length() - m_offset, length);
  156|  85.4k|         copy_mem(out, m_obj.bits() + m_offset, got);
  157|  85.4k|         m_offset += got;
  158|  85.4k|         return got;
  159|  85.4k|      }
ber_dec.cpp:_ZN5Botan12_GLOBAL__N_120DataSource_BERObject15check_availableEm:
  174|  4.70k|      bool check_available(size_t n) override {
  175|  4.70k|         BOTAN_ASSERT_NOMSG(m_offset <= m_obj.length());
  ------------------
  |  |   60|  4.70k|   do {                                                                     \
  |  |   61|  4.70k|      if(!(expr))                                                           \
  |  |  ------------------
  |  |  |  Branch (61:10): [True: 0, False: 4.70k]
  |  |  ------------------
  |  |   62|  4.70k|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   63|  4.70k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (63:12): [Folded - Ignored]
  |  |  ------------------
  ------------------
  176|  4.70k|         return (n <= (m_obj.length() - m_offset));
  177|  4.70k|      }
ber_dec.cpp:_ZNK5Botan12_GLOBAL__N_120DataSource_BERObject4peekEPhmm:
  161|  1.31k|      size_t peek(uint8_t out[], size_t length, size_t peek_offset) const override {
  162|  1.31k|         BOTAN_ASSERT_NOMSG(m_offset <= m_obj.length());
  ------------------
  |  |   60|  1.31k|   do {                                                                     \
  |  |   61|  1.31k|      if(!(expr))                                                           \
  |  |  ------------------
  |  |  |  Branch (61:10): [True: 0, False: 1.31k]
  |  |  ------------------
  |  |   62|  1.31k|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   63|  1.31k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (63:12): [Folded - Ignored]
  |  |  ------------------
  ------------------
  163|  1.31k|         const size_t bytes_left = m_obj.length() - m_offset;
  164|       |
  165|  1.31k|         if(peek_offset >= bytes_left) {
  ------------------
  |  Branch (165:13): [True: 791, False: 524]
  ------------------
  166|    791|            return 0;
  167|    791|         }
  168|       |
  169|    524|         const size_t got = std::min(bytes_left - peek_offset, length);
  170|    524|         copy_mem(out, m_obj.bits() + m_offset + peek_offset, got);
  171|    524|         return got;
  172|  1.31k|      }
ber_dec.cpp:_ZNK5Botan12_GLOBAL__N_120DataSource_BERObject11end_of_dataEv:
  179|  5.73k|      bool end_of_data() const override { return get_bytes_read() == m_obj.length(); }
ber_dec.cpp:_ZNK5Botan12_GLOBAL__N_120DataSource_BERObject14get_bytes_readEv:
  181|  5.73k|      size_t get_bytes_read() const override { return m_offset; }

_ZN5Botan18SymmetricAlgorithm7set_keyEPKhm:
   15|      4|void SymmetricAlgorithm::set_key(const uint8_t key[], size_t length) {
   16|      4|   if(!valid_keylength(length)) {
  ------------------
  |  Branch (16:7): [True: 0, False: 4]
  ------------------
   17|      0|      throw Invalid_Key_Length(name(), length);
   18|      0|   }
   19|      4|   key_schedule(key, length);
   20|      4|}

_ZN5Botan11BlockCipher6createENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEES5_:
   87|    176|std::unique_ptr<BlockCipher> BlockCipher::create(std::string_view algo, std::string_view provider) {
   88|       |#if defined(BOTAN_HAS_COMMONCRYPTO)
   89|       |   if(provider.empty() || provider == "commoncrypto") {
   90|       |      if(auto bc = make_commoncrypto_block_cipher(algo))
   91|       |         return bc;
   92|       |
   93|       |      if(!provider.empty())
   94|       |         return nullptr;
   95|       |   }
   96|       |#endif
   97|       |
   98|       |   // TODO: CryptoAPI
   99|       |   // TODO: /dev/crypto
  100|       |
  101|       |   // Only base providers from here on out
  102|    176|   if(provider.empty() == false && provider != "base") {
  ------------------
  |  Branch (102:7): [True: 176, False: 0]
  |  Branch (102:36): [True: 88, False: 88]
  ------------------
  103|     88|      return nullptr;
  104|     88|   }
  105|       |
  106|     88|#if defined(BOTAN_HAS_AES)
  107|     88|   if(algo == "AES-128") {
  ------------------
  |  Branch (107:7): [True: 31, False: 57]
  ------------------
  108|     31|      return std::make_unique<AES_128>();
  109|     31|   }
  110|       |
  111|     57|   if(algo == "AES-192") {
  ------------------
  |  Branch (111:7): [True: 0, False: 57]
  ------------------
  112|      0|      return std::make_unique<AES_192>();
  113|      0|   }
  114|       |
  115|     57|   if(algo == "AES-256") {
  ------------------
  |  Branch (115:7): [True: 31, False: 26]
  ------------------
  116|     31|      return std::make_unique<AES_256>();
  117|     31|   }
  118|     26|#endif
  119|       |
  120|     26|#if defined(BOTAN_HAS_ARIA)
  121|     26|   if(algo == "ARIA-128") {
  ------------------
  |  Branch (121:7): [True: 5, False: 21]
  ------------------
  122|      5|      return std::make_unique<ARIA_128>();
  123|      5|   }
  124|       |
  125|     21|   if(algo == "ARIA-192") {
  ------------------
  |  Branch (125:7): [True: 0, False: 21]
  ------------------
  126|      0|      return std::make_unique<ARIA_192>();
  127|      0|   }
  128|       |
  129|     21|   if(algo == "ARIA-256") {
  ------------------
  |  Branch (129:7): [True: 5, False: 16]
  ------------------
  130|      5|      return std::make_unique<ARIA_256>();
  131|      5|   }
  132|     16|#endif
  133|       |
  134|     16|#if defined(BOTAN_HAS_SERPENT)
  135|     16|   if(algo == "Serpent") {
  ------------------
  |  Branch (135:7): [True: 0, False: 16]
  ------------------
  136|      0|      return std::make_unique<Serpent>();
  137|      0|   }
  138|     16|#endif
  139|       |
  140|     16|#if defined(BOTAN_HAS_SHACAL2)
  141|     16|   if(algo == "SHACAL2") {
  ------------------
  |  Branch (141:7): [True: 0, False: 16]
  ------------------
  142|      0|      return std::make_unique<SHACAL2>();
  143|      0|   }
  144|     16|#endif
  145|       |
  146|     16|#if defined(BOTAN_HAS_TWOFISH)
  147|     16|   if(algo == "Twofish") {
  ------------------
  |  Branch (147:7): [True: 0, False: 16]
  ------------------
  148|      0|      return std::make_unique<Twofish>();
  149|      0|   }
  150|     16|#endif
  151|       |
  152|     16|#if defined(BOTAN_HAS_THREEFISH_512)
  153|     16|   if(algo == "Threefish-512") {
  ------------------
  |  Branch (153:7): [True: 0, False: 16]
  ------------------
  154|      0|      return std::make_unique<Threefish_512>();
  155|      0|   }
  156|     16|#endif
  157|       |
  158|     16|#if defined(BOTAN_HAS_BLOWFISH)
  159|     16|   if(algo == "Blowfish") {
  ------------------
  |  Branch (159:7): [True: 0, False: 16]
  ------------------
  160|      0|      return std::make_unique<Blowfish>();
  161|      0|   }
  162|     16|#endif
  163|       |
  164|     16|#if defined(BOTAN_HAS_CAMELLIA)
  165|     16|   if(algo == "Camellia-128") {
  ------------------
  |  Branch (165:7): [True: 5, False: 11]
  ------------------
  166|      5|      return std::make_unique<Camellia_128>();
  167|      5|   }
  168|       |
  169|     11|   if(algo == "Camellia-192") {
  ------------------
  |  Branch (169:7): [True: 0, False: 11]
  ------------------
  170|      0|      return std::make_unique<Camellia_192>();
  171|      0|   }
  172|       |
  173|     11|   if(algo == "Camellia-256") {
  ------------------
  |  Branch (173:7): [True: 5, False: 6]
  ------------------
  174|      5|      return std::make_unique<Camellia_256>();
  175|      5|   }
  176|      6|#endif
  177|       |
  178|      6|#if defined(BOTAN_HAS_DES)
  179|      6|   if(algo == "DES") {
  ------------------
  |  Branch (179:7): [True: 0, False: 6]
  ------------------
  180|      0|      return std::make_unique<DES>();
  181|      0|   }
  182|       |
  183|      6|   if(algo == "TripleDES" || algo == "3DES" || algo == "DES-EDE") {
  ------------------
  |  Branch (183:7): [True: 0, False: 6]
  |  Branch (183:30): [True: 6, False: 0]
  |  Branch (183:48): [True: 0, False: 0]
  ------------------
  184|      6|      return std::make_unique<TripleDES>();
  185|      6|   }
  186|      0|#endif
  187|       |
  188|      0|#if defined(BOTAN_HAS_NOEKEON)
  189|      0|   if(algo == "Noekeon") {
  ------------------
  |  Branch (189:7): [True: 0, False: 0]
  ------------------
  190|      0|      return std::make_unique<Noekeon>();
  191|      0|   }
  192|      0|#endif
  193|       |
  194|      0|#if defined(BOTAN_HAS_CAST_128)
  195|      0|   if(algo == "CAST-128" || algo == "CAST5") {
  ------------------
  |  Branch (195:7): [True: 0, False: 0]
  |  Branch (195:29): [True: 0, False: 0]
  ------------------
  196|      0|      return std::make_unique<CAST_128>();
  197|      0|   }
  198|      0|#endif
  199|       |
  200|      0|#if defined(BOTAN_HAS_IDEA)
  201|      0|   if(algo == "IDEA") {
  ------------------
  |  Branch (201:7): [True: 0, False: 0]
  ------------------
  202|      0|      return std::make_unique<IDEA>();
  203|      0|   }
  204|      0|#endif
  205|       |
  206|      0|#if defined(BOTAN_HAS_SEED)
  207|      0|   if(algo == "SEED") {
  ------------------
  |  Branch (207:7): [True: 0, False: 0]
  ------------------
  208|      0|      return std::make_unique<SEED>();
  209|      0|   }
  210|      0|#endif
  211|       |
  212|      0|#if defined(BOTAN_HAS_SM4)
  213|      0|   if(algo == "SM4") {
  ------------------
  |  Branch (213:7): [True: 0, False: 0]
  ------------------
  214|      0|      return std::make_unique<SM4>();
  215|      0|   }
  216|      0|#endif
  217|       |
  218|      0|   const SCAN_Name req(algo);
  219|       |
  220|      0|#if defined(BOTAN_HAS_GOST_28147_89)
  221|      0|   if(req.algo_name() == "GOST-28147-89") {
  ------------------
  |  Branch (221:7): [True: 0, False: 0]
  ------------------
  222|      0|      return std::make_unique<GOST_28147_89>(req.arg(0, "R3411_94_TestParam"));
  223|      0|   }
  224|      0|#endif
  225|       |
  226|      0|#if defined(BOTAN_HAS_CASCADE)
  227|      0|   if(req.algo_name() == "Cascade" && req.arg_count() == 2) {
  ------------------
  |  Branch (227:7): [True: 0, False: 0]
  |  Branch (227:7): [True: 0, False: 0]
  |  Branch (227:39): [True: 0, False: 0]
  ------------------
  228|      0|      auto c1 = BlockCipher::create(req.arg(0));
  229|      0|      auto c2 = BlockCipher::create(req.arg(1));
  230|       |
  231|      0|      if(c1 && c2) {
  ------------------
  |  Branch (231:10): [True: 0, False: 0]
  |  Branch (231:16): [True: 0, False: 0]
  ------------------
  232|      0|         return std::make_unique<Cascade_Cipher>(std::move(c1), std::move(c2));
  233|      0|      }
  234|      0|   }
  235|      0|#endif
  236|       |
  237|      0|#if defined(BOTAN_HAS_LION)
  238|      0|   if(req.algo_name() == "Lion" && req.arg_count_between(2, 3)) {
  ------------------
  |  Branch (238:7): [True: 0, False: 0]
  |  Branch (238:7): [True: 0, False: 0]
  |  Branch (238:36): [True: 0, False: 0]
  ------------------
  239|      0|      auto hash = HashFunction::create(req.arg(0));
  240|      0|      auto stream = StreamCipher::create(req.arg(1));
  241|       |
  242|      0|      if(hash && stream) {
  ------------------
  |  Branch (242:10): [True: 0, False: 0]
  |  Branch (242:18): [True: 0, False: 0]
  ------------------
  243|      0|         const size_t block_size = req.arg_as_integer(2, 1024);
  244|      0|         return std::make_unique<Lion>(std::move(hash), std::move(stream), block_size);
  245|      0|      }
  246|      0|   }
  247|      0|#endif
  248|       |
  249|      0|   BOTAN_UNUSED(req);
  ------------------
  |  |  118|      0|#define BOTAN_UNUSED Botan::ignore_params
  ------------------
  250|      0|   BOTAN_UNUSED(provider);
  ------------------
  |  |  118|      0|#define BOTAN_UNUSED Botan::ignore_params
  ------------------
  251|       |
  252|      0|   return nullptr;
  253|      0|}
_ZN5Botan11BlockCipher9providersENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
  263|     88|std::vector<std::string> BlockCipher::providers(std::string_view algo) {
  264|     88|   return probe_providers_of<BlockCipher>(algo, {"base", "commoncrypto"});
  265|     88|}

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

_ZN5Botan16MDx_HashFunctionC2Embbh:
   26|  2.62k|      m_position(0) {
   27|  2.62k|   if(!is_power_of_2(block_len)) {
  ------------------
  |  Branch (27:7): [True: 0, False: 2.62k]
  ------------------
   28|      0|      throw Invalid_Argument("MDx_HashFunction block length must be a power of 2");
   29|      0|   }
   30|  2.62k|   if(m_block_bits < 3 || m_block_bits > 16) {
  ------------------
  |  Branch (30:7): [True: 0, False: 2.62k]
  |  Branch (30:27): [True: 0, False: 2.62k]
  ------------------
   31|      0|      throw Invalid_Argument("MDx_HashFunction block size too large or too small");
   32|      0|   }
   33|  2.62k|   if(m_counter_size < 8 || m_counter_size > block_len) {
  ------------------
  |  Branch (33:7): [True: 0, False: 2.62k]
  |  Branch (33:29): [True: 0, False: 2.62k]
  ------------------
   34|      0|      throw Invalid_State("MDx_HashFunction invalid counter length");
   35|      0|   }
   36|  2.62k|}
_ZN5Botan16MDx_HashFunction5clearEv:
   41|  5.13k|void MDx_HashFunction::clear() {
   42|  5.13k|   zeroise(m_buffer);
   43|  5.13k|   m_count = m_position = 0;
   44|  5.13k|}
_ZN5Botan16MDx_HashFunction8add_dataEPKhm:
   49|  2.50k|void MDx_HashFunction::add_data(const uint8_t input[], size_t length) {
   50|  2.50k|   const size_t block_len = static_cast<size_t>(1) << m_block_bits;
   51|       |
   52|  2.50k|   m_count += length;
   53|       |
   54|  2.50k|   if(m_position) {
  ------------------
  |  Branch (54:7): [True: 0, False: 2.50k]
  ------------------
   55|      0|      buffer_insert(m_buffer, m_position, input, length);
   56|       |
   57|      0|      if(m_position + length >= block_len) {
  ------------------
  |  Branch (57:10): [True: 0, False: 0]
  ------------------
   58|      0|         compress_n(m_buffer.data(), 1);
   59|      0|         input += (block_len - m_position);
   60|      0|         length -= (block_len - m_position);
   61|      0|         m_position = 0;
   62|      0|      }
   63|      0|   }
   64|       |
   65|       |   // Just in case the compiler can't figure out block_len is a power of 2
   66|  2.50k|   const size_t full_blocks = length >> m_block_bits;
   67|  2.50k|   const size_t remaining = length & (block_len - 1);
   68|       |
   69|  2.50k|   if(full_blocks > 0) {
  ------------------
  |  Branch (69:7): [True: 6, False: 2.50k]
  ------------------
   70|      6|      compress_n(input, full_blocks);
   71|      6|   }
   72|       |
   73|  2.50k|   buffer_insert(m_buffer, m_position, input + full_blocks * block_len, remaining);
   74|  2.50k|   m_position += remaining;
   75|  2.50k|}
_ZN5Botan16MDx_HashFunction12final_resultEPh:
   80|  2.50k|void MDx_HashFunction::final_result(uint8_t output[]) {
   81|  2.50k|   const size_t block_len = static_cast<size_t>(1) << m_block_bits;
   82|       |
   83|  2.50k|   clear_mem(&m_buffer[m_position], block_len - m_position);
   84|  2.50k|   m_buffer[m_position] = m_pad_char;
   85|       |
   86|  2.50k|   if(m_position >= block_len - m_counter_size) {
  ------------------
  |  Branch (86:7): [True: 0, False: 2.50k]
  ------------------
   87|      0|      compress_n(m_buffer.data(), 1);
   88|      0|      zeroise(m_buffer);
   89|      0|   }
   90|       |
   91|  2.50k|   BOTAN_ASSERT_NOMSG(m_counter_size <= output_length());
  ------------------
  |  |   60|  2.50k|   do {                                                                     \
  |  |   61|  2.50k|      if(!(expr))                                                           \
  |  |  ------------------
  |  |  |  Branch (61:10): [True: 0, False: 2.50k]
  |  |  ------------------
  |  |   62|  2.50k|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   63|  2.50k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (63:12): [Folded - Ignored]
  |  |  ------------------
  ------------------
   92|  2.50k|   BOTAN_ASSERT_NOMSG(m_counter_size >= 8);
  ------------------
  |  |   60|  2.50k|   do {                                                                     \
  |  |   61|  2.50k|      if(!(expr))                                                           \
  |  |  ------------------
  |  |  |  Branch (61:10): [True: 0, False: 2.50k]
  |  |  ------------------
  |  |   62|  2.50k|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   63|  2.50k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (63:12): [Folded - Ignored]
  |  |  ------------------
  ------------------
   93|       |
   94|  2.50k|   const uint64_t bit_count = m_count * 8;
   95|       |
   96|  2.50k|   if(m_count_big_endian) {
  ------------------
  |  Branch (96:7): [True: 2.50k, False: 0]
  ------------------
   97|  2.50k|      store_be(bit_count, &m_buffer[block_len - 8]);
   98|  2.50k|   } else {
   99|      0|      store_le(bit_count, &m_buffer[block_len - 8]);
  100|      0|   }
  101|       |
  102|  2.50k|   compress_n(m_buffer.data(), 1);
  103|  2.50k|   copy_out(output);
  104|  2.50k|   clear();
  105|  2.50k|}

_ZN5Botan5SHA_15clearEv:
  204|     36|void SHA_1::clear() {
  205|     36|   MDx_HashFunction::clear();
  206|     36|   zeroise(m_W);
  207|     36|   m_digest[0] = 0x67452301;
  208|     36|   m_digest[1] = 0xEFCDAB89;
  209|     36|   m_digest[2] = 0x98BADCFE;
  210|     36|   m_digest[3] = 0x10325476;
  211|     36|   m_digest[4] = 0xC3D2E1F0;
  212|     36|}

_ZN5Botan7SHA_25615compress_digestERNSt3__16vectorIjNS_16secure_allocatorIjEEEEPKhm:
   52|  2.51k|void SHA_256::compress_digest(secure_vector<uint32_t>& digest, const uint8_t input[], size_t blocks) {
   53|  2.51k|#if defined(BOTAN_HAS_SHA2_32_X86)
   54|  2.51k|   if(CPUID::has_intel_sha()) {
  ------------------
  |  Branch (54:7): [True: 0, False: 2.51k]
  ------------------
   55|      0|      return SHA_256::compress_digest_x86(digest, input, blocks);
   56|      0|   }
   57|  2.51k|#endif
   58|       |
   59|  2.51k|#if defined(BOTAN_HAS_SHA2_32_X86_BMI2)
   60|  2.51k|   if(CPUID::has_bmi2()) {
  ------------------
  |  Branch (60:7): [True: 2.51k, False: 0]
  ------------------
   61|  2.51k|      return SHA_256::compress_digest_x86_bmi2(digest, input, blocks);
   62|  2.51k|   }
   63|      0|#endif
   64|       |
   65|       |#if defined(BOTAN_HAS_SHA2_32_ARMV8)
   66|       |   if(CPUID::has_arm_sha2()) {
   67|       |      return SHA_256::compress_digest_armv8(digest, input, blocks);
   68|       |   }
   69|       |#endif
   70|       |
   71|      0|   uint32_t A = digest[0], B = digest[1], C = digest[2], D = digest[3], E = digest[4], F = digest[5], G = digest[6],
   72|      0|            H = digest[7];
   73|       |
   74|      0|   for(size_t i = 0; i != blocks; ++i) {
  ------------------
  |  Branch (74:22): [True: 0, False: 0]
  ------------------
   75|      0|      uint32_t W00 = load_be<uint32_t>(input, 0);
   76|      0|      uint32_t W01 = load_be<uint32_t>(input, 1);
   77|      0|      uint32_t W02 = load_be<uint32_t>(input, 2);
   78|      0|      uint32_t W03 = load_be<uint32_t>(input, 3);
   79|      0|      uint32_t W04 = load_be<uint32_t>(input, 4);
   80|      0|      uint32_t W05 = load_be<uint32_t>(input, 5);
   81|      0|      uint32_t W06 = load_be<uint32_t>(input, 6);
   82|      0|      uint32_t W07 = load_be<uint32_t>(input, 7);
   83|      0|      uint32_t W08 = load_be<uint32_t>(input, 8);
   84|      0|      uint32_t W09 = load_be<uint32_t>(input, 9);
   85|      0|      uint32_t W10 = load_be<uint32_t>(input, 10);
   86|      0|      uint32_t W11 = load_be<uint32_t>(input, 11);
   87|      0|      uint32_t W12 = load_be<uint32_t>(input, 12);
   88|      0|      uint32_t W13 = load_be<uint32_t>(input, 13);
   89|      0|      uint32_t W14 = load_be<uint32_t>(input, 14);
   90|      0|      uint32_t W15 = load_be<uint32_t>(input, 15);
   91|       |
   92|      0|      SHA2_32_F(A, B, C, D, E, F, G, H, W00, W14, W09, W01, 0x428A2F98);
   93|      0|      SHA2_32_F(H, A, B, C, D, E, F, G, W01, W15, W10, W02, 0x71374491);
   94|      0|      SHA2_32_F(G, H, A, B, C, D, E, F, W02, W00, W11, W03, 0xB5C0FBCF);
   95|      0|      SHA2_32_F(F, G, H, A, B, C, D, E, W03, W01, W12, W04, 0xE9B5DBA5);
   96|      0|      SHA2_32_F(E, F, G, H, A, B, C, D, W04, W02, W13, W05, 0x3956C25B);
   97|      0|      SHA2_32_F(D, E, F, G, H, A, B, C, W05, W03, W14, W06, 0x59F111F1);
   98|      0|      SHA2_32_F(C, D, E, F, G, H, A, B, W06, W04, W15, W07, 0x923F82A4);
   99|      0|      SHA2_32_F(B, C, D, E, F, G, H, A, W07, W05, W00, W08, 0xAB1C5ED5);
  100|      0|      SHA2_32_F(A, B, C, D, E, F, G, H, W08, W06, W01, W09, 0xD807AA98);
  101|      0|      SHA2_32_F(H, A, B, C, D, E, F, G, W09, W07, W02, W10, 0x12835B01);
  102|      0|      SHA2_32_F(G, H, A, B, C, D, E, F, W10, W08, W03, W11, 0x243185BE);
  103|      0|      SHA2_32_F(F, G, H, A, B, C, D, E, W11, W09, W04, W12, 0x550C7DC3);
  104|      0|      SHA2_32_F(E, F, G, H, A, B, C, D, W12, W10, W05, W13, 0x72BE5D74);
  105|      0|      SHA2_32_F(D, E, F, G, H, A, B, C, W13, W11, W06, W14, 0x80DEB1FE);
  106|      0|      SHA2_32_F(C, D, E, F, G, H, A, B, W14, W12, W07, W15, 0x9BDC06A7);
  107|      0|      SHA2_32_F(B, C, D, E, F, G, H, A, W15, W13, W08, W00, 0xC19BF174);
  108|       |
  109|      0|      SHA2_32_F(A, B, C, D, E, F, G, H, W00, W14, W09, W01, 0xE49B69C1);
  110|      0|      SHA2_32_F(H, A, B, C, D, E, F, G, W01, W15, W10, W02, 0xEFBE4786);
  111|      0|      SHA2_32_F(G, H, A, B, C, D, E, F, W02, W00, W11, W03, 0x0FC19DC6);
  112|      0|      SHA2_32_F(F, G, H, A, B, C, D, E, W03, W01, W12, W04, 0x240CA1CC);
  113|      0|      SHA2_32_F(E, F, G, H, A, B, C, D, W04, W02, W13, W05, 0x2DE92C6F);
  114|      0|      SHA2_32_F(D, E, F, G, H, A, B, C, W05, W03, W14, W06, 0x4A7484AA);
  115|      0|      SHA2_32_F(C, D, E, F, G, H, A, B, W06, W04, W15, W07, 0x5CB0A9DC);
  116|      0|      SHA2_32_F(B, C, D, E, F, G, H, A, W07, W05, W00, W08, 0x76F988DA);
  117|      0|      SHA2_32_F(A, B, C, D, E, F, G, H, W08, W06, W01, W09, 0x983E5152);
  118|      0|      SHA2_32_F(H, A, B, C, D, E, F, G, W09, W07, W02, W10, 0xA831C66D);
  119|      0|      SHA2_32_F(G, H, A, B, C, D, E, F, W10, W08, W03, W11, 0xB00327C8);
  120|      0|      SHA2_32_F(F, G, H, A, B, C, D, E, W11, W09, W04, W12, 0xBF597FC7);
  121|      0|      SHA2_32_F(E, F, G, H, A, B, C, D, W12, W10, W05, W13, 0xC6E00BF3);
  122|      0|      SHA2_32_F(D, E, F, G, H, A, B, C, W13, W11, W06, W14, 0xD5A79147);
  123|      0|      SHA2_32_F(C, D, E, F, G, H, A, B, W14, W12, W07, W15, 0x06CA6351);
  124|      0|      SHA2_32_F(B, C, D, E, F, G, H, A, W15, W13, W08, W00, 0x14292967);
  125|       |
  126|      0|      SHA2_32_F(A, B, C, D, E, F, G, H, W00, W14, W09, W01, 0x27B70A85);
  127|      0|      SHA2_32_F(H, A, B, C, D, E, F, G, W01, W15, W10, W02, 0x2E1B2138);
  128|      0|      SHA2_32_F(G, H, A, B, C, D, E, F, W02, W00, W11, W03, 0x4D2C6DFC);
  129|      0|      SHA2_32_F(F, G, H, A, B, C, D, E, W03, W01, W12, W04, 0x53380D13);
  130|      0|      SHA2_32_F(E, F, G, H, A, B, C, D, W04, W02, W13, W05, 0x650A7354);
  131|      0|      SHA2_32_F(D, E, F, G, H, A, B, C, W05, W03, W14, W06, 0x766A0ABB);
  132|      0|      SHA2_32_F(C, D, E, F, G, H, A, B, W06, W04, W15, W07, 0x81C2C92E);
  133|      0|      SHA2_32_F(B, C, D, E, F, G, H, A, W07, W05, W00, W08, 0x92722C85);
  134|      0|      SHA2_32_F(A, B, C, D, E, F, G, H, W08, W06, W01, W09, 0xA2BFE8A1);
  135|      0|      SHA2_32_F(H, A, B, C, D, E, F, G, W09, W07, W02, W10, 0xA81A664B);
  136|      0|      SHA2_32_F(G, H, A, B, C, D, E, F, W10, W08, W03, W11, 0xC24B8B70);
  137|      0|      SHA2_32_F(F, G, H, A, B, C, D, E, W11, W09, W04, W12, 0xC76C51A3);
  138|      0|      SHA2_32_F(E, F, G, H, A, B, C, D, W12, W10, W05, W13, 0xD192E819);
  139|      0|      SHA2_32_F(D, E, F, G, H, A, B, C, W13, W11, W06, W14, 0xD6990624);
  140|      0|      SHA2_32_F(C, D, E, F, G, H, A, B, W14, W12, W07, W15, 0xF40E3585);
  141|      0|      SHA2_32_F(B, C, D, E, F, G, H, A, W15, W13, W08, W00, 0x106AA070);
  142|       |
  143|      0|      SHA2_32_F(A, B, C, D, E, F, G, H, W00, W14, W09, W01, 0x19A4C116);
  144|      0|      SHA2_32_F(H, A, B, C, D, E, F, G, W01, W15, W10, W02, 0x1E376C08);
  145|      0|      SHA2_32_F(G, H, A, B, C, D, E, F, W02, W00, W11, W03, 0x2748774C);
  146|      0|      SHA2_32_F(F, G, H, A, B, C, D, E, W03, W01, W12, W04, 0x34B0BCB5);
  147|      0|      SHA2_32_F(E, F, G, H, A, B, C, D, W04, W02, W13, W05, 0x391C0CB3);
  148|      0|      SHA2_32_F(D, E, F, G, H, A, B, C, W05, W03, W14, W06, 0x4ED8AA4A);
  149|      0|      SHA2_32_F(C, D, E, F, G, H, A, B, W06, W04, W15, W07, 0x5B9CCA4F);
  150|      0|      SHA2_32_F(B, C, D, E, F, G, H, A, W07, W05, W00, W08, 0x682E6FF3);
  151|      0|      SHA2_32_F(A, B, C, D, E, F, G, H, W08, W06, W01, W09, 0x748F82EE);
  152|      0|      SHA2_32_F(H, A, B, C, D, E, F, G, W09, W07, W02, W10, 0x78A5636F);
  153|      0|      SHA2_32_F(G, H, A, B, C, D, E, F, W10, W08, W03, W11, 0x84C87814);
  154|      0|      SHA2_32_F(F, G, H, A, B, C, D, E, W11, W09, W04, W12, 0x8CC70208);
  155|      0|      SHA2_32_F(E, F, G, H, A, B, C, D, W12, W10, W05, W13, 0x90BEFFFA);
  156|      0|      SHA2_32_F(D, E, F, G, H, A, B, C, W13, W11, W06, W14, 0xA4506CEB);
  157|      0|      SHA2_32_F(C, D, E, F, G, H, A, B, W14, W12, W07, W15, 0xBEF9A3F7);
  158|      0|      SHA2_32_F(B, C, D, E, F, G, H, A, W15, W13, W08, W00, 0xC67178F2);
  159|       |
  160|      0|      A = (digest[0] += A);
  161|      0|      B = (digest[1] += B);
  162|      0|      C = (digest[2] += C);
  163|      0|      D = (digest[3] += D);
  164|      0|      E = (digest[4] += E);
  165|      0|      F = (digest[5] += F);
  166|      0|      G = (digest[6] += G);
  167|      0|      H = (digest[7] += H);
  168|       |
  169|      0|      input += 64;
  170|      0|   }
  171|      0|}
_ZN5Botan7SHA_25610compress_nEPKhm:
  205|  2.51k|void SHA_256::compress_n(const uint8_t input[], size_t blocks) { SHA_256::compress_digest(m_digest, input, blocks); }
_ZN5Botan7SHA_2568copy_outEPh:
  210|  2.50k|void SHA_256::copy_out(uint8_t output[]) { copy_out_vec_be(output, output_length(), m_digest); }
_ZN5Botan7SHA_2565clearEv:
  215|  5.07k|void SHA_256::clear() {
  216|  5.07k|   MDx_HashFunction::clear();
  217|  5.07k|   m_digest[0] = 0x6A09E667;
  218|  5.07k|   m_digest[1] = 0xBB67AE85;
  219|  5.07k|   m_digest[2] = 0x3C6EF372;
  220|  5.07k|   m_digest[3] = 0xA54FF53A;
  221|  5.07k|   m_digest[4] = 0x510E527F;
  222|  5.07k|   m_digest[5] = 0x9B05688C;
  223|  5.07k|   m_digest[6] = 0x1F83D9AB;
  224|  5.07k|   m_digest[7] = 0x5BE0CD19;
  225|  5.07k|}

_ZN5Botan7SHA_25624compress_digest_x86_bmi2ERNSt3__16vectorIjNS_16secure_allocatorIjEEEEPKhm:
   23|  2.51k|void SHA_256::compress_digest_x86_bmi2(secure_vector<uint32_t>& digest, const uint8_t input[], size_t blocks) {
   24|  2.51k|   uint32_t A = digest[0], B = digest[1], C = digest[2], D = digest[3], E = digest[4], F = digest[5], G = digest[6],
   25|  2.51k|            H = digest[7];
   26|       |
   27|  5.02k|   for(size_t i = 0; i != blocks; ++i) {
  ------------------
  |  Branch (27:22): [True: 2.51k, False: 2.51k]
  ------------------
   28|  2.51k|      uint32_t W00 = load_be<uint32_t>(input, 0);
   29|  2.51k|      uint32_t W01 = load_be<uint32_t>(input, 1);
   30|  2.51k|      uint32_t W02 = load_be<uint32_t>(input, 2);
   31|  2.51k|      uint32_t W03 = load_be<uint32_t>(input, 3);
   32|  2.51k|      uint32_t W04 = load_be<uint32_t>(input, 4);
   33|  2.51k|      uint32_t W05 = load_be<uint32_t>(input, 5);
   34|  2.51k|      uint32_t W06 = load_be<uint32_t>(input, 6);
   35|  2.51k|      uint32_t W07 = load_be<uint32_t>(input, 7);
   36|  2.51k|      uint32_t W08 = load_be<uint32_t>(input, 8);
   37|  2.51k|      uint32_t W09 = load_be<uint32_t>(input, 9);
   38|  2.51k|      uint32_t W10 = load_be<uint32_t>(input, 10);
   39|  2.51k|      uint32_t W11 = load_be<uint32_t>(input, 11);
   40|  2.51k|      uint32_t W12 = load_be<uint32_t>(input, 12);
   41|  2.51k|      uint32_t W13 = load_be<uint32_t>(input, 13);
   42|  2.51k|      uint32_t W14 = load_be<uint32_t>(input, 14);
   43|  2.51k|      uint32_t W15 = load_be<uint32_t>(input, 15);
   44|       |
   45|  2.51k|      SHA2_32_F(A, B, C, D, E, F, G, H, W00, W14, W09, W01, 0x428A2F98);
   46|  2.51k|      SHA2_32_F(H, A, B, C, D, E, F, G, W01, W15, W10, W02, 0x71374491);
   47|  2.51k|      SHA2_32_F(G, H, A, B, C, D, E, F, W02, W00, W11, W03, 0xB5C0FBCF);
   48|  2.51k|      SHA2_32_F(F, G, H, A, B, C, D, E, W03, W01, W12, W04, 0xE9B5DBA5);
   49|  2.51k|      SHA2_32_F(E, F, G, H, A, B, C, D, W04, W02, W13, W05, 0x3956C25B);
   50|  2.51k|      SHA2_32_F(D, E, F, G, H, A, B, C, W05, W03, W14, W06, 0x59F111F1);
   51|  2.51k|      SHA2_32_F(C, D, E, F, G, H, A, B, W06, W04, W15, W07, 0x923F82A4);
   52|  2.51k|      SHA2_32_F(B, C, D, E, F, G, H, A, W07, W05, W00, W08, 0xAB1C5ED5);
   53|  2.51k|      SHA2_32_F(A, B, C, D, E, F, G, H, W08, W06, W01, W09, 0xD807AA98);
   54|  2.51k|      SHA2_32_F(H, A, B, C, D, E, F, G, W09, W07, W02, W10, 0x12835B01);
   55|  2.51k|      SHA2_32_F(G, H, A, B, C, D, E, F, W10, W08, W03, W11, 0x243185BE);
   56|  2.51k|      SHA2_32_F(F, G, H, A, B, C, D, E, W11, W09, W04, W12, 0x550C7DC3);
   57|  2.51k|      SHA2_32_F(E, F, G, H, A, B, C, D, W12, W10, W05, W13, 0x72BE5D74);
   58|  2.51k|      SHA2_32_F(D, E, F, G, H, A, B, C, W13, W11, W06, W14, 0x80DEB1FE);
   59|  2.51k|      SHA2_32_F(C, D, E, F, G, H, A, B, W14, W12, W07, W15, 0x9BDC06A7);
   60|  2.51k|      SHA2_32_F(B, C, D, E, F, G, H, A, W15, W13, W08, W00, 0xC19BF174);
   61|       |
   62|  2.51k|      SHA2_32_F(A, B, C, D, E, F, G, H, W00, W14, W09, W01, 0xE49B69C1);
   63|  2.51k|      SHA2_32_F(H, A, B, C, D, E, F, G, W01, W15, W10, W02, 0xEFBE4786);
   64|  2.51k|      SHA2_32_F(G, H, A, B, C, D, E, F, W02, W00, W11, W03, 0x0FC19DC6);
   65|  2.51k|      SHA2_32_F(F, G, H, A, B, C, D, E, W03, W01, W12, W04, 0x240CA1CC);
   66|  2.51k|      SHA2_32_F(E, F, G, H, A, B, C, D, W04, W02, W13, W05, 0x2DE92C6F);
   67|  2.51k|      SHA2_32_F(D, E, F, G, H, A, B, C, W05, W03, W14, W06, 0x4A7484AA);
   68|  2.51k|      SHA2_32_F(C, D, E, F, G, H, A, B, W06, W04, W15, W07, 0x5CB0A9DC);
   69|  2.51k|      SHA2_32_F(B, C, D, E, F, G, H, A, W07, W05, W00, W08, 0x76F988DA);
   70|  2.51k|      SHA2_32_F(A, B, C, D, E, F, G, H, W08, W06, W01, W09, 0x983E5152);
   71|  2.51k|      SHA2_32_F(H, A, B, C, D, E, F, G, W09, W07, W02, W10, 0xA831C66D);
   72|  2.51k|      SHA2_32_F(G, H, A, B, C, D, E, F, W10, W08, W03, W11, 0xB00327C8);
   73|  2.51k|      SHA2_32_F(F, G, H, A, B, C, D, E, W11, W09, W04, W12, 0xBF597FC7);
   74|  2.51k|      SHA2_32_F(E, F, G, H, A, B, C, D, W12, W10, W05, W13, 0xC6E00BF3);
   75|  2.51k|      SHA2_32_F(D, E, F, G, H, A, B, C, W13, W11, W06, W14, 0xD5A79147);
   76|  2.51k|      SHA2_32_F(C, D, E, F, G, H, A, B, W14, W12, W07, W15, 0x06CA6351);
   77|  2.51k|      SHA2_32_F(B, C, D, E, F, G, H, A, W15, W13, W08, W00, 0x14292967);
   78|       |
   79|  2.51k|      SHA2_32_F(A, B, C, D, E, F, G, H, W00, W14, W09, W01, 0x27B70A85);
   80|  2.51k|      SHA2_32_F(H, A, B, C, D, E, F, G, W01, W15, W10, W02, 0x2E1B2138);
   81|  2.51k|      SHA2_32_F(G, H, A, B, C, D, E, F, W02, W00, W11, W03, 0x4D2C6DFC);
   82|  2.51k|      SHA2_32_F(F, G, H, A, B, C, D, E, W03, W01, W12, W04, 0x53380D13);
   83|  2.51k|      SHA2_32_F(E, F, G, H, A, B, C, D, W04, W02, W13, W05, 0x650A7354);
   84|  2.51k|      SHA2_32_F(D, E, F, G, H, A, B, C, W05, W03, W14, W06, 0x766A0ABB);
   85|  2.51k|      SHA2_32_F(C, D, E, F, G, H, A, B, W06, W04, W15, W07, 0x81C2C92E);
   86|  2.51k|      SHA2_32_F(B, C, D, E, F, G, H, A, W07, W05, W00, W08, 0x92722C85);
   87|  2.51k|      SHA2_32_F(A, B, C, D, E, F, G, H, W08, W06, W01, W09, 0xA2BFE8A1);
   88|  2.51k|      SHA2_32_F(H, A, B, C, D, E, F, G, W09, W07, W02, W10, 0xA81A664B);
   89|  2.51k|      SHA2_32_F(G, H, A, B, C, D, E, F, W10, W08, W03, W11, 0xC24B8B70);
   90|  2.51k|      SHA2_32_F(F, G, H, A, B, C, D, E, W11, W09, W04, W12, 0xC76C51A3);
   91|  2.51k|      SHA2_32_F(E, F, G, H, A, B, C, D, W12, W10, W05, W13, 0xD192E819);
   92|  2.51k|      SHA2_32_F(D, E, F, G, H, A, B, C, W13, W11, W06, W14, 0xD6990624);
   93|  2.51k|      SHA2_32_F(C, D, E, F, G, H, A, B, W14, W12, W07, W15, 0xF40E3585);
   94|  2.51k|      SHA2_32_F(B, C, D, E, F, G, H, A, W15, W13, W08, W00, 0x106AA070);
   95|       |
   96|  2.51k|      SHA2_32_F(A, B, C, D, E, F, G, H, W00, W14, W09, W01, 0x19A4C116);
   97|  2.51k|      SHA2_32_F(H, A, B, C, D, E, F, G, W01, W15, W10, W02, 0x1E376C08);
   98|  2.51k|      SHA2_32_F(G, H, A, B, C, D, E, F, W02, W00, W11, W03, 0x2748774C);
   99|  2.51k|      SHA2_32_F(F, G, H, A, B, C, D, E, W03, W01, W12, W04, 0x34B0BCB5);
  100|  2.51k|      SHA2_32_F(E, F, G, H, A, B, C, D, W04, W02, W13, W05, 0x391C0CB3);
  101|  2.51k|      SHA2_32_F(D, E, F, G, H, A, B, C, W05, W03, W14, W06, 0x4ED8AA4A);
  102|  2.51k|      SHA2_32_F(C, D, E, F, G, H, A, B, W06, W04, W15, W07, 0x5B9CCA4F);
  103|  2.51k|      SHA2_32_F(B, C, D, E, F, G, H, A, W07, W05, W00, W08, 0x682E6FF3);
  104|  2.51k|      SHA2_32_F(A, B, C, D, E, F, G, H, W08, W06, W01, W09, 0x748F82EE);
  105|  2.51k|      SHA2_32_F(H, A, B, C, D, E, F, G, W09, W07, W02, W10, 0x78A5636F);
  106|  2.51k|      SHA2_32_F(G, H, A, B, C, D, E, F, W10, W08, W03, W11, 0x84C87814);
  107|  2.51k|      SHA2_32_F(F, G, H, A, B, C, D, E, W11, W09, W04, W12, 0x8CC70208);
  108|  2.51k|      SHA2_32_F(E, F, G, H, A, B, C, D, W12, W10, W05, W13, 0x90BEFFFA);
  109|  2.51k|      SHA2_32_F(D, E, F, G, H, A, B, C, W13, W11, W06, W14, 0xA4506CEB);
  110|  2.51k|      SHA2_32_F(C, D, E, F, G, H, A, B, W14, W12, W07, W15, 0xBEF9A3F7);
  111|  2.51k|      SHA2_32_F(B, C, D, E, F, G, H, A, W15, W13, W08, W00, 0xC67178F2);
  112|       |
  113|  2.51k|      A = (digest[0] += A);
  114|  2.51k|      B = (digest[1] += B);
  115|  2.51k|      C = (digest[2] += C);
  116|  2.51k|      D = (digest[3] += D);
  117|  2.51k|      E = (digest[4] += E);
  118|  2.51k|      F = (digest[5] += F);
  119|  2.51k|      G = (digest[6] += G);
  120|  2.51k|      H = (digest[7] += H);
  121|       |
  122|  2.51k|      input += 64;
  123|  2.51k|   }
  124|  2.51k|}

_ZN5Botan7SHA_3845clearEv:
  198|     25|void SHA_384::clear() {
  199|     25|   MDx_HashFunction::clear();
  200|     25|   m_digest[0] = 0xCBBB9D5DC1059ED8;
  201|     25|   m_digest[1] = 0x629A292A367CD507;
  202|     25|   m_digest[2] = 0x9159015A3070DD17;
  203|     25|   m_digest[3] = 0x152FECD8F70E5939;
  204|     25|   m_digest[4] = 0x67332667FFC00B31;
  205|     25|   m_digest[5] = 0x8EB44A8768581511;
  206|     25|   m_digest[6] = 0xDB0C2E0D64F98FA7;
  207|     25|   m_digest[7] = 0x47B5481DBEFA4FA4;
  208|     25|}

_ZN5Botan4HMAC8add_dataEPKhm:
   19|      1|void HMAC::add_data(const uint8_t input[], size_t length) {
   20|      1|   assert_key_material_set();
   21|      1|   m_hash->update(input, length);
   22|      1|}
_ZN5Botan4HMAC12final_resultEPh:
   27|      2|void HMAC::final_result(uint8_t mac[]) {
   28|      2|   assert_key_material_set();
   29|      2|   m_hash->final(mac);
   30|      2|   m_hash->update(m_okey);
   31|      2|   m_hash->update(mac, m_hash_output_length);
   32|      2|   m_hash->final(mac);
   33|      2|   m_hash->update(m_ikey);
   34|      2|}
_ZNK5Botan4HMAC8key_specEv:
   36|      2|Key_Length_Specification HMAC::key_spec() const {
   37|       |   // Support very long lengths for things like PBKDF2 and the TLS PRF
   38|      2|   return Key_Length_Specification(0, 4096);
   39|      2|}
_ZNK5Botan4HMAC13output_lengthEv:
   41|      4|size_t HMAC::output_length() const { return m_hash_output_length; }
_ZNK5Botan4HMAC19has_keying_materialEv:
   43|      3|bool HMAC::has_keying_material() const { return !m_okey.empty(); }
_ZN5Botan4HMAC12key_scheduleEPKhm:
   48|      2|void HMAC::key_schedule(const uint8_t key[], size_t length) {
   49|      2|   const uint8_t ipad = 0x36;
   50|      2|   const uint8_t opad = 0x5C;
   51|       |
   52|      2|   m_hash->clear();
   53|       |
   54|      2|   m_ikey.resize(m_hash_block_size);
   55|      2|   m_okey.resize(m_hash_block_size);
   56|       |
   57|      2|   clear_mem(m_ikey.data(), m_ikey.size());
   58|      2|   clear_mem(m_okey.data(), m_okey.size());
   59|       |
   60|       |   /*
   61|       |   * Sometimes the HMAC key length itself is sensitive, as with PBKDF2 where it
   62|       |   * reveals the length of the passphrase. Make some attempt to hide this to
   63|       |   * side channels. Clearly if the secret is longer than the block size then the
   64|       |   * branch to hash first reveals that. In addition, counting the number of
   65|       |   * compression functions executed reveals the size at the granularity of the
   66|       |   * hash function's block size.
   67|       |   *
   68|       |   * The greater concern is for smaller keys; being able to detect when a
   69|       |   * passphrase is say 4 bytes may assist choosing weaker targets. Even though
   70|       |   * the loop bounds are constant, we can only actually read key[0..length] so
   71|       |   * it doesn't seem possible to make this computation truly constant time.
   72|       |   *
   73|       |   * We don't mind leaking if the length is exactly zero since that's
   74|       |   * trivial to simply check.
   75|       |   */
   76|       |
   77|      2|   if(length > m_hash_block_size) {
  ------------------
  |  Branch (77:7): [True: 0, False: 2]
  ------------------
   78|      0|      m_hash->update(key, length);
   79|      0|      m_hash->final(m_ikey.data());
   80|      2|   } else if(length > 0) {
  ------------------
  |  Branch (80:14): [True: 2, False: 0]
  ------------------
   81|    130|      for(size_t i = 0, i_mod_length = 0; i != m_hash_block_size; ++i) {
  ------------------
  |  Branch (81:43): [True: 128, False: 2]
  ------------------
   82|       |         /*
   83|       |         access key[i % length] but avoiding division due to variable
   84|       |         time computation on some processors.
   85|       |         */
   86|    128|         auto needs_reduction = CT::Mask<size_t>::is_lte(length, i_mod_length);
   87|    128|         i_mod_length = needs_reduction.select(0, i_mod_length);
   88|    128|         const uint8_t kb = key[i_mod_length];
   89|       |
   90|    128|         auto in_range = CT::Mask<size_t>::is_lt(i, length);
   91|    128|         m_ikey[i] = static_cast<uint8_t>(in_range.if_set_return(kb));
   92|    128|         i_mod_length += 1;
   93|    128|      }
   94|      2|   }
   95|       |
   96|    130|   for(size_t i = 0; i != m_hash_block_size; ++i) {
  ------------------
  |  Branch (96:22): [True: 128, False: 2]
  ------------------
   97|    128|      m_ikey[i] ^= ipad;
   98|    128|      m_okey[i] = m_ikey[i] ^ ipad ^ opad;
   99|    128|   }
  100|       |
  101|      2|   m_hash->update(m_ikey);
  102|      2|}
_ZN5Botan4HMACC2ENSt3__110unique_ptrINS_12HashFunctionENS1_14default_deleteIS3_EEEE:
  131|      1|      m_hash_block_size(m_hash->hash_block_size()) {
  132|      1|   BOTAN_ARG_CHECK(m_hash_block_size >= m_hash_output_length, "HMAC is not compatible with this hash function");
  ------------------
  |  |   30|      1|   do {                                                          \
  |  |   31|      1|      if(!(expr))                                                \
  |  |  ------------------
  |  |  |  Branch (31:10): [True: 0, False: 1]
  |  |  ------------------
  |  |   32|      1|         Botan::throw_invalid_argument(msg, __func__, __FILE__); \
  |  |   33|      1|   } while(0)
  |  |  ------------------
  |  |  |  Branch (33:12): [Folded - Ignored]
  |  |  ------------------
  ------------------
  133|      1|}

_ZN5Botan25MessageAuthenticationCode6createENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEES5_:
   47|      1|                                                                             std::string_view provider) {
   48|      1|   const SCAN_Name req(algo_spec);
   49|       |
   50|      1|#if defined(BOTAN_HAS_BLAKE2BMAC)
   51|      1|   if(req.algo_name() == "Blake2b" || req.algo_name() == "BLAKE2b") {
  ------------------
  |  Branch (51:7): [True: 0, False: 1]
  |  Branch (51:7): [True: 0, False: 1]
  |  Branch (51:39): [True: 0, False: 1]
  ------------------
   52|      0|      return std::make_unique<BLAKE2bMAC>(req.arg_as_integer(0, 512));
   53|      0|   }
   54|      1|#endif
   55|       |
   56|      1|#if defined(BOTAN_HAS_GMAC)
   57|      1|   if(req.algo_name() == "GMAC" && req.arg_count() == 1) {
  ------------------
  |  Branch (57:7): [True: 0, False: 1]
  |  Branch (57:7): [True: 0, False: 1]
  |  Branch (57:36): [True: 0, False: 0]
  ------------------
   58|      0|      if(provider.empty() || provider == "base") {
  ------------------
  |  Branch (58:10): [True: 0, False: 0]
  |  Branch (58:30): [True: 0, False: 0]
  ------------------
   59|      0|         if(auto bc = BlockCipher::create(req.arg(0))) {
  ------------------
  |  Branch (59:18): [True: 0, False: 0]
  ------------------
   60|      0|            return std::make_unique<GMAC>(std::move(bc));
   61|      0|         }
   62|      0|      }
   63|      0|   }
   64|      1|#endif
   65|       |
   66|      1|#if defined(BOTAN_HAS_HMAC)
   67|      1|   if(req.algo_name() == "HMAC" && req.arg_count() == 1) {
  ------------------
  |  Branch (67:7): [True: 1, False: 0]
  |  Branch (67:7): [True: 1, False: 0]
  |  Branch (67:36): [True: 1, False: 0]
  ------------------
   68|      1|      if(provider.empty() || provider == "base") {
  ------------------
  |  Branch (68:10): [True: 1, False: 0]
  |  Branch (68:30): [True: 0, False: 0]
  ------------------
   69|      1|         if(auto hash = HashFunction::create(req.arg(0))) {
  ------------------
  |  Branch (69:18): [True: 1, False: 0]
  ------------------
   70|      1|            return std::make_unique<HMAC>(std::move(hash));
   71|      1|         }
   72|      1|      }
   73|      1|   }
   74|      0|#endif
   75|       |
   76|      0|#if defined(BOTAN_HAS_POLY1305)
   77|      0|   if(req.algo_name() == "Poly1305" && req.arg_count() == 0) {
  ------------------
  |  Branch (77:7): [True: 0, False: 0]
  |  Branch (77:7): [True: 0, False: 0]
  |  Branch (77:40): [True: 0, False: 0]
  ------------------
   78|      0|      if(provider.empty() || provider == "base") {
  ------------------
  |  Branch (78:10): [True: 0, False: 0]
  |  Branch (78:30): [True: 0, False: 0]
  ------------------
   79|      0|         return std::make_unique<Poly1305>();
   80|      0|      }
   81|      0|   }
   82|      0|#endif
   83|       |
   84|      0|#if defined(BOTAN_HAS_SIPHASH)
   85|      0|   if(req.algo_name() == "SipHash") {
  ------------------
  |  Branch (85:7): [True: 0, False: 0]
  ------------------
   86|      0|      if(provider.empty() || provider == "base") {
  ------------------
  |  Branch (86:10): [True: 0, False: 0]
  |  Branch (86:30): [True: 0, False: 0]
  ------------------
   87|      0|         return std::make_unique<SipHash>(req.arg_as_integer(0, 2), req.arg_as_integer(1, 4));
   88|      0|      }
   89|      0|   }
   90|      0|#endif
   91|       |
   92|      0|#if defined(BOTAN_HAS_CMAC)
   93|      0|   if((req.algo_name() == "CMAC" || req.algo_name() == "OMAC") && req.arg_count() == 1) {
  ------------------
  |  Branch (93:7): [True: 0, False: 0]
  |  Branch (93:8): [True: 0, False: 0]
  |  Branch (93:37): [True: 0, False: 0]
  |  Branch (93:67): [True: 0, False: 0]
  ------------------
   94|      0|      if(provider.empty() || provider == "base") {
  ------------------
  |  Branch (94:10): [True: 0, False: 0]
  |  Branch (94:30): [True: 0, False: 0]
  ------------------
   95|      0|         if(auto bc = BlockCipher::create(req.arg(0))) {
  ------------------
  |  Branch (95:18): [True: 0, False: 0]
  ------------------
   96|      0|            return std::make_unique<CMAC>(std::move(bc));
   97|      0|         }
   98|      0|      }
   99|      0|   }
  100|      0|#endif
  101|       |
  102|      0|#if defined(BOTAN_HAS_ANSI_X919_MAC)
  103|      0|   if(req.algo_name() == "X9.19-MAC") {
  ------------------
  |  Branch (103:7): [True: 0, False: 0]
  ------------------
  104|      0|      if(provider.empty() || provider == "base") {
  ------------------
  |  Branch (104:10): [True: 0, False: 0]
  |  Branch (104:30): [True: 0, False: 0]
  ------------------
  105|      0|         return std::make_unique<ANSI_X919_MAC>();
  106|      0|      }
  107|      0|   }
  108|      0|#endif
  109|       |
  110|      0|   BOTAN_UNUSED(req);
  ------------------
  |  |  118|      0|#define BOTAN_UNUSED Botan::ignore_params
  ------------------
  111|      0|   BOTAN_UNUSED(provider);
  ------------------
  |  |  118|      0|#define BOTAN_UNUSED Botan::ignore_params
  ------------------
  112|       |
  113|      0|   return nullptr;
  114|      0|}
_ZN5Botan25MessageAuthenticationCode15create_or_throwENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEES5_:
  122|      1|                                                                                      std::string_view provider) {
  123|      1|   if(auto mac = MessageAuthenticationCode::create(algo, provider)) {
  ------------------
  |  Branch (123:12): [True: 1, False: 0]
  ------------------
  124|      1|      return mac;
  125|      1|   }
  126|      0|   throw Lookup_Error("MAC", algo, provider);
  127|      1|}

_ZN5Botan10ChaCha_RNGC2ENSt3__14spanIKhLm18446744073709551615EEE:
   18|      1|ChaCha_RNG::ChaCha_RNG(std::span<const uint8_t> seed) : Stateful_RNG() {
   19|      1|   m_hmac = MessageAuthenticationCode::create_or_throw("HMAC(SHA-256)");
   20|      1|   m_chacha = StreamCipher::create_or_throw("ChaCha(20)");
   21|      1|   clear();
   22|      1|   add_entropy(seed);
   23|      1|}
_ZN5Botan10ChaCha_RNG11clear_stateEv:
   48|      1|void ChaCha_RNG::clear_state() {
   49|      1|   m_hmac->set_key(std::vector<uint8_t>(m_hmac->output_length(), 0x00));
   50|      1|   m_chacha->set_key(m_hmac->final());
   51|      1|}
_ZN5Botan10ChaCha_RNG15generate_outputENSt3__14spanIhLm18446744073709551615EEENS2_IKhLm18446744073709551615EEE:
   53|  2.50k|void ChaCha_RNG::generate_output(std::span<uint8_t> output, std::span<const uint8_t> input) {
   54|  2.50k|   BOTAN_ASSERT_NOMSG(!output.empty());
  ------------------
  |  |   60|  2.50k|   do {                                                                     \
  |  |   61|  2.50k|      if(!(expr))                                                           \
  |  |  ------------------
  |  |  |  Branch (61:10): [True: 0, False: 2.50k]
  |  |  ------------------
  |  |   62|  2.50k|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   63|  2.50k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (63:12): [Folded - Ignored]
  |  |  ------------------
  ------------------
   55|       |
   56|  2.50k|   if(!input.empty()) {
  ------------------
  |  Branch (56:7): [True: 0, False: 2.50k]
  ------------------
   57|      0|      update(input);
   58|      0|   }
   59|       |
   60|  2.50k|   m_chacha->write_keystream(output);
   61|  2.50k|}
_ZN5Botan10ChaCha_RNG6updateENSt3__14spanIKhLm18446744073709551615EEE:
   63|      1|void ChaCha_RNG::update(std::span<const uint8_t> input) {
   64|      1|   m_hmac->update(input);
   65|      1|   m_chacha->set_key(m_hmac->final());
   66|      1|   const auto mac_key = m_chacha->keystream_bytes(m_hmac->output_length());
   67|      1|   m_hmac->set_key(mac_key);
   68|      1|}
_ZNK5Botan10ChaCha_RNG14security_levelEv:
   70|      1|size_t ChaCha_RNG::security_level() const { return 256; }

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

_ZN5Botan6ChaChaC2Em:
   69|      1|ChaCha::ChaCha(size_t rounds) : m_rounds(rounds) {
   70|      1|   BOTAN_ARG_CHECK(m_rounds == 8 || m_rounds == 12 || m_rounds == 20, "ChaCha only supports 8, 12 or 20 rounds");
  ------------------
  |  |   30|      1|   do {                                                          \
  |  |   31|      4|      if(!(expr))                                                \
  |  |  ------------------
  |  |  |  Branch (31:12): [True: 0, False: 1]
  |  |  |  Branch (31:12): [True: 0, False: 1]
  |  |  |  Branch (31:12): [True: 1, False: 0]
  |  |  ------------------
  |  |   32|      1|         Botan::throw_invalid_argument(msg, __func__, __FILE__); \
  |  |   33|      1|   } while(0)
  |  |  ------------------
  |  |  |  Branch (33:12): [Folded - Ignored]
  |  |  ------------------
  ------------------
   71|      1|}
_ZN5Botan6ChaCha11parallelismEv:
   73|      2|size_t ChaCha::parallelism() {
   74|      2|#if defined(BOTAN_HAS_CHACHA_AVX512)
   75|      2|   if(CPUID::has_avx512()) {
  ------------------
  |  Branch (75:7): [True: 0, False: 2]
  ------------------
   76|      0|      return 16;
   77|      0|   }
   78|      2|#endif
   79|       |
   80|      2|#if defined(BOTAN_HAS_CHACHA_AVX2)
   81|      2|   if(CPUID::has_avx2()) {
  ------------------
  |  Branch (81:7): [True: 2, False: 0]
  ------------------
   82|      2|      return 8;
   83|      2|   }
   84|      0|#endif
   85|       |
   86|      0|   return 4;
   87|      2|}
_ZN5Botan6ChaCha6chachaEPhmPjm:
  111|    158|void ChaCha::chacha(uint8_t output[], size_t output_blocks, uint32_t state[16], size_t rounds) {
  112|    158|   BOTAN_ASSERT(rounds % 2 == 0, "Valid rounds");
  ------------------
  |  |   51|    158|   do {                                                                                 \
  |  |   52|    158|      if(!(expr))                                                                       \
  |  |  ------------------
  |  |  |  Branch (52:10): [True: 0, False: 158]
  |  |  ------------------
  |  |   53|    158|         Botan::assertion_failure(#expr, assertion_made, __func__, __FILE__, __LINE__); \
  |  |   54|    158|   } while(0)
  |  |  ------------------
  |  |  |  Branch (54:12): [Folded - Ignored]
  |  |  ------------------
  ------------------
  113|       |
  114|    158|#if defined(BOTAN_HAS_CHACHA_AVX512)
  115|    158|   if(CPUID::has_avx512()) {
  ------------------
  |  Branch (115:7): [True: 0, False: 158]
  ------------------
  116|      0|      while(output_blocks >= 16) {
  ------------------
  |  Branch (116:13): [True: 0, False: 0]
  ------------------
  117|      0|         ChaCha::chacha_avx512_x16(output, state, rounds);
  118|      0|         output += 16 * 64;
  119|      0|         output_blocks -= 16;
  120|      0|      }
  121|      0|   }
  122|    158|#endif
  123|       |
  124|    158|#if defined(BOTAN_HAS_CHACHA_AVX2)
  125|    158|   if(CPUID::has_avx2()) {
  ------------------
  |  Branch (125:7): [True: 158, False: 0]
  ------------------
  126|    316|      while(output_blocks >= 8) {
  ------------------
  |  Branch (126:13): [True: 158, False: 158]
  ------------------
  127|    158|         ChaCha::chacha_avx2_x8(output, state, rounds);
  128|    158|         output += 8 * 64;
  129|    158|         output_blocks -= 8;
  130|    158|      }
  131|    158|   }
  132|    158|#endif
  133|       |
  134|    158|#if defined(BOTAN_HAS_CHACHA_SIMD32)
  135|    158|   if(CPUID::has_simd_32()) {
  ------------------
  |  Branch (135:7): [True: 158, False: 0]
  ------------------
  136|    158|      while(output_blocks >= 4) {
  ------------------
  |  Branch (136:13): [True: 0, False: 158]
  ------------------
  137|      0|         ChaCha::chacha_simd32_x4(output, state, rounds);
  138|      0|         output += 4 * 64;
  139|      0|         output_blocks -= 4;
  140|      0|      }
  141|    158|   }
  142|    158|#endif
  143|       |
  144|       |   // TODO interleave rounds
  145|    158|   for(size_t i = 0; i != output_blocks; ++i) {
  ------------------
  |  Branch (145:22): [True: 0, False: 158]
  ------------------
  146|      0|      uint32_t x00 = state[0], x01 = state[1], x02 = state[2], x03 = state[3], x04 = state[4], x05 = state[5],
  147|      0|               x06 = state[6], x07 = state[7], x08 = state[8], x09 = state[9], x10 = state[10], x11 = state[11],
  148|      0|               x12 = state[12], x13 = state[13], x14 = state[14], x15 = state[15];
  149|       |
  150|      0|      for(size_t r = 0; r != rounds / 2; ++r) {
  ------------------
  |  Branch (150:25): [True: 0, False: 0]
  ------------------
  151|      0|         chacha_quarter_round(x00, x04, x08, x12);
  152|      0|         chacha_quarter_round(x01, x05, x09, x13);
  153|      0|         chacha_quarter_round(x02, x06, x10, x14);
  154|      0|         chacha_quarter_round(x03, x07, x11, x15);
  155|       |
  156|      0|         chacha_quarter_round(x00, x05, x10, x15);
  157|      0|         chacha_quarter_round(x01, x06, x11, x12);
  158|      0|         chacha_quarter_round(x02, x07, x08, x13);
  159|      0|         chacha_quarter_round(x03, x04, x09, x14);
  160|      0|      }
  161|       |
  162|      0|      x00 += state[0];
  163|      0|      x01 += state[1];
  164|      0|      x02 += state[2];
  165|      0|      x03 += state[3];
  166|      0|      x04 += state[4];
  167|      0|      x05 += state[5];
  168|      0|      x06 += state[6];
  169|      0|      x07 += state[7];
  170|      0|      x08 += state[8];
  171|      0|      x09 += state[9];
  172|      0|      x10 += state[10];
  173|      0|      x11 += state[11];
  174|      0|      x12 += state[12];
  175|      0|      x13 += state[13];
  176|      0|      x14 += state[14];
  177|      0|      x15 += state[15];
  178|       |
  179|      0|      store_le(x00, output + 64 * i + 4 * 0);
  180|      0|      store_le(x01, output + 64 * i + 4 * 1);
  181|      0|      store_le(x02, output + 64 * i + 4 * 2);
  182|      0|      store_le(x03, output + 64 * i + 4 * 3);
  183|      0|      store_le(x04, output + 64 * i + 4 * 4);
  184|      0|      store_le(x05, output + 64 * i + 4 * 5);
  185|      0|      store_le(x06, output + 64 * i + 4 * 6);
  186|      0|      store_le(x07, output + 64 * i + 4 * 7);
  187|      0|      store_le(x08, output + 64 * i + 4 * 8);
  188|      0|      store_le(x09, output + 64 * i + 4 * 9);
  189|      0|      store_le(x10, output + 64 * i + 4 * 10);
  190|      0|      store_le(x11, output + 64 * i + 4 * 11);
  191|      0|      store_le(x12, output + 64 * i + 4 * 12);
  192|      0|      store_le(x13, output + 64 * i + 4 * 13);
  193|      0|      store_le(x14, output + 64 * i + 4 * 14);
  194|      0|      store_le(x15, output + 64 * i + 4 * 15);
  195|       |
  196|      0|      state[12]++;
  197|      0|      state[13] += (state[12] == 0);
  198|      0|   }
  199|    158|}
_ZN5Botan6ChaCha18generate_keystreamEPhm:
  224|  2.50k|void ChaCha::generate_keystream(uint8_t out[], size_t length) {
  225|  2.50k|   assert_key_material_set();
  226|       |
  227|  2.65k|   while(length >= m_buffer.size() - m_position) {
  ------------------
  |  Branch (227:10): [True: 156, False: 2.50k]
  ------------------
  228|    156|      const size_t available = m_buffer.size() - m_position;
  229|       |
  230|       |      // TODO: this could write directly to the output buffer
  231|       |      // instead of bouncing it through m_buffer first
  232|    156|      copy_mem(out, &m_buffer[m_position], available);
  233|    156|      chacha(m_buffer.data(), m_buffer.size() / 64, m_state.data(), m_rounds);
  234|       |
  235|    156|      length -= available;
  236|    156|      out += available;
  237|    156|      m_position = 0;
  238|    156|   }
  239|       |
  240|  2.50k|   copy_mem(out, &m_buffer[m_position], length);
  241|       |
  242|  2.50k|   m_position += length;
  243|  2.50k|}
_ZN5Botan6ChaCha16initialize_stateEv:
  245|      2|void ChaCha::initialize_state() {
  246|      2|   static const uint32_t TAU[] = {0x61707865, 0x3120646e, 0x79622d36, 0x6b206574};
  247|       |
  248|      2|   static const uint32_t SIGMA[] = {0x61707865, 0x3320646e, 0x79622d32, 0x6b206574};
  249|       |
  250|      2|   m_state[4] = m_key[0];
  251|      2|   m_state[5] = m_key[1];
  252|      2|   m_state[6] = m_key[2];
  253|      2|   m_state[7] = m_key[3];
  254|       |
  255|      2|   if(m_key.size() == 4) {
  ------------------
  |  Branch (255:7): [True: 0, False: 2]
  ------------------
  256|      0|      m_state[0] = TAU[0];
  257|      0|      m_state[1] = TAU[1];
  258|      0|      m_state[2] = TAU[2];
  259|      0|      m_state[3] = TAU[3];
  260|       |
  261|      0|      m_state[8] = m_key[0];
  262|      0|      m_state[9] = m_key[1];
  263|      0|      m_state[10] = m_key[2];
  264|      0|      m_state[11] = m_key[3];
  265|      2|   } else {
  266|      2|      m_state[0] = SIGMA[0];
  267|      2|      m_state[1] = SIGMA[1];
  268|      2|      m_state[2] = SIGMA[2];
  269|      2|      m_state[3] = SIGMA[3];
  270|       |
  271|      2|      m_state[8] = m_key[4];
  272|      2|      m_state[9] = m_key[5];
  273|      2|      m_state[10] = m_key[6];
  274|      2|      m_state[11] = m_key[7];
  275|      2|   }
  276|       |
  277|      2|   m_state[12] = 0;
  278|      2|   m_state[13] = 0;
  279|      2|   m_state[14] = 0;
  280|      2|   m_state[15] = 0;
  281|       |
  282|      2|   m_position = 0;
  283|      2|}
_ZNK5Botan6ChaCha19has_keying_materialEv:
  285|  2.50k|bool ChaCha::has_keying_material() const { return !m_state.empty(); }
_ZN5Botan6ChaCha12key_scheduleEPKhm:
  292|      2|void ChaCha::key_schedule(const uint8_t key[], size_t length) {
  293|      2|   m_key.resize(length / 4);
  294|      2|   load_le<uint32_t>(m_key.data(), key, m_key.size());
  295|       |
  296|      2|   m_state.resize(16);
  297|       |
  298|      2|   const size_t chacha_block = 64;
  299|      2|   m_buffer.resize(parallelism() * chacha_block);
  300|       |
  301|      2|   set_iv(nullptr, 0);
  302|      2|}
_ZNK5Botan6ChaCha8key_specEv:
  306|      2|Key_Length_Specification ChaCha::key_spec() const { return Key_Length_Specification(16, 32, 16); }
_ZNK5Botan6ChaCha15valid_iv_lengthEm:
  310|      2|bool ChaCha::valid_iv_length(size_t iv_len) const {
  311|      2|   return (iv_len == 0 || iv_len == 8 || iv_len == 12 || iv_len == 24);
  ------------------
  |  Branch (311:12): [True: 2, False: 0]
  |  Branch (311:27): [True: 0, False: 0]
  |  Branch (311:42): [True: 0, False: 0]
  |  Branch (311:58): [True: 0, False: 0]
  ------------------
  312|      2|}
_ZN5Botan6ChaCha12set_iv_bytesEPKhm:
  314|      2|void ChaCha::set_iv_bytes(const uint8_t iv[], size_t length) {
  315|      2|   assert_key_material_set();
  316|       |
  317|      2|   if(!valid_iv_length(length)) {
  ------------------
  |  Branch (317:7): [True: 0, False: 2]
  ------------------
  318|      0|      throw Invalid_IV_Length(name(), length);
  319|      0|   }
  320|       |
  321|      2|   initialize_state();
  322|       |
  323|      2|   if(length == 0) {
  ------------------
  |  Branch (323:7): [True: 2, False: 0]
  ------------------
  324|       |      // Treat zero length IV same as an all-zero IV
  325|      2|      m_state[14] = 0;
  326|      2|      m_state[15] = 0;
  327|      2|   } else if(length == 8) {
  ------------------
  |  Branch (327:14): [True: 0, False: 0]
  ------------------
  328|      0|      m_state[14] = load_le<uint32_t>(iv, 0);
  329|      0|      m_state[15] = load_le<uint32_t>(iv, 1);
  330|      0|   } else if(length == 12) {
  ------------------
  |  Branch (330:14): [True: 0, False: 0]
  ------------------
  331|      0|      m_state[13] = load_le<uint32_t>(iv, 0);
  332|      0|      m_state[14] = load_le<uint32_t>(iv, 1);
  333|      0|      m_state[15] = load_le<uint32_t>(iv, 2);
  334|      0|   } else if(length == 24) {
  ------------------
  |  Branch (334:14): [True: 0, False: 0]
  ------------------
  335|      0|      m_state[12] = load_le<uint32_t>(iv, 0);
  336|      0|      m_state[13] = load_le<uint32_t>(iv, 1);
  337|      0|      m_state[14] = load_le<uint32_t>(iv, 2);
  338|      0|      m_state[15] = load_le<uint32_t>(iv, 3);
  339|       |
  340|      0|      secure_vector<uint32_t> hc(8);
  341|      0|      hchacha(hc.data(), m_state.data(), m_rounds);
  342|       |
  343|      0|      m_state[4] = hc[0];
  344|      0|      m_state[5] = hc[1];
  345|      0|      m_state[6] = hc[2];
  346|      0|      m_state[7] = hc[3];
  347|      0|      m_state[8] = hc[4];
  348|      0|      m_state[9] = hc[5];
  349|      0|      m_state[10] = hc[6];
  350|      0|      m_state[11] = hc[7];
  351|      0|      m_state[12] = 0;
  352|      0|      m_state[13] = 0;
  353|      0|      m_state[14] = load_le<uint32_t>(iv, 4);
  354|      0|      m_state[15] = load_le<uint32_t>(iv, 5);
  355|      0|   }
  356|       |
  357|      2|   chacha(m_buffer.data(), m_buffer.size() / 64, m_state.data(), m_rounds);
  358|      2|   m_position = 0;
  359|      2|}

_ZN5Botan6ChaCha14chacha_avx2_x8EPhPjm:
   15|    158|void ChaCha::chacha_avx2_x8(uint8_t output[64 * 8], uint32_t state[16], size_t rounds) {
   16|    158|   SIMD_8x32::reset_registers();
   17|       |
   18|    158|   BOTAN_ASSERT(rounds % 2 == 0, "Valid rounds");
  ------------------
  |  |   51|    158|   do {                                                                                 \
  |  |   52|    158|      if(!(expr))                                                                       \
  |  |  ------------------
  |  |  |  Branch (52:10): [True: 0, False: 158]
  |  |  ------------------
  |  |   53|    158|         Botan::assertion_failure(#expr, assertion_made, __func__, __FILE__, __LINE__); \
  |  |   54|    158|   } while(0)
  |  |  ------------------
  |  |  |  Branch (54:12): [Folded - Ignored]
  |  |  ------------------
  ------------------
   19|    158|   const SIMD_8x32 CTR0 = SIMD_8x32(0, 1, 2, 3, 4, 5, 6, 7);
   20|       |
   21|    158|   const uint32_t C = 0xFFFFFFFF - state[12];
   22|    158|   const SIMD_8x32 CTR1 = SIMD_8x32(0, C < 1, C < 2, C < 3, C < 4, C < 5, C < 6, C < 7);
   23|       |
   24|    158|   SIMD_8x32 R00 = SIMD_8x32::splat(state[0]);
   25|    158|   SIMD_8x32 R01 = SIMD_8x32::splat(state[1]);
   26|    158|   SIMD_8x32 R02 = SIMD_8x32::splat(state[2]);
   27|    158|   SIMD_8x32 R03 = SIMD_8x32::splat(state[3]);
   28|    158|   SIMD_8x32 R04 = SIMD_8x32::splat(state[4]);
   29|    158|   SIMD_8x32 R05 = SIMD_8x32::splat(state[5]);
   30|    158|   SIMD_8x32 R06 = SIMD_8x32::splat(state[6]);
   31|    158|   SIMD_8x32 R07 = SIMD_8x32::splat(state[7]);
   32|    158|   SIMD_8x32 R08 = SIMD_8x32::splat(state[8]);
   33|    158|   SIMD_8x32 R09 = SIMD_8x32::splat(state[9]);
   34|    158|   SIMD_8x32 R10 = SIMD_8x32::splat(state[10]);
   35|    158|   SIMD_8x32 R11 = SIMD_8x32::splat(state[11]);
   36|    158|   SIMD_8x32 R12 = SIMD_8x32::splat(state[12]) + CTR0;
   37|    158|   SIMD_8x32 R13 = SIMD_8x32::splat(state[13]) + CTR1;
   38|    158|   SIMD_8x32 R14 = SIMD_8x32::splat(state[14]);
   39|    158|   SIMD_8x32 R15 = SIMD_8x32::splat(state[15]);
   40|       |
   41|  1.73k|   for(size_t r = 0; r != rounds / 2; ++r) {
  ------------------
  |  Branch (41:22): [True: 1.58k, False: 158]
  ------------------
   42|  1.58k|      R00 += R04;
   43|  1.58k|      R01 += R05;
   44|  1.58k|      R02 += R06;
   45|  1.58k|      R03 += R07;
   46|       |
   47|  1.58k|      R12 ^= R00;
   48|  1.58k|      R13 ^= R01;
   49|  1.58k|      R14 ^= R02;
   50|  1.58k|      R15 ^= R03;
   51|       |
   52|  1.58k|      R12 = R12.rotl<16>();
   53|  1.58k|      R13 = R13.rotl<16>();
   54|  1.58k|      R14 = R14.rotl<16>();
   55|  1.58k|      R15 = R15.rotl<16>();
   56|       |
   57|  1.58k|      R08 += R12;
   58|  1.58k|      R09 += R13;
   59|  1.58k|      R10 += R14;
   60|  1.58k|      R11 += R15;
   61|       |
   62|  1.58k|      R04 ^= R08;
   63|  1.58k|      R05 ^= R09;
   64|  1.58k|      R06 ^= R10;
   65|  1.58k|      R07 ^= R11;
   66|       |
   67|  1.58k|      R04 = R04.rotl<12>();
   68|  1.58k|      R05 = R05.rotl<12>();
   69|  1.58k|      R06 = R06.rotl<12>();
   70|  1.58k|      R07 = R07.rotl<12>();
   71|       |
   72|  1.58k|      R00 += R04;
   73|  1.58k|      R01 += R05;
   74|  1.58k|      R02 += R06;
   75|  1.58k|      R03 += R07;
   76|       |
   77|  1.58k|      R12 ^= R00;
   78|  1.58k|      R13 ^= R01;
   79|  1.58k|      R14 ^= R02;
   80|  1.58k|      R15 ^= R03;
   81|       |
   82|  1.58k|      R12 = R12.rotl<8>();
   83|  1.58k|      R13 = R13.rotl<8>();
   84|  1.58k|      R14 = R14.rotl<8>();
   85|  1.58k|      R15 = R15.rotl<8>();
   86|       |
   87|  1.58k|      R08 += R12;
   88|  1.58k|      R09 += R13;
   89|  1.58k|      R10 += R14;
   90|  1.58k|      R11 += R15;
   91|       |
   92|  1.58k|      R04 ^= R08;
   93|  1.58k|      R05 ^= R09;
   94|  1.58k|      R06 ^= R10;
   95|  1.58k|      R07 ^= R11;
   96|       |
   97|  1.58k|      R04 = R04.rotl<7>();
   98|  1.58k|      R05 = R05.rotl<7>();
   99|  1.58k|      R06 = R06.rotl<7>();
  100|  1.58k|      R07 = R07.rotl<7>();
  101|       |
  102|  1.58k|      R00 += R05;
  103|  1.58k|      R01 += R06;
  104|  1.58k|      R02 += R07;
  105|  1.58k|      R03 += R04;
  106|       |
  107|  1.58k|      R15 ^= R00;
  108|  1.58k|      R12 ^= R01;
  109|  1.58k|      R13 ^= R02;
  110|  1.58k|      R14 ^= R03;
  111|       |
  112|  1.58k|      R15 = R15.rotl<16>();
  113|  1.58k|      R12 = R12.rotl<16>();
  114|  1.58k|      R13 = R13.rotl<16>();
  115|  1.58k|      R14 = R14.rotl<16>();
  116|       |
  117|  1.58k|      R10 += R15;
  118|  1.58k|      R11 += R12;
  119|  1.58k|      R08 += R13;
  120|  1.58k|      R09 += R14;
  121|       |
  122|  1.58k|      R05 ^= R10;
  123|  1.58k|      R06 ^= R11;
  124|  1.58k|      R07 ^= R08;
  125|  1.58k|      R04 ^= R09;
  126|       |
  127|  1.58k|      R05 = R05.rotl<12>();
  128|  1.58k|      R06 = R06.rotl<12>();
  129|  1.58k|      R07 = R07.rotl<12>();
  130|  1.58k|      R04 = R04.rotl<12>();
  131|       |
  132|  1.58k|      R00 += R05;
  133|  1.58k|      R01 += R06;
  134|  1.58k|      R02 += R07;
  135|  1.58k|      R03 += R04;
  136|       |
  137|  1.58k|      R15 ^= R00;
  138|  1.58k|      R12 ^= R01;
  139|  1.58k|      R13 ^= R02;
  140|  1.58k|      R14 ^= R03;
  141|       |
  142|  1.58k|      R15 = R15.rotl<8>();
  143|  1.58k|      R12 = R12.rotl<8>();
  144|  1.58k|      R13 = R13.rotl<8>();
  145|  1.58k|      R14 = R14.rotl<8>();
  146|       |
  147|  1.58k|      R10 += R15;
  148|  1.58k|      R11 += R12;
  149|  1.58k|      R08 += R13;
  150|  1.58k|      R09 += R14;
  151|       |
  152|  1.58k|      R05 ^= R10;
  153|  1.58k|      R06 ^= R11;
  154|  1.58k|      R07 ^= R08;
  155|  1.58k|      R04 ^= R09;
  156|       |
  157|  1.58k|      R05 = R05.rotl<7>();
  158|  1.58k|      R06 = R06.rotl<7>();
  159|  1.58k|      R07 = R07.rotl<7>();
  160|  1.58k|      R04 = R04.rotl<7>();
  161|  1.58k|   }
  162|       |
  163|    158|   R00 += SIMD_8x32::splat(state[0]);
  164|    158|   R01 += SIMD_8x32::splat(state[1]);
  165|    158|   R02 += SIMD_8x32::splat(state[2]);
  166|    158|   R03 += SIMD_8x32::splat(state[3]);
  167|    158|   R04 += SIMD_8x32::splat(state[4]);
  168|    158|   R05 += SIMD_8x32::splat(state[5]);
  169|    158|   R06 += SIMD_8x32::splat(state[6]);
  170|    158|   R07 += SIMD_8x32::splat(state[7]);
  171|    158|   R08 += SIMD_8x32::splat(state[8]);
  172|    158|   R09 += SIMD_8x32::splat(state[9]);
  173|    158|   R10 += SIMD_8x32::splat(state[10]);
  174|    158|   R11 += SIMD_8x32::splat(state[11]);
  175|    158|   R12 += SIMD_8x32::splat(state[12]) + CTR0;
  176|    158|   R13 += SIMD_8x32::splat(state[13]) + CTR1;
  177|    158|   R14 += SIMD_8x32::splat(state[14]);
  178|    158|   R15 += SIMD_8x32::splat(state[15]);
  179|       |
  180|    158|   SIMD_8x32::transpose(R00, R01, R02, R03, R04, R05, R06, R07);
  181|    158|   SIMD_8x32::transpose(R08, R09, R10, R11, R12, R13, R14, R15);
  182|       |
  183|    158|   R00.store_le(output);
  184|    158|   R08.store_le(output + 32 * 1);
  185|    158|   R01.store_le(output + 32 * 2);
  186|    158|   R09.store_le(output + 32 * 3);
  187|    158|   R02.store_le(output + 32 * 4);
  188|    158|   R10.store_le(output + 32 * 5);
  189|    158|   R03.store_le(output + 32 * 6);
  190|    158|   R11.store_le(output + 32 * 7);
  191|    158|   R04.store_le(output + 32 * 8);
  192|    158|   R12.store_le(output + 32 * 9);
  193|    158|   R05.store_le(output + 32 * 10);
  194|    158|   R13.store_le(output + 32 * 11);
  195|    158|   R06.store_le(output + 32 * 12);
  196|    158|   R14.store_le(output + 32 * 13);
  197|    158|   R07.store_le(output + 32 * 14);
  198|    158|   R15.store_le(output + 32 * 15);
  199|       |
  200|    158|   SIMD_8x32::zero_registers();
  201|       |
  202|    158|   state[12] += 8;
  203|    158|   if(state[12] < 8) {
  ------------------
  |  Branch (203:7): [True: 0, False: 158]
  ------------------
  204|      0|      state[13]++;
  205|      0|   }
  206|    158|}

_ZN5Botan12StreamCipher6createENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEES5_:
   39|      1|std::unique_ptr<StreamCipher> StreamCipher::create(std::string_view algo_spec, std::string_view provider) {
   40|      1|#if defined(BOTAN_HAS_SHAKE_CIPHER)
   41|      1|   if(algo_spec == "SHAKE-128" || algo_spec == "SHAKE-128-XOF") {
  ------------------
  |  Branch (41:7): [True: 0, False: 1]
  |  Branch (41:35): [True: 0, False: 1]
  ------------------
   42|      0|      if(provider.empty() || provider == "base") {
  ------------------
  |  Branch (42:10): [True: 0, False: 0]
  |  Branch (42:30): [True: 0, False: 0]
  ------------------
   43|      0|         return std::make_unique<SHAKE_128_Cipher>();
   44|      0|      }
   45|      0|   }
   46|       |
   47|      1|   if(algo_spec == "SHAKE-256" || algo_spec == "SHAKE-256-XOF") {
  ------------------
  |  Branch (47:7): [True: 0, False: 1]
  |  Branch (47:35): [True: 0, False: 1]
  ------------------
   48|      0|      if(provider.empty() || provider == "base") {
  ------------------
  |  Branch (48:10): [True: 0, False: 0]
  |  Branch (48:30): [True: 0, False: 0]
  ------------------
   49|      0|         return std::make_unique<SHAKE_256_Cipher>();
   50|      0|      }
   51|      0|   }
   52|      1|#endif
   53|       |
   54|      1|#if defined(BOTAN_HAS_CHACHA)
   55|      1|   if(algo_spec == "ChaCha20") {
  ------------------
  |  Branch (55:7): [True: 0, False: 1]
  ------------------
   56|      0|      if(provider.empty() || provider == "base") {
  ------------------
  |  Branch (56:10): [True: 0, False: 0]
  |  Branch (56:30): [True: 0, False: 0]
  ------------------
   57|      0|         return std::make_unique<ChaCha>(20);
   58|      0|      }
   59|      0|   }
   60|      1|#endif
   61|       |
   62|      1|#if defined(BOTAN_HAS_SALSA20)
   63|      1|   if(algo_spec == "Salsa20") {
  ------------------
  |  Branch (63:7): [True: 0, False: 1]
  ------------------
   64|      0|      if(provider.empty() || provider == "base") {
  ------------------
  |  Branch (64:10): [True: 0, False: 0]
  |  Branch (64:30): [True: 0, False: 0]
  ------------------
   65|      0|         return std::make_unique<Salsa20>();
   66|      0|      }
   67|      0|   }
   68|      1|#endif
   69|       |
   70|      1|   const SCAN_Name req(algo_spec);
   71|       |
   72|      1|#if defined(BOTAN_HAS_CTR_BE)
   73|      1|   if((req.algo_name() == "CTR-BE" || req.algo_name() == "CTR") && req.arg_count_between(1, 2)) {
  ------------------
  |  Branch (73:7): [True: 0, False: 1]
  |  Branch (73:8): [True: 0, False: 1]
  |  Branch (73:39): [True: 0, False: 1]
  |  Branch (73:68): [True: 0, False: 0]
  ------------------
   74|      0|      if(provider.empty() || provider == "base") {
  ------------------
  |  Branch (74:10): [True: 0, False: 0]
  |  Branch (74:30): [True: 0, False: 0]
  ------------------
   75|      0|         auto cipher = BlockCipher::create(req.arg(0));
   76|      0|         if(cipher) {
  ------------------
  |  Branch (76:13): [True: 0, False: 0]
  ------------------
   77|      0|            size_t ctr_size = req.arg_as_integer(1, cipher->block_size());
   78|      0|            return std::make_unique<CTR_BE>(std::move(cipher), ctr_size);
   79|      0|         }
   80|      0|      }
   81|      0|   }
   82|      1|#endif
   83|       |
   84|      1|#if defined(BOTAN_HAS_CHACHA)
   85|      1|   if(req.algo_name() == "ChaCha") {
  ------------------
  |  Branch (85:7): [True: 1, False: 0]
  ------------------
   86|      1|      if(provider.empty() || provider == "base") {
  ------------------
  |  Branch (86:10): [True: 1, False: 0]
  |  Branch (86:30): [True: 0, False: 0]
  ------------------
   87|      1|         return std::make_unique<ChaCha>(req.arg_as_integer(0, 20));
   88|      1|      }
   89|      1|   }
   90|      0|#endif
   91|       |
   92|      0|#if defined(BOTAN_HAS_OFB)
   93|      0|   if(req.algo_name() == "OFB" && req.arg_count() == 1) {
  ------------------
  |  Branch (93:7): [True: 0, False: 0]
  |  Branch (93:7): [True: 0, False: 0]
  |  Branch (93:35): [True: 0, False: 0]
  ------------------
   94|      0|      if(provider.empty() || provider == "base") {
  ------------------
  |  Branch (94:10): [True: 0, False: 0]
  |  Branch (94:30): [True: 0, False: 0]
  ------------------
   95|      0|         if(auto cipher = BlockCipher::create(req.arg(0))) {
  ------------------
  |  Branch (95:18): [True: 0, False: 0]
  ------------------
   96|      0|            return std::make_unique<OFB>(std::move(cipher));
   97|      0|         }
   98|      0|      }
   99|      0|   }
  100|      0|#endif
  101|       |
  102|      0|#if defined(BOTAN_HAS_RC4)
  103|       |
  104|      0|   if(req.algo_name() == "RC4" || req.algo_name() == "ARC4" || req.algo_name() == "MARK-4") {
  ------------------
  |  Branch (104:7): [True: 0, False: 0]
  |  Branch (104:7): [True: 0, False: 0]
  |  Branch (104:35): [True: 0, False: 0]
  |  Branch (104:64): [True: 0, False: 0]
  ------------------
  105|      0|      const size_t skip = (req.algo_name() == "MARK-4") ? 256 : req.arg_as_integer(0, 0);
  ------------------
  |  Branch (105:27): [True: 0, False: 0]
  ------------------
  106|       |
  107|      0|      if(provider.empty() || provider == "base") {
  ------------------
  |  Branch (107:10): [True: 0, False: 0]
  |  Branch (107:30): [True: 0, False: 0]
  ------------------
  108|      0|         return std::make_unique<RC4>(skip);
  109|      0|      }
  110|      0|   }
  111|       |
  112|      0|#endif
  113|       |
  114|      0|   BOTAN_UNUSED(req);
  ------------------
  |  |  118|      0|#define BOTAN_UNUSED Botan::ignore_params
  ------------------
  115|      0|   BOTAN_UNUSED(provider);
  ------------------
  |  |  118|      0|#define BOTAN_UNUSED Botan::ignore_params
  ------------------
  116|       |
  117|      0|   return nullptr;
  118|      0|}
_ZN5Botan12StreamCipher15create_or_throwENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEES5_:
  121|      1|std::unique_ptr<StreamCipher> StreamCipher::create_or_throw(std::string_view algo, std::string_view provider) {
  122|      1|   if(auto sc = StreamCipher::create(algo, provider)) {
  ------------------
  |  Branch (122:12): [True: 1, False: 0]
  ------------------
  123|      1|      return sc;
  124|      1|   }
  125|      0|   throw Lookup_Error("Stream cipher", algo, provider);
  126|      1|}

_ZN5Botan3TLS17make_hello_randomERNS_21RandomNumberGeneratorERNS0_9CallbacksERKNS0_6PolicyE:
   41|  2.50k|std::vector<uint8_t> make_hello_random(RandomNumberGenerator& rng, Callbacks& cb, const Policy& policy) {
   42|  2.50k|   auto buf = rng.random_vec<std::vector<uint8_t>>(32);
   43|       |
   44|  2.50k|   if(policy.hash_hello_random()) {
  ------------------
  |  Branch (44:7): [True: 2.50k, False: 0]
  ------------------
   45|  2.50k|      auto sha256 = HashFunction::create_or_throw("SHA-256");
   46|  2.50k|      sha256->update(buf);
   47|  2.50k|      sha256->final(buf);
   48|  2.50k|   }
   49|       |
   50|       |   // TLS 1.3 does not require the insertion of a timestamp in the client hello
   51|       |   // random. When offering both TLS 1.2 and 1.3 we nevertheless comply with the
   52|       |   // legacy specification.
   53|  2.50k|   if(policy.include_time_in_hello_random() && (policy.allow_tls12() || policy.allow_dtls12())) {
  ------------------
  |  Branch (53:7): [True: 2.50k, False: 0]
  |  Branch (53:49): [True: 2.50k, False: 0]
  |  Branch (53:73): [True: 0, False: 0]
  ------------------
   54|  2.50k|      const uint32_t time32 = static_cast<uint32_t>(std::chrono::system_clock::to_time_t(cb.tls_current_timestamp()));
   55|       |
   56|  2.50k|      store_be(time32, buf.data());
   57|  2.50k|   }
   58|       |
   59|  2.50k|   return buf;
   60|  2.50k|}
_ZN5Botan3TLS12Client_HelloD2Ev:
  171|  2.50k|Client_Hello::~Client_Hello() = default;
_ZN5Botan3TLS12Client_HelloC2Ev:
  173|  2.50k|Client_Hello::Client_Hello() : m_data(std::make_unique<Client_Hello_Internal>()) {}
_ZNK5Botan3TLS12Client_Hello4typeEv:
  182|  7.50k|Handshake_Type Client_Hello::type() const { return Handshake_Type::ClientHello; }
_ZNK5Botan3TLS12Client_Hello9serializeEv:
  207|  2.50k|std::vector<uint8_t> Client_Hello::serialize() const {
  208|  2.50k|   std::vector<uint8_t> buf;
  209|  2.50k|   buf.reserve(1024);  // working around GCC warning
  210|       |
  211|  2.50k|   buf.push_back(m_data->legacy_version().major_version());
  212|  2.50k|   buf.push_back(m_data->legacy_version().minor_version());
  213|  2.50k|   buf += m_data->random();
  214|       |
  215|  2.50k|   append_tls_length_value(buf, m_data->session_id().get(), 1);
  216|       |
  217|  2.50k|   if(m_data->legacy_version().is_datagram_protocol()) {
  ------------------
  |  Branch (217:7): [True: 0, False: 2.50k]
  ------------------
  218|      0|      append_tls_length_value(buf, m_data->hello_cookie(), 1);
  219|      0|   }
  220|       |
  221|  2.50k|   append_tls_length_value(buf, m_data->ciphersuites(), 2);
  222|  2.50k|   append_tls_length_value(buf, m_data->comp_methods(), 1);
  223|       |
  224|       |   /*
  225|       |   * May not want to send extensions at all in some cases. If so,
  226|       |   * should include SCSV value (if reneg info is empty, if not we are
  227|       |   * renegotiating with a modern server)
  228|       |   */
  229|       |
  230|  2.50k|   buf += m_data->extensions().serialize(Connection_Side::Client);
  231|       |
  232|  2.50k|   return buf;
  233|  2.50k|}
_ZNK5Botan3TLS12Client_Hello13offered_suiteEt:
  244|     33|bool Client_Hello::offered_suite(uint16_t ciphersuite) const {
  245|     33|   return std::find(m_data->ciphersuites().cbegin(), m_data->ciphersuites().cend(), ciphersuite) !=
  246|     33|          m_data->ciphersuites().cend();
  247|     33|}
_ZNK5Botan3TLS15Client_Hello_1220secure_renegotiationEv:
  296|  2.50k|bool Client_Hello_12::secure_renegotiation() const { return m_data->extensions().has<Renegotiation_Extension>(); }
_ZNK5Botan3TLS15Client_Hello_1218renegotiation_infoEv:
  298|  2.50k|std::vector<uint8_t> Client_Hello_12::renegotiation_info() const {
  299|  2.50k|   if(Renegotiation_Extension* reneg = m_data->extensions().get<Renegotiation_Extension>()) {
  ------------------
  |  Branch (299:32): [True: 2.50k, False: 0]
  ------------------
  300|  2.50k|      return reneg->renegotiation_info();
  301|  2.50k|   }
  302|      0|   return {};
  303|  2.50k|}
_ZN5Botan3TLS15Client_Hello_12C2ERNS0_12Handshake_IOERNS0_14Handshake_HashERKNS0_6PolicyERNS0_9CallbacksERNS_21RandomNumberGeneratorERKNSt3__16vectorIhNSD_9allocatorIhEEEERKNS1_8SettingsERKNSE_INSD_12basic_stringIcNSD_11char_traitsIcEENSF_IcEEEENSF_ISR_EEEE:
  412|  2.50k|                                 const std::vector<std::string>& next_protocols) {
  413|  2.50k|   m_data->m_legacy_version = client_settings.protocol_version();
  414|  2.50k|   m_data->m_random = make_hello_random(rng, cb, policy);
  415|  2.50k|   m_data->m_suites = policy.ciphersuite_list(client_settings.protocol_version());
  416|       |
  417|  2.50k|   if(!policy.acceptable_protocol_version(m_data->legacy_version())) {
  ------------------
  |  Branch (417:7): [True: 0, False: 2.50k]
  ------------------
  418|      0|      throw Internal_Error("Offering " + m_data->legacy_version().to_string() +
  419|      0|                           " but our own policy does not accept it");
  420|      0|   }
  421|       |
  422|       |   /*
  423|       |   * Place all empty extensions in front to avoid a bug in some systems
  424|       |   * which reject hellos when the last extension in the list is empty.
  425|       |   */
  426|       |
  427|       |   // EMS must always be used with TLS 1.2, regardless of the policy used.
  428|  2.50k|   m_data->extensions().add(new Extended_Master_Secret);
  429|       |
  430|  2.50k|   if(policy.negotiate_encrypt_then_mac()) {
  ------------------
  |  Branch (430:7): [True: 2.50k, False: 0]
  ------------------
  431|  2.50k|      m_data->extensions().add(new Encrypt_then_MAC);
  432|  2.50k|   }
  433|       |
  434|  2.50k|   m_data->extensions().add(new Session_Ticket_Extension());
  435|       |
  436|  2.50k|   m_data->extensions().add(new Renegotiation_Extension(reneg_info));
  437|       |
  438|  2.50k|   m_data->extensions().add(new Supported_Versions(m_data->legacy_version(), policy));
  439|       |
  440|  2.50k|   if(!client_settings.hostname().empty()) {
  ------------------
  |  Branch (440:7): [True: 2.50k, False: 0]
  ------------------
  441|  2.50k|      m_data->extensions().add(new Server_Name_Indicator(client_settings.hostname()));
  442|  2.50k|   }
  443|       |
  444|  2.50k|   if(policy.support_cert_status_message()) {
  ------------------
  |  Branch (444:7): [True: 2.50k, False: 0]
  ------------------
  445|  2.50k|      m_data->extensions().add(new Certificate_Status_Request({}, {}));
  446|  2.50k|   }
  447|       |
  448|  2.50k|   auto supported_groups = std::make_unique<Supported_Groups>(policy.key_exchange_groups());
  449|  2.50k|   if(!supported_groups->ec_groups().empty()) {
  ------------------
  |  Branch (449:7): [True: 2.50k, False: 0]
  ------------------
  450|  2.50k|      m_data->extensions().add(new Supported_Point_Formats(policy.use_ecc_point_compression()));
  451|  2.50k|   }
  452|  2.50k|   m_data->extensions().add(supported_groups.release());
  453|       |
  454|  2.50k|   m_data->extensions().add(new Signature_Algorithms(policy.acceptable_signature_schemes()));
  455|  2.50k|   if(auto cert_signing_prefs = policy.acceptable_certificate_signature_schemes()) {
  ------------------
  |  Branch (455:12): [True: 0, False: 2.50k]
  ------------------
  456|       |      // RFC 8446 4.2.3
  457|       |      //    TLS 1.2 implementations SHOULD also process this extension.
  458|       |      //    Implementations which have the same policy in both cases MAY omit
  459|       |      //    the "signature_algorithms_cert" extension.
  460|      0|      m_data->extensions().add(new Signature_Algorithms_Cert(std::move(cert_signing_prefs.value())));
  461|      0|   }
  462|       |
  463|  2.50k|   if(reneg_info.empty() && !next_protocols.empty()) {
  ------------------
  |  Branch (463:7): [True: 2.50k, False: 0]
  |  Branch (463:29): [True: 0, False: 2.50k]
  ------------------
  464|      0|      m_data->extensions().add(new Application_Layer_Protocol_Notification(next_protocols));
  465|      0|   }
  466|       |
  467|  2.50k|   if(m_data->legacy_version().is_datagram_protocol()) {
  ------------------
  |  Branch (467:7): [True: 0, False: 2.50k]
  ------------------
  468|      0|      m_data->extensions().add(new SRTP_Protection_Profiles(policy.srtp_profiles()));
  469|      0|   }
  470|       |
  471|  2.50k|   cb.tls_modify_extensions(m_data->extensions(), Connection_Side::Client, type());
  472|       |
  473|  2.50k|   hash.update(io.send(*this));
  474|  2.50k|}
_ZNK5Botan3TLS21Client_Hello_Internal14legacy_versionEv:
  138|  15.0k|      Protocol_Version legacy_version() const { return m_legacy_version; }
_ZNK5Botan3TLS21Client_Hello_Internal6randomEv:
  142|  2.50k|      const std::vector<uint8_t>& random() const { return m_random; }
_ZNK5Botan3TLS21Client_Hello_Internal10session_idEv:
  140|  2.50k|      const Session_ID& session_id() const { return m_session_id; }
_ZNK5Botan3TLS21Client_Hello_Internal12comp_methodsEv:
  146|  2.50k|      const std::vector<uint8_t>& comp_methods() const { return m_comp_methods; }
_ZNK5Botan3TLS21Client_Hello_Internal12ciphersuitesEv:
  144|  2.59k|      const std::vector<uint16_t>& ciphersuites() const { return m_suites; }
_ZN5Botan3TLS21Client_Hello_Internal10extensionsEv:
  154|  35.0k|      Extensions& extensions() { return m_extensions; }
_ZN5Botan3TLS21Client_Hello_InternalC2Ev:
   69|  2.50k|      Client_Hello_Internal() : m_comp_methods({0}) {}

_ZN5Botan3TLS12Server_HelloC2ENSt3__110unique_ptrINS0_21Server_Hello_InternalENS2_14default_deleteIS4_EEEE:
  167|    267|Server_Hello::Server_Hello(std::unique_ptr<Server_Hello_Internal> data) : m_data(std::move(data)) {}
_ZN5Botan3TLS12Server_HelloD2Ev:
  172|    267|Server_Hello::~Server_Hello() = default;
_ZNK5Botan3TLS12Server_Hello14legacy_versionEv:
  199|    129|Protocol_Version Server_Hello::legacy_version() const { return m_data->legacy_version(); }
_ZNK5Botan3TLS12Server_Hello11ciphersuiteEv:
  207|    162|uint16_t Server_Hello::ciphersuite() const { return m_data->ciphersuite(); }
_ZN5Botan3TLS15Server_Hello_12C2ERKNSt3__16vectorIhNS2_9allocatorIhEEEE:
  336|  1.95k|      Server_Hello_12(std::make_unique<Server_Hello_Internal>(buf)) {}
_ZN5Botan3TLS15Server_Hello_12C2ENSt3__110unique_ptrINS0_21Server_Hello_InternalENS2_14default_deleteIS4_EEEE:
  338|    267|Server_Hello_12::Server_Hello_12(std::unique_ptr<Server_Hello_Internal> data) : Server_Hello(std::move(data)) {
  339|    267|   if(!m_data->version().is_pre_tls_13()) {
  ------------------
  |  Branch (339:7): [True: 138, False: 129]
  ------------------
  340|    138|      throw TLS_Exception(Alert::ProtocolVersion, "Expected server hello of (D)TLS 1.2 or lower");
  341|    138|   }
  342|    267|}
_ZNK5Botan3TLS21Server_Hello_Internal14legacy_versionEv:
  140|    129|      Protocol_Version legacy_version() const { return m_legacy_version; }
_ZNK5Botan3TLS21Server_Hello_Internal11ciphersuiteEv:
  146|    162|      uint16_t ciphersuite() const { return m_ciphersuite; }
_ZNK5Botan3TLS21Server_Hello_Internal7versionEv:
  127|    267|      Protocol_Version version() const {
  128|       |         // RFC 8446 4.2.1
  129|       |         //    A server which negotiates a version of TLS prior to TLS 1.3 MUST set
  130|       |         //    ServerHello.version and MUST NOT send the "supported_versions"
  131|       |         //    extension.  A server which negotiates TLS 1.3 MUST respond by sending
  132|       |         //    a "supported_versions" extension containing the selected version
  133|       |         //    value (0x0304).
  134|       |         //
  135|       |         // Note: Here we just take a message parsing decision, further validation of
  136|       |         //       the extension's contents is done later.
  137|    267|         return (extensions().has<Supported_Versions>()) ? Protocol_Version::TLS_V13 : m_legacy_version;
  ------------------
  |  Branch (137:17): [True: 2, False: 265]
  ------------------
  138|    267|      }
_ZNK5Botan3TLS21Server_Hello_Internal10extensionsEv:
  152|    267|      const Extensions& extensions() const { return m_extensions; }
_ZN5Botan3TLS21Server_Hello_InternalC2ERKNSt3__16vectorIhNS2_9allocatorIhEEEE:
   80|  1.95k|      Server_Hello_Internal(const std::vector<uint8_t>& buf) {
   81|  1.95k|         if(buf.size() < 38) {
  ------------------
  |  Branch (81:13): [True: 24, False: 1.93k]
  ------------------
   82|     24|            throw Decoding_Error("Server_Hello: Packet corrupted");
   83|     24|         }
   84|       |
   85|  1.93k|         TLS_Data_Reader reader("ServerHello", buf);
   86|       |
   87|  1.93k|         const uint8_t major_version = reader.get_byte();
   88|  1.93k|         const uint8_t minor_version = reader.get_byte();
   89|       |
   90|  1.93k|         m_legacy_version = Protocol_Version(major_version, minor_version);
   91|       |
   92|       |         // RFC 8446 4.1.3
   93|       |         //    Upon receiving a message with type server_hello, implementations MUST
   94|       |         //    first examine the Random value and, if it matches this value, process
   95|       |         //    it as described in Section 4.1.4 [Hello Retry Request]).
   96|  1.93k|         m_random = reader.get_fixed<uint8_t>(32);
   97|  1.93k|         m_is_hello_retry_request = random_signals_hello_retry_request(m_random);
   98|       |
   99|  1.93k|         m_session_id = Session_ID(reader.get_range<uint8_t>(1, 0, 32));
  100|  1.93k|         m_ciphersuite = reader.get_uint16_t();
  101|  1.93k|         m_comp_method = reader.get_byte();
  102|       |
  103|       |         // Note that this code path might parse a TLS 1.2 (or older) server hello message that
  104|       |         // is nevertheless marked as being a 'hello retry request' (potentially maliciously).
  105|       |         // Extension parsing will however not be affected by the associated flag.
  106|       |         // Only after parsing the extensions will the upstream code be able to decide
  107|       |         // whether we're dealing with TLS 1.3 or older.
  108|  1.93k|         m_extensions.deserialize(
  109|  1.93k|            reader,
  110|  1.93k|            Connection_Side::Server,
  111|  1.93k|            m_is_hello_retry_request ? Handshake_Type::HelloRetryRequest : Handshake_Type::ServerHello);
  ------------------
  |  Branch (111:13): [True: 7, False: 1.92k]
  ------------------
  112|  1.93k|      }
msg_server_hello.cpp:_ZN5Botan3TLS12_GLOBAL__N_134random_signals_hello_retry_requestERKNSt3__16vectorIhNS2_9allocatorIhEEEE:
   39|  1.93k|bool random_signals_hello_retry_request(const std::vector<uint8_t>& random) {
   40|  1.93k|   return constant_time_compare(random.data(), HELLO_RETRY_REQUEST_MARKER.data(), HELLO_RETRY_REQUEST_MARKER.size());
   41|  1.93k|}

_ZN5Botan3TLS15Channel_Impl_12C2ERKNSt3__110shared_ptrINS0_9CallbacksEEERKNS3_INS0_15Session_ManagerEEERKNS3_INS_21RandomNumberGeneratorEEERKNS3_IKNS0_6PolicyEEEbbm:
   36|  2.50k|      m_has_been_closed(false) {
   37|  2.50k|   BOTAN_ASSERT_NONNULL(m_callbacks);
  ------------------
  |  |   87|  2.50k|   do {                                                                                   \
  |  |   88|  2.50k|      if((ptr) == nullptr)                                                                \
  |  |  ------------------
  |  |  |  Branch (88:10): [True: 0, False: 2.50k]
  |  |  ------------------
  |  |   89|  2.50k|         Botan::assertion_failure(#ptr " is not null", "", __func__, __FILE__, __LINE__); \
  |  |   90|  2.50k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (90:12): [Folded - Ignored]
  |  |  ------------------
  ------------------
   38|  2.50k|   BOTAN_ASSERT_NONNULL(m_session_manager);
  ------------------
  |  |   87|  2.50k|   do {                                                                                   \
  |  |   88|  2.50k|      if((ptr) == nullptr)                                                                \
  |  |  ------------------
  |  |  |  Branch (88:10): [True: 0, False: 2.50k]
  |  |  ------------------
  |  |   89|  2.50k|         Botan::assertion_failure(#ptr " is not null", "", __func__, __FILE__, __LINE__); \
  |  |   90|  2.50k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (90:12): [Folded - Ignored]
  |  |  ------------------
  ------------------
   39|  2.50k|   BOTAN_ASSERT_NONNULL(m_rng);
  ------------------
  |  |   87|  2.50k|   do {                                                                                   \
  |  |   88|  2.50k|      if((ptr) == nullptr)                                                                \
  |  |  ------------------
  |  |  |  Branch (88:10): [True: 0, False: 2.50k]
  |  |  ------------------
  |  |   89|  2.50k|         Botan::assertion_failure(#ptr " is not null", "", __func__, __FILE__, __LINE__); \
  |  |   90|  2.50k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (90:12): [Folded - Ignored]
  |  |  ------------------
  ------------------
   40|  2.50k|   BOTAN_ASSERT_NONNULL(m_policy);
  ------------------
  |  |   87|  2.50k|   do {                                                                                   \
  |  |   88|  2.50k|      if((ptr) == nullptr)                                                                \
  |  |  ------------------
  |  |  |  Branch (88:10): [True: 0, False: 2.50k]
  |  |  ------------------
  |  |   89|  2.50k|         Botan::assertion_failure(#ptr " is not null", "", __func__, __FILE__, __LINE__); \
  |  |   90|  2.50k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (90:12): [Folded - Ignored]
  |  |  ------------------
  ------------------
   41|       |
   42|       |   /* epoch 0 is plaintext, thus null cipher state */
   43|  2.50k|   m_write_cipher_states[0] = nullptr;
   44|  2.50k|   m_read_cipher_states[0] = nullptr;
   45|       |
   46|  2.50k|   m_writebuf.reserve(reserved_io_buffer_size);
   47|  2.50k|   m_readbuf.reserve(reserved_io_buffer_size);
   48|  2.50k|}
_ZN5Botan3TLS15Channel_Impl_1211reset_stateEv:
   50|  2.20k|void Channel_Impl_12::reset_state() {
   51|  2.20k|   m_active_state.reset();
   52|  2.20k|   m_pending_state.reset();
   53|  2.20k|   m_readbuf.clear();
   54|  2.20k|   m_write_cipher_states.clear();
   55|  2.20k|   m_read_cipher_states.clear();
   56|  2.20k|}
_ZN5Botan3TLS15Channel_Impl_12D2Ev:
   73|  2.50k|Channel_Impl_12::~Channel_Impl_12() = default;
_ZNK5Botan3TLS15Channel_Impl_1216sequence_numbersEv:
   75|  9.42k|Connection_Sequence_Numbers& Channel_Impl_12::sequence_numbers() const {
   76|  9.42k|   BOTAN_ASSERT(m_sequence_numbers, "Have a sequence numbers object");
  ------------------
  |  |   51|  9.42k|   do {                                                                                 \
  |  |   52|  9.42k|      if(!(expr))                                                                       \
  |  |  ------------------
  |  |  |  Branch (52:10): [True: 0, False: 9.42k]
  |  |  ------------------
  |  |   53|  9.42k|         Botan::assertion_failure(#expr, assertion_made, __func__, __FILE__, __LINE__); \
  |  |   54|  9.42k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (54:12): [Folded - Ignored]
  |  |  ------------------
  ------------------
   77|  9.42k|   return *m_sequence_numbers;
   78|  9.42k|}
_ZNK5Botan3TLS15Channel_Impl_1224write_cipher_state_epochEt:
   88|  4.71k|std::shared_ptr<Connection_Cipher_State> Channel_Impl_12::write_cipher_state_epoch(uint16_t epoch) const {
   89|  4.71k|   auto i = m_write_cipher_states.find(epoch);
   90|  4.71k|   if(i == m_write_cipher_states.end()) {
  ------------------
  |  Branch (90:7): [True: 0, False: 4.71k]
  ------------------
   91|      0|      throw Internal_Error("TLS::Channel_Impl_12 No write cipherstate for epoch " + std::to_string(epoch));
   92|      0|   }
   93|  4.71k|   return i->second;
   94|  4.71k|}
_ZN5Botan3TLS15Channel_Impl_1222create_handshake_stateENS0_16Protocol_VersionE:
  103|  3.66k|Handshake_State& Channel_Impl_12::create_handshake_state(Protocol_Version version) {
  104|  3.66k|   if(pending_state()) {
  ------------------
  |  Branch (104:7): [True: 0, False: 3.66k]
  ------------------
  105|      0|      throw Internal_Error("create_handshake_state called during handshake");
  106|      0|   }
  107|       |
  108|  3.66k|   if(auto active = active_state()) {
  ------------------
  |  Branch (108:12): [True: 0, False: 3.66k]
  ------------------
  109|      0|      Protocol_Version active_version = active->version();
  110|       |
  111|      0|      if(active_version.is_datagram_protocol() != version.is_datagram_protocol()) {
  ------------------
  |  Branch (111:10): [True: 0, False: 0]
  ------------------
  112|      0|         throw TLS_Exception(Alert::ProtocolVersion,
  113|      0|                             "Active state using version " + active_version.to_string() + " cannot change to " +
  114|      0|                                version.to_string() + " in pending");
  115|      0|      }
  116|      0|   }
  117|       |
  118|  3.66k|   if(!m_sequence_numbers) {
  ------------------
  |  Branch (118:7): [True: 2.50k, False: 1.16k]
  ------------------
  119|  2.50k|      if(version.is_datagram_protocol()) {
  ------------------
  |  Branch (119:10): [True: 0, False: 2.50k]
  ------------------
  120|      0|         m_sequence_numbers = std::make_unique<Datagram_Sequence_Numbers>();
  121|  2.50k|      } else {
  122|  2.50k|         m_sequence_numbers = std::make_unique<Stream_Sequence_Numbers>();
  123|  2.50k|      }
  124|  2.50k|   }
  125|       |
  126|  3.66k|   using namespace std::placeholders;
  127|       |
  128|  3.66k|   std::unique_ptr<Handshake_IO> io;
  129|  3.66k|   if(version.is_datagram_protocol()) {
  ------------------
  |  Branch (129:7): [True: 0, False: 3.66k]
  ------------------
  130|      0|      io =
  131|      0|         std::make_unique<Datagram_Handshake_IO>(std::bind(&Channel_Impl_12::send_record_under_epoch, this, _1, _2, _3),
  132|      0|                                                 sequence_numbers(),
  133|      0|                                                 static_cast<uint16_t>(policy().dtls_default_mtu()),
  134|      0|                                                 policy().dtls_initial_timeout(),
  135|      0|                                                 policy().dtls_maximum_timeout());
  136|  3.66k|   } else {
  137|  3.66k|      io = std::make_unique<Stream_Handshake_IO>(std::bind(&Channel_Impl_12::send_record, this, _1, _2));
  138|  3.66k|   }
  139|       |
  140|  3.66k|   m_pending_state = new_handshake_state(std::move(io));
  141|       |
  142|  3.66k|   if(auto active = active_state()) {
  ------------------
  |  Branch (142:12): [True: 0, False: 3.66k]
  ------------------
  143|      0|      m_pending_state->set_version(active->version());
  144|      0|   }
  145|       |
  146|  3.66k|   return *m_pending_state;
  147|  3.66k|}
_ZNK5Botan3TLS15Channel_Impl_129is_closedEv:
  238|  2.79k|bool Channel_Impl_12::is_closed() const { return m_has_been_closed; }
_ZN5Botan3TLS15Channel_Impl_129from_peerENSt3__14spanIKhLm18446744073709551615EEE:
  257|  2.50k|size_t Channel_Impl_12::from_peer(std::span<const uint8_t> data) {
  258|  2.50k|   const bool allow_epoch0_restart = m_is_datagram && m_is_server && policy().allow_dtls_epoch0_restart();
  ------------------
  |  Branch (258:38): [True: 0, False: 2.50k]
  |  Branch (258:55): [True: 0, False: 0]
  |  Branch (258:70): [True: 0, False: 0]
  ------------------
  259|       |
  260|  2.50k|   auto input = data.data();
  261|  2.50k|   auto input_size = data.size();
  262|       |
  263|  2.50k|   try {
  264|  10.8k|      while(input_size) {
  ------------------
  |  Branch (264:13): [True: 8.39k, False: 2.40k]
  ------------------
  265|  8.39k|         size_t consumed = 0;
  266|       |
  267|  8.39k|         auto get_epoch = [this](uint16_t epoch) { return read_cipher_state_epoch(epoch); };
  268|       |
  269|  8.39k|         const Record_Header record = read_record(m_is_datagram,
  270|  8.39k|                                                  m_readbuf,
  271|  8.39k|                                                  input,
  272|  8.39k|                                                  input_size,
  273|  8.39k|                                                  consumed,
  274|  8.39k|                                                  m_record_buf,
  275|  8.39k|                                                  m_sequence_numbers.get(),
  276|  8.39k|                                                  get_epoch,
  277|  8.39k|                                                  allow_epoch0_restart);
  278|       |
  279|  8.39k|         const size_t needed = record.needed();
  280|       |
  281|  8.39k|         BOTAN_ASSERT(consumed > 0, "Got to eat something");
  ------------------
  |  |   51|  8.39k|   do {                                                                                 \
  |  |   52|  8.39k|      if(!(expr))                                                                       \
  |  |  ------------------
  |  |  |  Branch (52:10): [True: 0, False: 8.39k]
  |  |  ------------------
  |  |   53|  8.39k|         Botan::assertion_failure(#expr, assertion_made, __func__, __FILE__, __LINE__); \
  |  |   54|  8.39k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (54:12): [Folded - Ignored]
  |  |  ------------------
  ------------------
  282|       |
  283|  8.39k|         BOTAN_ASSERT(consumed <= input_size, "Record reader consumed sane amount");
  ------------------
  |  |   51|  8.39k|   do {                                                                                 \
  |  |   52|  8.39k|      if(!(expr))                                                                       \
  |  |  ------------------
  |  |  |  Branch (52:10): [True: 0, False: 8.39k]
  |  |  ------------------
  |  |   53|  8.39k|         Botan::assertion_failure(#expr, assertion_made, __func__, __FILE__, __LINE__); \
  |  |   54|  8.39k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (54:12): [Folded - Ignored]
  |  |  ------------------
  ------------------
  284|       |
  285|  8.39k|         input += consumed;
  286|  8.39k|         input_size -= consumed;
  287|       |
  288|  8.39k|         BOTAN_ASSERT(input_size == 0 || needed == 0, "Got a full record or consumed all input");
  ------------------
  |  |   51|  8.39k|   do {                                                                                 \
  |  |   52|  14.3k|      if(!(expr))                                                                       \
  |  |  ------------------
  |  |  |  Branch (52:12): [True: 2.45k, False: 5.94k]
  |  |  |  Branch (52:12): [True: 5.94k, False: 0]
  |  |  ------------------
  |  |   53|  8.39k|         Botan::assertion_failure(#expr, assertion_made, __func__, __FILE__, __LINE__); \
  |  |   54|  8.39k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (54:12): [Folded - Ignored]
  |  |  ------------------
  ------------------
  289|       |
  290|  8.39k|         if(input_size == 0 && needed != 0) {
  ------------------
  |  Branch (290:13): [True: 2.36k, False: 6.03k]
  |  Branch (290:32): [True: 89, False: 2.27k]
  ------------------
  291|     89|            return needed;  // need more data to complete record
  292|     89|         }
  293|       |
  294|       |         // Ignore invalid records in DTLS
  295|  8.30k|         if(m_is_datagram && record.type() == Record_Type::Invalid) {
  ------------------
  |  Branch (295:13): [True: 0, False: 8.30k]
  |  Branch (295:30): [True: 0, False: 0]
  ------------------
  296|      0|            return 0;
  297|      0|         }
  298|       |
  299|  8.30k|         if(m_record_buf.size() > MAX_PLAINTEXT_SIZE) {
  ------------------
  |  Branch (299:13): [True: 0, False: 8.30k]
  ------------------
  300|      0|            throw TLS_Exception(Alert::RecordOverflow, "TLS plaintext record is larger than allowed maximum");
  301|      0|         }
  302|       |
  303|  8.30k|         const bool epoch0_restart = m_is_datagram && record.epoch() == 0 && active_state();
  ------------------
  |  Branch (303:38): [True: 0, False: 8.30k]
  |  Branch (303:55): [True: 0, False: 0]
  |  Branch (303:78): [True: 0, False: 0]
  ------------------
  304|  8.30k|         BOTAN_ASSERT_IMPLICATION(epoch0_restart, allow_epoch0_restart, "Allowed state");
  ------------------
  |  |   78|  8.30k|   do {                                                                                          \
  |  |   79|  8.30k|      if((expr1) && !(expr2))                                                                    \
  |  |  ------------------
  |  |  |  Branch (79:10): [True: 0, False: 8.30k]
  |  |  |  Branch (79:21): [True: 0, False: 0]
  |  |  ------------------
  |  |   80|  8.30k|         Botan::assertion_failure(#expr1 " implies " #expr2, msg, __func__, __FILE__, __LINE__); \
  |  |   81|  8.30k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (81:12): [Folded - Ignored]
  |  |  ------------------
  ------------------
  305|       |
  306|  8.30k|         const bool initial_record = epoch0_restart || (!pending_state() && !active_state());
  ------------------
  |  Branch (306:38): [True: 90, False: 8.21k]
  |  Branch (306:57): [True: 2.04k, False: 6.17k]
  |  Branch (306:77): [True: 2.04k, False: 0]
  ------------------
  307|       |
  308|  8.30k|         if(record.type() != Record_Type::Alert) {
  ------------------
  |  Branch (308:13): [True: 5.43k, False: 2.86k]
  ------------------
  309|  5.43k|            if(initial_record) {
  ------------------
  |  Branch (309:16): [True: 1.16k, False: 4.26k]
  ------------------
  310|       |               // For initial records just check for basic sanity
  311|  1.16k|               if(record.version().major_version() != 3 && record.version().major_version() != 0xFE) {
  ------------------
  |  Branch (311:19): [True: 0, False: 1.16k]
  |  Branch (311:19): [True: 0, False: 1.16k]
  |  Branch (311:60): [True: 0, False: 0]
  ------------------
  312|      0|                  throw TLS_Exception(Alert::ProtocolVersion, "Received unexpected record version in initial record");
  313|      0|               }
  314|  4.26k|            } else if(auto pending = pending_state()) {
  ------------------
  |  Branch (314:28): [True: 4.26k, False: 0]
  ------------------
  315|  4.26k|               if(pending->server_hello() != nullptr && record.version() != pending->version()) {
  ------------------
  |  Branch (315:19): [True: 0, False: 4.26k]
  |  Branch (315:19): [True: 0, False: 4.26k]
  |  Branch (315:57): [True: 0, False: 0]
  ------------------
  316|      0|                  throw TLS_Exception(Alert::ProtocolVersion, "Received unexpected record version");
  317|      0|               }
  318|  4.26k|            } else if(auto active = active_state()) {
  ------------------
  |  Branch (318:28): [True: 0, False: 0]
  ------------------
  319|      0|               if(record.version() != active->version()) {
  ------------------
  |  Branch (319:19): [True: 0, False: 0]
  ------------------
  320|      0|                  throw TLS_Exception(Alert::ProtocolVersion, "Received unexpected record version");
  321|      0|               }
  322|      0|            }
  323|  5.43k|         }
  324|       |
  325|  8.30k|         if(record.type() == Record_Type::Handshake || record.type() == Record_Type::ChangeCipherSpec) {
  ------------------
  |  Branch (325:13): [True: 5.00k, False: 3.30k]
  |  Branch (325:56): [True: 519, False: 2.78k]
  ------------------
  326|  5.43k|            if(m_has_been_closed) {
  ------------------
  |  Branch (326:16): [True: 1, False: 5.43k]
  ------------------
  327|      1|               throw TLS_Exception(Alert::UnexpectedMessage, "Received handshake data after connection closure");
  328|      1|            }
  329|  5.43k|            process_handshake_ccs(m_record_buf, record.sequence(), record.type(), record.version(), epoch0_restart);
  330|  5.43k|         } else if(record.type() == Record_Type::ApplicationData) {
  ------------------
  |  Branch (330:20): [True: 4, False: 2.86k]
  ------------------
  331|      4|            if(m_has_been_closed) {
  ------------------
  |  Branch (331:16): [True: 1, False: 3]
  ------------------
  332|      1|               throw TLS_Exception(Alert::UnexpectedMessage, "Received application data after connection closure");
  333|      1|            }
  334|      3|            if(pending_state() != nullptr) {
  ------------------
  |  Branch (334:16): [True: 2, False: 1]
  ------------------
  335|      2|               throw TLS_Exception(Alert::UnexpectedMessage, "Can't interleave application and handshake data");
  336|      2|            }
  337|      1|            process_application_data(record.sequence(), m_record_buf);
  338|  2.86k|         } else if(record.type() == Record_Type::Alert) {
  ------------------
  |  Branch (338:20): [True: 2.77k, False: 90]
  ------------------
  339|  2.77k|            process_alert(m_record_buf);
  340|  2.77k|         } else if(record.type() != Record_Type::Invalid) {
  ------------------
  |  Branch (340:20): [True: 0, False: 90]
  ------------------
  341|      0|            throw Unexpected_Message("Unexpected record type " + std::to_string(static_cast<size_t>(record.type())) +
  342|      0|                                     " from counterparty");
  343|      0|         }
  344|  8.30k|      }
  345|       |
  346|  2.40k|      return 0;  // on a record boundary
  347|  2.50k|   } catch(TLS_Exception& e) {
  348|    551|      send_fatal_alert(e.type());
  349|    551|      throw;
  350|    551|   } catch(Invalid_Authentication_Tag&) {
  351|      0|      send_fatal_alert(Alert::BadRecordMac);
  352|      0|      throw;
  353|  1.65k|   } catch(Decoding_Error&) {
  354|  1.65k|      send_fatal_alert(Alert::DecodeError);
  355|  1.65k|      throw;
  356|  1.65k|   } catch(...) {
  357|      0|      send_fatal_alert(Alert::InternalError);
  358|      0|      throw;
  359|      0|   }
  360|  2.50k|}
_ZN5Botan3TLS15Channel_Impl_1221process_handshake_ccsERKNSt3__16vectorIhNS_16secure_allocatorIhEEEEmNS0_11Record_TypeENS0_16Protocol_VersionEb:
  366|  5.43k|                                            bool epoch0_restart) {
  367|  5.43k|   if(!m_pending_state) {
  ------------------
  |  Branch (367:7): [True: 1.16k, False: 4.26k]
  ------------------
  368|       |      // No pending handshake, possibly new:
  369|  1.16k|      if(record_version.is_datagram_protocol() && !epoch0_restart) {
  ------------------
  |  Branch (369:10): [True: 0, False: 1.16k]
  |  Branch (369:51): [True: 0, False: 0]
  ------------------
  370|      0|         if(m_sequence_numbers) {
  ------------------
  |  Branch (370:13): [True: 0, False: 0]
  ------------------
  371|       |            /*
  372|       |            * Might be a peer retransmit under epoch - 1 in which
  373|       |            * case we must retransmit last flight
  374|       |            */
  375|      0|            sequence_numbers().read_accept(record_sequence);
  376|       |
  377|      0|            const uint16_t epoch = record_sequence >> 48;
  378|       |
  379|      0|            if(epoch == sequence_numbers().current_read_epoch()) {
  ------------------
  |  Branch (379:16): [True: 0, False: 0]
  ------------------
  380|      0|               create_handshake_state(record_version);
  381|      0|            } else if(epoch == sequence_numbers().current_read_epoch() - 1) {
  ------------------
  |  Branch (381:23): [True: 0, False: 0]
  ------------------
  382|      0|               BOTAN_ASSERT(m_active_state, "Have active state here");
  ------------------
  |  |   51|      0|   do {                                                                                 \
  |  |   52|      0|      if(!(expr))                                                                       \
  |  |  ------------------
  |  |  |  Branch (52:10): [True: 0, False: 0]
  |  |  ------------------
  |  |   53|      0|         Botan::assertion_failure(#expr, assertion_made, __func__, __FILE__, __LINE__); \
  |  |   54|      0|   } while(0)
  |  |  ------------------
  |  |  |  Branch (54:12): [Folded - Ignored]
  |  |  ------------------
  ------------------
  383|      0|               m_active_state->handshake_io().add_record(record.data(), record.size(), record_type, record_sequence);
  384|      0|            }
  385|      0|         } else {
  386|      0|            create_handshake_state(record_version);
  387|      0|         }
  388|  1.16k|      } else {
  389|  1.16k|         create_handshake_state(record_version);
  390|  1.16k|      }
  391|  1.16k|   }
  392|       |
  393|       |   // May have been created in above conditional
  394|  5.43k|   if(m_pending_state) {
  ------------------
  |  Branch (394:7): [True: 5.43k, False: 0]
  ------------------
  395|  5.43k|      m_pending_state->handshake_io().add_record(record.data(), record.size(), record_type, record_sequence);
  396|       |
  397|  7.46k|      while(auto pending = m_pending_state.get()) {
  ------------------
  |  Branch (397:18): [True: 5.39k, False: 2.06k]
  ------------------
  398|  5.39k|         auto msg = pending->get_next_handshake_msg();
  399|       |
  400|  5.39k|         if(msg.first == Handshake_Type::None) {  // no full handshake yet
  ------------------
  |  Branch (400:13): [True: 3.36k, False: 2.03k]
  ------------------
  401|  3.36k|            break;
  402|  3.36k|         }
  403|       |
  404|  2.03k|         process_handshake_msg(active_state(), *pending, msg.first, msg.second, epoch0_restart);
  405|       |
  406|  2.03k|         if(!m_pending_state) {
  ------------------
  |  Branch (406:13): [True: 0, False: 2.03k]
  ------------------
  407|      0|            break;
  408|      0|         }
  409|  2.03k|      }
  410|  5.43k|   }
  411|  5.43k|}
_ZN5Botan3TLS15Channel_Impl_1224process_application_dataEmRKNSt3__16vectorIhNS_16secure_allocatorIhEEEE:
  413|      1|void Channel_Impl_12::process_application_data(uint64_t seq_no, const secure_vector<uint8_t>& record) {
  414|      1|   if(!active_state()) {
  ------------------
  |  Branch (414:7): [True: 1, False: 0]
  ------------------
  415|      1|      throw Unexpected_Message("Application data before handshake done");
  416|      1|   }
  417|       |
  418|      0|   callbacks().tls_record_received(seq_no, record);
  419|      0|}
_ZN5Botan3TLS15Channel_Impl_1213process_alertERKNSt3__16vectorIhNS_16secure_allocatorIhEEEE:
  421|  2.77k|void Channel_Impl_12::process_alert(const secure_vector<uint8_t>& record) {
  422|  2.77k|   Alert alert_msg(record);
  423|       |
  424|  2.77k|   if(alert_msg.type() == Alert::NoRenegotiation) {
  ------------------
  |  Branch (424:7): [True: 1.95k, False: 824]
  ------------------
  425|  1.95k|      m_pending_state.reset();
  426|  1.95k|   }
  427|       |
  428|  2.77k|   callbacks().tls_alert(alert_msg);
  429|       |
  430|  2.77k|   if(alert_msg.is_fatal()) {
  ------------------
  |  Branch (430:7): [True: 693, False: 2.08k]
  ------------------
  431|    693|      if(auto active = active_state()) {
  ------------------
  |  Branch (431:15): [True: 0, False: 693]
  ------------------
  432|      0|         const auto& session_id = active->server_hello()->session_id();
  433|      0|         if(!session_id.empty()) {
  ------------------
  |  Branch (433:13): [True: 0, False: 0]
  ------------------
  434|      0|            session_manager().remove(session_id);
  435|      0|         }
  436|      0|      }
  437|    693|   }
  438|       |
  439|  2.77k|   if(alert_msg.type() == Alert::CloseNotify) {
  ------------------
  |  Branch (439:7): [True: 590, False: 2.18k]
  ------------------
  440|       |      // TLS 1.2 requires us to immediately react with our "close_notify",
  441|       |      // the return value of the application's callback has no effect on that.
  442|    590|      callbacks().tls_peer_closed_connection();
  443|    590|      send_warning_alert(Alert::CloseNotify);  // reply in kind
  444|    590|   }
  445|       |
  446|  2.77k|   if(alert_msg.type() == Alert::CloseNotify || alert_msg.is_fatal()) {
  ------------------
  |  Branch (446:7): [True: 636, False: 2.14k]
  |  Branch (446:49): [True: 202, False: 1.94k]
  ------------------
  447|    792|      m_has_been_closed = true;
  448|    792|   }
  449|  2.77k|}
_ZN5Botan3TLS15Channel_Impl_1212write_recordEPNS0_23Connection_Cipher_StateEtNS0_11Record_TypeEPKhm:
  455|  4.71k|                                   size_t length) {
  456|  4.71k|   BOTAN_ASSERT(m_pending_state || m_active_state, "Some connection state exists");
  ------------------
  |  |   51|  4.71k|   do {                                                                                 \
  |  |   52|  4.73k|      if(!(expr))                                                                       \
  |  |  ------------------
  |  |  |  Branch (52:12): [True: 4.70k, False: 14]
  |  |  |  Branch (52:12): [True: 0, False: 14]
  |  |  ------------------
  |  |   53|  4.71k|         Botan::assertion_failure(#expr, assertion_made, __func__, __FILE__, __LINE__); \
  |  |   54|  4.71k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (54:12): [Folded - Ignored]
  |  |  ------------------
  ------------------
  457|       |
  458|  4.71k|   const Protocol_Version record_version =
  459|  4.71k|      (m_pending_state) ? (m_pending_state->version()) : (m_active_state->version());
  ------------------
  |  Branch (459:7): [True: 4.70k, False: 14]
  ------------------
  460|       |
  461|  4.71k|   const uint64_t next_seq = sequence_numbers().next_write_sequence(epoch);
  462|       |
  463|  4.71k|   if(cipher_state == nullptr) {
  ------------------
  |  Branch (463:7): [True: 4.70k, False: 14]
  ------------------
  464|  4.70k|      TLS::write_unencrypted_record(m_writebuf, record_type, record_version, next_seq, input, length);
  465|  4.70k|   } else {
  466|     14|      TLS::write_record(m_writebuf, record_type, record_version, next_seq, input, length, *cipher_state, rng());
  467|     14|   }
  468|       |
  469|  4.71k|   callbacks().tls_emit_data(m_writebuf);
  470|  4.71k|}
_ZN5Botan3TLS15Channel_Impl_1217send_record_arrayEtNS0_11Record_TypeEPKhm:
  472|  4.71k|void Channel_Impl_12::send_record_array(uint16_t epoch, Record_Type type, const uint8_t input[], size_t length) {
  473|  4.71k|   if(length == 0) {
  ------------------
  |  Branch (473:7): [True: 0, False: 4.71k]
  ------------------
  474|      0|      return;
  475|      0|   }
  476|       |
  477|  4.71k|   auto cipher_state = write_cipher_state_epoch(epoch);
  478|       |
  479|  9.43k|   while(length) {
  ------------------
  |  Branch (479:10): [True: 4.71k, False: 4.71k]
  ------------------
  480|  4.71k|      const size_t sending = std::min<size_t>(length, MAX_PLAINTEXT_SIZE);
  481|  4.71k|      write_record(cipher_state.get(), epoch, type, input, sending);
  482|       |
  483|  4.71k|      input += sending;
  484|  4.71k|      length -= sending;
  485|  4.71k|   }
  486|  4.71k|}
_ZN5Botan3TLS15Channel_Impl_1211send_recordENS0_11Record_TypeERKNSt3__16vectorIhNS3_9allocatorIhEEEE:
  488|  4.71k|void Channel_Impl_12::send_record(Record_Type record_type, const std::vector<uint8_t>& record) {
  489|  4.71k|   send_record_array(sequence_numbers().current_write_epoch(), record_type, record.data(), record.size());
  490|  4.71k|}
_ZN5Botan3TLS15Channel_Impl_1210send_alertERKNS0_5AlertE:
  506|  2.79k|void Channel_Impl_12::send_alert(const Alert& alert) {
  507|  2.79k|   const bool ready_to_send_anything = !is_closed() && m_sequence_numbers;
  ------------------
  |  Branch (507:40): [True: 2.21k, False: 581]
  |  Branch (507:56): [True: 2.21k, False: 0]
  ------------------
  508|  2.79k|   if(alert.is_valid() && ready_to_send_anything) {
  ------------------
  |  Branch (508:7): [True: 2.79k, False: 0]
  |  Branch (508:27): [True: 2.21k, False: 581]
  ------------------
  509|  2.21k|      try {
  510|  2.21k|         send_record(Record_Type::Alert, alert.serialize());
  511|  2.21k|      } catch(...) { /* swallow it */
  512|     14|      }
  513|  2.21k|   }
  514|       |
  515|  2.79k|   if(alert.type() == Alert::NoRenegotiation) {
  ------------------
  |  Branch (515:7): [True: 0, False: 2.79k]
  ------------------
  516|      0|      m_pending_state.reset();
  517|      0|   }
  518|       |
  519|  2.79k|   if(alert.is_fatal()) {
  ------------------
  |  Branch (519:7): [True: 2.20k, False: 590]
  ------------------
  520|  2.20k|      if(auto active = active_state()) {
  ------------------
  |  Branch (520:15): [True: 0, False: 2.20k]
  ------------------
  521|      0|         const auto& session_id = active->server_hello()->session_id();
  522|      0|         if(!session_id.empty()) {
  ------------------
  |  Branch (522:13): [True: 0, False: 0]
  ------------------
  523|      0|            session_manager().remove(Session_ID(session_id));
  524|      0|         }
  525|      0|      }
  526|  2.20k|      reset_state();
  527|  2.20k|   }
  528|       |
  529|  2.79k|   if(alert.type() == Alert::CloseNotify || alert.is_fatal()) {
  ------------------
  |  Branch (529:7): [True: 590, False: 2.20k]
  |  Branch (529:45): [True: 2.20k, False: 0]
  ------------------
  530|  2.79k|      m_has_been_closed = true;
  531|  2.79k|   }
  532|  2.79k|}
_ZN5Botan3TLS15Channel_Impl_1226secure_renegotiation_checkEPKNS0_15Client_Hello_12E:
  534|  2.50k|void Channel_Impl_12::secure_renegotiation_check(const Client_Hello_12* client_hello) {
  535|  2.50k|   const bool secure_renegotiation = client_hello->secure_renegotiation();
  536|       |
  537|  2.50k|   if(auto active = active_state()) {
  ------------------
  |  Branch (537:12): [True: 0, False: 2.50k]
  ------------------
  538|      0|      const bool active_sr = active->client_hello()->secure_renegotiation();
  539|       |
  540|      0|      if(active_sr != secure_renegotiation) {
  ------------------
  |  Branch (540:10): [True: 0, False: 0]
  ------------------
  541|      0|         throw TLS_Exception(Alert::HandshakeFailure, "Client changed its mind about secure renegotiation");
  542|      0|      }
  543|      0|   }
  544|       |
  545|  2.50k|   if(secure_renegotiation) {
  ------------------
  |  Branch (545:7): [True: 2.50k, False: 0]
  ------------------
  546|  2.50k|      const std::vector<uint8_t>& data = client_hello->renegotiation_info();
  547|       |
  548|  2.50k|      if(data != secure_renegotiation_data_for_client_hello()) {
  ------------------
  |  Branch (548:10): [True: 0, False: 2.50k]
  ------------------
  549|      0|         throw TLS_Exception(Alert::HandshakeFailure, "Client sent bad values for secure renegotiation");
  550|      0|      }
  551|  2.50k|   }
  552|  2.50k|}
_ZNK5Botan3TLS15Channel_Impl_1242secure_renegotiation_data_for_client_helloEv:
  574|  5.00k|std::vector<uint8_t> Channel_Impl_12::secure_renegotiation_data_for_client_hello() const {
  575|  5.00k|   if(auto active = active_state()) {
  ------------------
  |  Branch (575:12): [True: 0, False: 5.00k]
  ------------------
  576|      0|      return active->client_finished()->verify_data();
  577|      0|   }
  578|  5.00k|   return std::vector<uint8_t>();
  579|  5.00k|}

_ZN5Botan3TLS14Client_Impl_12C2ENSt3__110shared_ptrINS0_9CallbacksEEENS3_INS0_15Session_ManagerEEENS3_INS_19Credentials_ManagerEEENS3_IKNS0_6PolicyEEENS3_INS_21RandomNumberGeneratorEEENS0_18Server_InformationEbRKNS2_6vectorINS2_12basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEENSK_ISM_EEEEm:
   70|  2.50k|      m_info(info) {
   71|  2.50k|   BOTAN_ASSERT_NONNULL(m_creds);
  ------------------
  |  |   87|  2.50k|   do {                                                                                   \
  |  |   88|  2.50k|      if((ptr) == nullptr)                                                                \
  |  |  ------------------
  |  |  |  Branch (88:10): [True: 0, False: 2.50k]
  |  |  ------------------
  |  |   89|  2.50k|         Botan::assertion_failure(#ptr " is not null", "", __func__, __FILE__, __LINE__); \
  |  |   90|  2.50k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (90:12): [Folded - Ignored]
  |  |  ------------------
  ------------------
   72|  2.50k|   const auto version = datagram ? Protocol_Version::DTLS_V12 : Protocol_Version::TLS_V12;
  ------------------
  |  Branch (72:25): [True: 0, False: 2.50k]
  ------------------
   73|  2.50k|   Handshake_State& state = create_handshake_state(version);
   74|  2.50k|   send_client_hello(state, false, version, std::nullopt /* no a-priori session to resume */, next_protocols);
   75|  2.50k|}
_ZN5Botan3TLS14Client_Impl_1219new_handshake_stateENSt3__110unique_ptrINS0_12Handshake_IOENS2_14default_deleteIS4_EEEE:
  114|  3.66k|std::unique_ptr<Handshake_State> Client_Impl_12::new_handshake_state(std::unique_ptr<Handshake_IO> io) {
  115|  3.66k|   return std::make_unique<Client_Handshake_State_12>(std::move(io), callbacks());
  116|  3.66k|}
_ZN5Botan3TLS14Client_Impl_1217send_client_helloERNS0_15Handshake_StateEbNS0_16Protocol_VersionENSt3__18optionalINS0_19Session_with_HandleEEERKNS5_6vectorINS5_12basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEENSD_ISF_EEEE:
  142|  2.50k|                                       const std::vector<std::string>& next_protocols) {
  143|  2.50k|   Client_Handshake_State_12& state = dynamic_cast<Client_Handshake_State_12&>(state_base);
  144|       |
  145|  2.50k|   if(state.version().is_datagram_protocol())
  ------------------
  |  Branch (145:7): [True: 0, False: 2.50k]
  ------------------
  146|      0|      state.set_expected_next(Handshake_Type::HelloVerifyRequest);  // optional
  147|  2.50k|   state.set_expected_next(Handshake_Type::ServerHello);
  148|       |
  149|  2.50k|   if(!force_full_renegotiation) {
  ------------------
  |  Branch (149:7): [True: 2.50k, False: 0]
  ------------------
  150|       |      // if no session is provided, we need to try and find one opportunistically
  151|  2.50k|      if(!session_and_handle.has_value() && !m_info.empty()) {
  ------------------
  |  Branch (151:10): [True: 2.50k, False: 0]
  |  Branch (151:45): [True: 2.50k, False: 0]
  ------------------
  152|  2.50k|         if(auto sessions = session_manager().find(m_info, callbacks(), policy()); !sessions.empty()) {
  ------------------
  |  Branch (152:84): [True: 0, False: 2.50k]
  ------------------
  153|      0|            session_and_handle = std::move(sessions.front());
  154|      0|         }
  155|  2.50k|      }
  156|       |
  157|  2.50k|      if(session_and_handle.has_value()) {
  ------------------
  |  Branch (157:10): [True: 0, False: 2.50k]
  ------------------
  158|       |         /*
  159|       |         Ensure that the session protocol cipher and version are acceptable
  160|       |         If not skip the resume and establish a new session
  161|       |         */
  162|      0|         auto& session_info = session_and_handle->session;
  163|      0|         const bool exact_version = session_info.version() == version;
  164|      0|         const bool ok_version = (session_info.version().is_datagram_protocol() == version.is_datagram_protocol()) &&
  ------------------
  |  Branch (164:34): [True: 0, False: 0]
  ------------------
  165|      0|                                 policy().acceptable_protocol_version(session_info.version());
  ------------------
  |  Branch (165:34): [True: 0, False: 0]
  ------------------
  166|       |
  167|      0|         const bool session_version_ok = policy().only_resume_with_exact_version() ? exact_version : ok_version;
  ------------------
  |  Branch (167:42): [True: 0, False: 0]
  ------------------
  168|       |
  169|      0|         if(policy().acceptable_ciphersuite(session_info.ciphersuite()) && session_version_ok) {
  ------------------
  |  Branch (169:13): [True: 0, False: 0]
  |  Branch (169:13): [True: 0, False: 0]
  |  Branch (169:76): [True: 0, False: 0]
  ------------------
  170|      0|            state.client_hello(new Client_Hello_12(state.handshake_io(),
  171|      0|                                                   state.hash(),
  172|      0|                                                   policy(),
  173|      0|                                                   callbacks(),
  174|      0|                                                   rng(),
  175|      0|                                                   secure_renegotiation_data_for_client_hello(),
  176|      0|                                                   session_and_handle.value(),
  177|      0|                                                   next_protocols));
  178|       |
  179|      0|            state.resumed_session = std::move(session_info);
  180|      0|         }
  181|      0|      }
  182|  2.50k|   }
  183|       |
  184|  2.50k|   if(!state.client_hello())  // not resuming
  ------------------
  |  Branch (184:7): [True: 2.50k, False: 0]
  ------------------
  185|  2.50k|   {
  186|  2.50k|      Client_Hello_12::Settings client_settings(version, m_info.hostname());
  187|  2.50k|      state.client_hello(new Client_Hello_12(state.handshake_io(),
  188|  2.50k|                                             state.hash(),
  189|  2.50k|                                             policy(),
  190|  2.50k|                                             callbacks(),
  191|  2.50k|                                             rng(),
  192|  2.50k|                                             secure_renegotiation_data_for_client_hello(),
  193|  2.50k|                                             client_settings,
  194|  2.50k|                                             next_protocols));
  195|  2.50k|   }
  196|       |
  197|  2.50k|   secure_renegotiation_check(state.client_hello());
  198|  2.50k|}
_ZN5Botan3TLS14Client_Impl_1221process_handshake_msgEPKNS0_15Handshake_StateERS2_NS0_14Handshake_TypeERKNSt3__16vectorIhNS7_9allocatorIhEEEEb:
  222|  2.03k|                                           bool epoch0_restart) {
  223|  2.03k|   BOTAN_ASSERT_NOMSG(epoch0_restart == false);  // only happens on server side
  ------------------
  |  |   60|  2.03k|   do {                                                                     \
  |  |   61|  2.03k|      if(!(expr))                                                           \
  |  |  ------------------
  |  |  |  Branch (61:10): [True: 0, False: 2.03k]
  |  |  ------------------
  |  |   62|  2.03k|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   63|  2.03k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (63:12): [Folded - Ignored]
  |  |  ------------------
  ------------------
  224|       |
  225|  2.03k|   Client_Handshake_State_12& state = dynamic_cast<Client_Handshake_State_12&>(state_base);
  226|       |
  227|  2.03k|   if(type == Handshake_Type::HelloRequest && active_state) {
  ------------------
  |  Branch (227:7): [True: 19, False: 2.01k]
  |  Branch (227:47): [True: 0, False: 19]
  ------------------
  228|      0|      Hello_Request hello_request(contents);
  229|       |
  230|      0|      if(state.client_hello()) {
  ------------------
  |  Branch (230:10): [True: 0, False: 0]
  ------------------
  231|      0|         throw TLS_Exception(Alert::HandshakeFailure, "Cannot renegotiate during a handshake");
  232|      0|      }
  233|       |
  234|      0|      if(policy().allow_server_initiated_renegotiation()) {
  ------------------
  |  Branch (234:10): [True: 0, False: 0]
  ------------------
  235|      0|         if(secure_renegotiation_supported() || policy().allow_insecure_renegotiation()) {
  ------------------
  |  Branch (235:13): [True: 0, False: 0]
  |  Branch (235:49): [True: 0, False: 0]
  ------------------
  236|      0|            state.m_is_reneg = true;
  237|      0|            initiate_handshake(state, true /* force_full_renegotiation */);
  238|      0|         } else {
  239|      0|            throw TLS_Exception(Alert::HandshakeFailure, "Client policy prohibits insecure renegotiation");
  240|      0|         }
  241|      0|      } else {
  242|      0|         if(policy().abort_connection_on_undesired_renegotiation()) {
  ------------------
  |  Branch (242:13): [True: 0, False: 0]
  ------------------
  243|      0|            throw TLS_Exception(Alert::NoRenegotiation, "Client policy prohibits renegotiation");
  244|      0|         } else {
  245|       |            // RFC 5746 section 4.2
  246|      0|            send_warning_alert(Alert::NoRenegotiation);
  247|      0|         }
  248|      0|      }
  249|       |
  250|      0|      return;
  251|      0|   }
  252|       |
  253|  2.03k|   state.confirm_transition_to(type);
  254|       |
  255|  2.03k|   if(type != Handshake_Type::HandshakeCCS && type != Handshake_Type::Finished &&
  ------------------
  |  Branch (255:7): [True: 1.95k, False: 72]
  |  Branch (255:47): [True: 1.95k, False: 0]
  ------------------
  256|  2.03k|      type != Handshake_Type::HelloVerifyRequest) {
  ------------------
  |  Branch (256:7): [True: 1.95k, False: 0]
  ------------------
  257|  1.95k|      state.hash().update(state.handshake_io().format(contents, type));
  258|  1.95k|   }
  259|       |
  260|  2.03k|   if(type == Handshake_Type::HelloVerifyRequest) {
  ------------------
  |  Branch (260:7): [True: 0, False: 2.03k]
  ------------------
  261|      0|      state.set_expected_next(Handshake_Type::ServerHello);
  262|      0|      state.set_expected_next(Handshake_Type::HelloVerifyRequest);  // might get it again
  263|       |
  264|      0|      Hello_Verify_Request hello_verify_request(contents);
  265|      0|      state.hello_verify_request(hello_verify_request);
  266|  2.03k|   } else if(type == Handshake_Type::ServerHello) {
  ------------------
  |  Branch (266:14): [True: 1.95k, False: 72]
  ------------------
  267|  1.95k|      state.server_hello(new Server_Hello_12(contents));
  268|       |
  269|  1.95k|      if(!state.server_hello()->legacy_version().valid()) {
  ------------------
  |  Branch (269:10): [True: 96, False: 1.86k]
  ------------------
  270|     96|         throw TLS_Exception(Alert::ProtocolVersion, "Server replied with an invalid version");
  271|     96|      }
  272|       |
  273|  1.86k|      if(!state.client_hello()->offered_suite(state.server_hello()->ciphersuite())) {
  ------------------
  |  Branch (273:10): [True: 33, False: 1.83k]
  ------------------
  274|     33|         throw TLS_Exception(Alert::HandshakeFailure, "Server replied with ciphersuite we didn't send");
  275|     33|      }
  276|       |
  277|  1.83k|      const auto suite = Ciphersuite::by_id(state.server_hello()->ciphersuite());
  278|  1.83k|      if(!suite || !suite->usable_in_version(state.server_hello()->legacy_version())) {
  ------------------
  |  Branch (278:10): [True: 1.83k, False: 0]
  |  Branch (278:20): [True: 0, False: 0]
  ------------------
  279|      0|         throw TLS_Exception(Alert::HandshakeFailure,
  280|      0|                             "Server replied using a ciphersuite not allowed in version it offered");
  281|      0|      }
  282|       |
  283|       |      // RFC 7366 3.:
  284|       |      //   If a server receives an encrypt-then-MAC request extension from a client
  285|       |      //   and then selects a stream or Authenticated Encryption with Associated
  286|       |      //   Data (AEAD) ciphersuite, it MUST NOT send an encrypt-then-MAC
  287|       |      //   response extension back to the client.
  288|  1.83k|      if(suite->aead_ciphersuite() && state.server_hello()->supports_encrypt_then_mac()) {
  ------------------
  |  Branch (288:10): [True: 0, False: 1.83k]
  |  Branch (288:39): [True: 0, False: 0]
  ------------------
  289|      0|         throw TLS_Exception(Alert::IllegalParameter,
  290|      0|                             "Server replied using an AEAD ciphersuite and an encrypt-then-MAC response extension");
  291|      0|      }
  292|       |
  293|  1.83k|      if(Ciphersuite::is_scsv(state.server_hello()->ciphersuite())) {
  ------------------
  |  Branch (293:10): [True: 0, False: 1.83k]
  ------------------
  294|      0|         throw TLS_Exception(Alert::HandshakeFailure, "Server replied with a signaling ciphersuite");
  295|      0|      }
  296|       |
  297|  1.83k|      if(state.server_hello()->compression_method() != 0) {
  ------------------
  |  Branch (297:10): [True: 0, False: 1.83k]
  ------------------
  298|      0|         throw TLS_Exception(Alert::IllegalParameter, "Server replied with non-null compression method");
  299|      0|      }
  300|       |
  301|  1.83k|      if(state.client_hello()->legacy_version() > state.server_hello()->legacy_version()) {
  ------------------
  |  Branch (301:10): [True: 0, False: 1.83k]
  ------------------
  302|       |         // check for downgrade attacks
  303|       |         //
  304|       |         // RFC 8446 4.1.3.:
  305|       |         //   TLS 1.2 clients SHOULD also check that the last 8 bytes are
  306|       |         //   not equal to the [magic value DOWNGRADE_TLS11] if the ServerHello
  307|       |         //   indicates TLS 1.1 or below.  If a match is found, the client MUST
  308|       |         //   abort the handshake with an "illegal_parameter" alert.
  309|       |         //
  310|       |         // TLS 1.3 servers will still set the magic string to DOWNGRADE_TLS12. Don't abort in this case.
  311|      0|         if(auto requested = state.server_hello()->random_signals_downgrade();
  312|      0|            requested.has_value() && requested.value() <= Protocol_Version::TLS_V11)
  ------------------
  |  Branch (312:13): [True: 0, False: 0]
  |  Branch (312:13): [True: 0, False: 0]
  |  Branch (312:38): [True: 0, False: 0]
  ------------------
  313|      0|            throw TLS_Exception(Alert::IllegalParameter, "Downgrade attack detected");
  314|      0|      }
  315|       |
  316|  1.83k|      auto client_extn = state.client_hello()->extension_types();
  317|  1.83k|      auto server_extn = state.server_hello()->extension_types();
  318|       |
  319|  1.83k|      std::vector<Extension_Code> diff;
  320|       |
  321|  1.83k|      std::set_difference(
  322|  1.83k|         server_extn.begin(), server_extn.end(), client_extn.begin(), client_extn.end(), std::back_inserter(diff));
  323|       |
  324|  1.83k|      if(!diff.empty()) {
  ------------------
  |  Branch (324:10): [True: 0, False: 1.83k]
  ------------------
  325|       |         // Server sent us back an extension we did not send!
  326|       |
  327|      0|         std::ostringstream msg;
  328|      0|         msg << "Server replied with unsupported extensions:";
  329|      0|         for(auto&& d : diff)
  ------------------
  |  Branch (329:23): [True: 0, False: 0]
  ------------------
  330|      0|            msg << " " << static_cast<int>(d);
  331|      0|         throw TLS_Exception(Alert::UnsupportedExtension, msg.str());
  332|      0|      }
  333|       |
  334|  1.83k|      if(uint16_t srtp = state.server_hello()->srtp_profile()) {
  ------------------
  |  Branch (334:19): [True: 0, False: 1.83k]
  ------------------
  335|      0|         if(!value_exists(state.client_hello()->srtp_profiles(), srtp))
  ------------------
  |  Branch (335:13): [True: 0, False: 0]
  ------------------
  336|      0|            throw TLS_Exception(Alert::HandshakeFailure, "Server replied with DTLS-SRTP alg we did not send");
  337|      0|      }
  338|       |
  339|  1.83k|      callbacks().tls_examine_extensions(
  340|  1.83k|         state.server_hello()->extensions(), Connection_Side::Server, Handshake_Type::ServerHello);
  341|       |
  342|  1.83k|      state.set_version(state.server_hello()->legacy_version());
  343|  1.83k|      m_application_protocol = state.server_hello()->next_protocol();
  344|       |
  345|  1.83k|      secure_renegotiation_check(state.server_hello());
  346|       |
  347|  1.83k|      const bool server_returned_same_session_id =
  348|  1.83k|         !state.server_hello()->session_id().empty() &&
  ------------------
  |  Branch (348:10): [True: 0, False: 1.83k]
  ------------------
  349|  1.83k|         (state.server_hello()->session_id() == state.client_hello()->session_id());
  ------------------
  |  Branch (349:10): [True: 0, False: 0]
  ------------------
  350|       |
  351|  1.83k|      if(server_returned_same_session_id) {
  ------------------
  |  Branch (351:10): [True: 0, False: 1.83k]
  ------------------
  352|       |         // successful resumption
  353|      0|         BOTAN_ASSERT_NOMSG(state.resumed_session.has_value());
  ------------------
  |  |   60|      0|   do {                                                                     \
  |  |   61|      0|      if(!(expr))                                                           \
  |  |  ------------------
  |  |  |  Branch (61:10): [True: 0, False: 0]
  |  |  ------------------
  |  |   62|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   63|      0|   } while(0)
  |  |  ------------------
  |  |  |  Branch (63:12): [Folded - Ignored]
  |  |  ------------------
  ------------------
  354|       |
  355|       |         /*
  356|       |         * In this case, we offered the version used in the original
  357|       |         * session, and the server must resume with the same version.
  358|       |         */
  359|      0|         if(state.server_hello()->legacy_version() != state.client_hello()->legacy_version())
  ------------------
  |  Branch (359:13): [True: 0, False: 0]
  ------------------
  360|      0|            throw TLS_Exception(Alert::HandshakeFailure, "Server resumed session but with wrong version");
  361|       |
  362|      0|         if(state.server_hello()->supports_extended_master_secret() &&
  ------------------
  |  Branch (362:13): [True: 0, False: 0]
  ------------------
  363|      0|            !state.resumed_session->supports_extended_master_secret()) {
  ------------------
  |  Branch (363:13): [True: 0, False: 0]
  ------------------
  364|      0|            throw TLS_Exception(Alert::HandshakeFailure, "Server resumed session but added extended master secret");
  365|      0|         }
  366|       |
  367|      0|         if(!state.server_hello()->supports_extended_master_secret() &&
  ------------------
  |  Branch (367:13): [True: 0, False: 0]
  ------------------
  368|      0|            state.resumed_session->supports_extended_master_secret()) {
  ------------------
  |  Branch (368:13): [True: 0, False: 0]
  ------------------
  369|      0|            throw TLS_Exception(Alert::HandshakeFailure, "Server resumed session and removed extended master secret");
  370|      0|         }
  371|       |
  372|      0|         state.compute_session_keys(state.resume_master_secret());
  373|       |
  374|      0|         if(state.server_hello()->supports_session_ticket()) {
  ------------------
  |  Branch (374:13): [True: 0, False: 0]
  ------------------
  375|      0|            state.set_expected_next(Handshake_Type::NewSessionTicket);
  376|      0|         } else {
  377|      0|            state.set_expected_next(Handshake_Type::HandshakeCCS);
  378|      0|         }
  379|  1.83k|      } else {
  380|       |         // new session
  381|       |
  382|  1.83k|         if(active_state) {
  ------------------
  |  Branch (382:13): [True: 0, False: 1.83k]
  ------------------
  383|       |            // Here we are testing things that should not change during a renegotation,
  384|       |            // even if the server creates a new session. Howerver they might change
  385|       |            // in a resumption scenario.
  386|       |
  387|      0|            if(active_state->version() != state.server_hello()->legacy_version())
  ------------------
  |  Branch (387:16): [True: 0, False: 0]
  ------------------
  388|      0|               throw TLS_Exception(Alert::ProtocolVersion, "Server changed version after renegotiation");
  389|       |
  390|      0|            if(state.server_hello()->supports_extended_master_secret() !=
  ------------------
  |  Branch (390:16): [True: 0, False: 0]
  ------------------
  391|      0|               active_state->server_hello()->supports_extended_master_secret()) {
  392|      0|               throw TLS_Exception(Alert::HandshakeFailure, "Server changed its mind about extended master secret");
  393|      0|            }
  394|      0|         }
  395|       |
  396|  1.83k|         state.resumed_session.reset();  // non-null if we were attempting a resumption
  397|       |
  398|  1.83k|         if(state.client_hello()->legacy_version().is_datagram_protocol() !=
  ------------------
  |  Branch (398:13): [True: 0, False: 1.83k]
  ------------------
  399|  1.83k|            state.server_hello()->legacy_version().is_datagram_protocol()) {
  400|      0|            throw TLS_Exception(Alert::ProtocolVersion, "Server replied with different protocol type than we offered");
  401|      0|         }
  402|       |
  403|  1.83k|         if(state.version() > state.client_hello()->legacy_version()) {
  ------------------
  |  Branch (403:13): [True: 0, False: 1.83k]
  ------------------
  404|      0|            throw TLS_Exception(Alert::HandshakeFailure, "Server replied with later version than client offered");
  405|      0|         }
  406|       |
  407|  1.83k|         if(state.version().major_version() == 3 && state.version().minor_version() == 0) {
  ------------------
  |  Branch (407:13): [True: 0, False: 1.83k]
  |  Branch (407:13): [True: 0, False: 1.83k]
  |  Branch (407:53): [True: 0, False: 0]
  ------------------
  408|      0|            throw TLS_Exception(Alert::ProtocolVersion, "Server attempting to negotiate SSLv3 which is not supported");
  409|      0|         }
  410|       |
  411|  1.83k|         if(!policy().acceptable_protocol_version(state.version())) {
  ------------------
  |  Branch (411:13): [True: 0, False: 1.83k]
  ------------------
  412|      0|            throw TLS_Exception(Alert::ProtocolVersion,
  413|      0|                                "Server version " + state.version().to_string() + " is unacceptable by policy");
  414|      0|         }
  415|       |
  416|  1.83k|         if(state.ciphersuite().signature_used() || state.ciphersuite().kex_method() == Kex_Algo::STATIC_RSA) {
  ------------------
  |  Branch (416:13): [True: 1.83k, False: 0]
  |  Branch (416:53): [True: 0, False: 0]
  ------------------
  417|      0|            state.set_expected_next(Handshake_Type::Certificate);
  418|  1.83k|         } else if(state.ciphersuite().kex_method() == Kex_Algo::PSK) {
  ------------------
  |  Branch (418:20): [True: 0, False: 1.83k]
  ------------------
  419|       |            /* PSK is anonymous so no certificate/cert req message is
  420|       |               ever sent. The server may or may not send a server kex,
  421|       |               depending on if it has an identity hint for us.
  422|       |
  423|       |               (EC)DHE_PSK always sends a server key exchange for the
  424|       |               DH exchange portion, and is covered by block below
  425|       |            */
  426|       |
  427|      0|            state.set_expected_next(Handshake_Type::ServerKeyExchange);
  428|      0|            state.set_expected_next(Handshake_Type::ServerHelloDone);
  429|  1.83k|         } else if(state.ciphersuite().kex_method() != Kex_Algo::STATIC_RSA) {
  ------------------
  |  Branch (429:20): [True: 0, False: 1.83k]
  ------------------
  430|      0|            state.set_expected_next(Handshake_Type::ServerKeyExchange);
  431|  1.83k|         } else {
  432|  1.83k|            state.set_expected_next(Handshake_Type::CertificateRequest);  // optional
  433|  1.83k|            state.set_expected_next(Handshake_Type::ServerHelloDone);
  434|  1.83k|         }
  435|  1.83k|      }
  436|  1.83k|   } else if(type == Handshake_Type::Certificate) {
  ------------------
  |  Branch (436:14): [True: 0, False: 72]
  ------------------
  437|      0|      state.server_certs(new Certificate_12(contents, policy()));
  438|       |
  439|      0|      const std::vector<X509_Certificate>& server_certs = state.server_certs()->cert_chain();
  440|       |
  441|      0|      if(server_certs.empty())
  ------------------
  |  Branch (441:10): [True: 0, False: 0]
  ------------------
  442|      0|         throw TLS_Exception(Alert::HandshakeFailure, "Client: No certificates sent by server");
  443|       |
  444|       |      /*
  445|       |      If the server supports certificate status messages,
  446|       |      certificate verification happens after we receive the server hello done,
  447|       |      in case an OCSP response was also available
  448|       |      */
  449|       |
  450|      0|      X509_Certificate server_cert = server_certs[0];
  451|       |
  452|      0|      if(active_state && active_state->server_certs()) {
  ------------------
  |  Branch (452:10): [True: 0, False: 0]
  |  Branch (452:26): [True: 0, False: 0]
  ------------------
  453|      0|         X509_Certificate current_cert = active_state->server_certs()->cert_chain().at(0);
  454|       |
  455|      0|         if(current_cert != server_cert)
  ------------------
  |  Branch (455:13): [True: 0, False: 0]
  ------------------
  456|      0|            throw TLS_Exception(Alert::BadCertificate, "Server certificate changed during renegotiation");
  457|      0|      }
  458|       |
  459|      0|      auto peer_key = server_cert.subject_public_key();
  460|       |
  461|      0|      const std::string expected_key_type =
  462|      0|         state.ciphersuite().signature_used() ? state.ciphersuite().sig_algo() : "RSA";
  ------------------
  |  Branch (462:10): [True: 0, False: 0]
  ------------------
  463|       |
  464|      0|      if(peer_key->algo_name() != expected_key_type)
  ------------------
  |  Branch (464:10): [True: 0, False: 0]
  ------------------
  465|      0|         throw TLS_Exception(Alert::IllegalParameter, "Certificate key type did not match ciphersuite");
  466|       |
  467|      0|      if(!key_usage_matches_ciphersuite(server_cert.constraints(), state.ciphersuite()))
  ------------------
  |  Branch (467:10): [True: 0, False: 0]
  ------------------
  468|      0|         throw TLS_Exception(Alert::BadCertificate, "Certificate usage constraints do not allow this ciphersuite");
  469|       |
  470|      0|      state.server_public_key.reset(peer_key.release());
  471|       |
  472|      0|      if(state.ciphersuite().kex_method() != Kex_Algo::STATIC_RSA) {
  ------------------
  |  Branch (472:10): [True: 0, False: 0]
  ------------------
  473|      0|         state.set_expected_next(Handshake_Type::ServerKeyExchange);
  474|      0|      } else {
  475|      0|         state.set_expected_next(Handshake_Type::CertificateRequest);  // optional
  476|      0|         state.set_expected_next(Handshake_Type::ServerHelloDone);
  477|      0|      }
  478|       |
  479|      0|      if(state.server_hello()->supports_certificate_status_message()) {
  ------------------
  |  Branch (479:10): [True: 0, False: 0]
  ------------------
  480|      0|         state.set_expected_next(Handshake_Type::CertificateStatus);  // optional
  481|      0|      } else {
  482|      0|         try {
  483|      0|            auto trusted_CAs = m_creds->trusted_certificate_authorities("tls-client", m_info.hostname());
  484|       |
  485|      0|            callbacks().tls_verify_cert_chain(
  486|      0|               server_certs, {}, trusted_CAs, Usage_Type::TLS_SERVER_AUTH, m_info.hostname(), policy());
  487|      0|         } catch(TLS_Exception&) {
  488|      0|            throw;
  489|      0|         } catch(std::exception& e) {
  490|      0|            throw TLS_Exception(Alert::InternalError, e.what());
  491|      0|         }
  492|      0|      }
  493|     72|   } else if(type == Handshake_Type::CertificateStatus) {
  ------------------
  |  Branch (493:14): [True: 0, False: 72]
  ------------------
  494|      0|      state.server_cert_status(new Certificate_Status(contents, Connection_Side::Server));
  495|       |
  496|      0|      if(state.ciphersuite().kex_method() != Kex_Algo::STATIC_RSA) {
  ------------------
  |  Branch (496:10): [True: 0, False: 0]
  ------------------
  497|      0|         state.set_expected_next(Handshake_Type::ServerKeyExchange);
  498|      0|      } else {
  499|      0|         state.set_expected_next(Handshake_Type::CertificateRequest);  // optional
  500|      0|         state.set_expected_next(Handshake_Type::ServerHelloDone);
  501|      0|      }
  502|     72|   } else if(type == Handshake_Type::ServerKeyExchange) {
  ------------------
  |  Branch (502:14): [True: 0, False: 72]
  ------------------
  503|      0|      if(state.ciphersuite().psk_ciphersuite() == false)
  ------------------
  |  Branch (503:10): [True: 0, False: 0]
  ------------------
  504|      0|         state.set_expected_next(Handshake_Type::CertificateRequest);  // optional
  505|      0|      state.set_expected_next(Handshake_Type::ServerHelloDone);
  506|       |
  507|      0|      state.server_kex(new Server_Key_Exchange(
  508|      0|         contents, state.ciphersuite().kex_method(), state.ciphersuite().auth_method(), state.version()));
  509|       |
  510|      0|      if(state.ciphersuite().signature_used()) {
  ------------------
  |  Branch (510:10): [True: 0, False: 0]
  ------------------
  511|      0|         const Public_Key& server_key = state.get_server_public_key();
  512|       |
  513|      0|         if(!state.server_kex()->verify(server_key, state, policy())) {
  ------------------
  |  Branch (513:13): [True: 0, False: 0]
  ------------------
  514|      0|            throw TLS_Exception(Alert::DecryptError, "Bad signature on server key exchange");
  515|      0|         }
  516|      0|      }
  517|     72|   } else if(type == Handshake_Type::CertificateRequest) {
  ------------------
  |  Branch (517:14): [True: 0, False: 72]
  ------------------
  518|      0|      state.set_expected_next(Handshake_Type::ServerHelloDone);
  519|      0|      state.cert_req(new Certificate_Request_12(contents));
  520|     72|   } else if(type == Handshake_Type::ServerHelloDone) {
  ------------------
  |  Branch (520:14): [True: 0, False: 72]
  ------------------
  521|      0|      state.server_hello_done(new Server_Hello_Done(contents));
  522|       |
  523|      0|      if(state.handshake_io().have_more_data())
  ------------------
  |  Branch (523:10): [True: 0, False: 0]
  ------------------
  524|      0|         throw TLS_Exception(Alert::UnexpectedMessage, "Have data remaining in buffer after ServerHelloDone");
  525|       |
  526|      0|      if(state.server_certs() != nullptr && state.server_hello()->supports_certificate_status_message()) {
  ------------------
  |  Branch (526:10): [True: 0, False: 0]
  |  Branch (526:45): [True: 0, False: 0]
  ------------------
  527|      0|         try {
  528|      0|            auto trusted_CAs = m_creds->trusted_certificate_authorities("tls-client", m_info.hostname());
  529|       |
  530|      0|            std::vector<std::optional<OCSP::Response>> ocsp;
  531|      0|            if(state.server_cert_status() != nullptr) {
  ------------------
  |  Branch (531:16): [True: 0, False: 0]
  ------------------
  532|      0|               ocsp.emplace_back(callbacks().tls_parse_ocsp_response(state.server_cert_status()->response()));
  533|      0|            }
  534|       |
  535|      0|            callbacks().tls_verify_cert_chain(state.server_certs()->cert_chain(),
  536|      0|                                              ocsp,
  537|      0|                                              trusted_CAs,
  538|      0|                                              Usage_Type::TLS_SERVER_AUTH,
  539|      0|                                              m_info.hostname(),
  540|      0|                                              policy());
  541|      0|         } catch(TLS_Exception&) {
  542|      0|            throw;
  543|      0|         } catch(std::exception& e) {
  544|      0|            throw TLS_Exception(Alert::InternalError, e.what());
  545|      0|         }
  546|      0|      }
  547|       |
  548|      0|      if(state.received_handshake_msg(Handshake_Type::CertificateRequest)) {
  ------------------
  |  Branch (548:10): [True: 0, False: 0]
  ------------------
  549|      0|         const auto& types = state.cert_req()->acceptable_cert_types();
  550|       |
  551|      0|         std::vector<X509_Certificate> client_certs =
  552|      0|            m_creds->find_cert_chain(types, {}, state.cert_req()->acceptable_CAs(), "tls-client", m_info.hostname());
  553|       |
  554|      0|         state.client_certs(new Certificate_12(state.handshake_io(), state.hash(), client_certs));
  555|      0|      }
  556|       |
  557|      0|      state.client_kex(new Client_Key_Exchange(
  558|      0|         state.handshake_io(), state, policy(), *m_creds, state.server_public_key.get(), m_info.hostname(), rng()));
  559|       |
  560|      0|      state.compute_session_keys();
  561|       |
  562|      0|      if(state.received_handshake_msg(Handshake_Type::CertificateRequest) && !state.client_certs()->empty()) {
  ------------------
  |  Branch (562:10): [True: 0, False: 0]
  |  Branch (562:78): [True: 0, False: 0]
  ------------------
  563|      0|         auto private_key =
  564|      0|            m_creds->private_key_for(state.client_certs()->cert_chain()[0], "tls-client", m_info.hostname());
  565|       |
  566|      0|         if(!private_key)
  ------------------
  |  Branch (566:13): [True: 0, False: 0]
  ------------------
  567|      0|            throw TLS_Exception(Alert::InternalError, "Failed to get private key for signing");
  568|       |
  569|      0|         state.client_verify(
  570|      0|            new Certificate_Verify_12(state.handshake_io(), state, policy(), rng(), private_key.get()));
  571|      0|      }
  572|       |
  573|      0|      state.handshake_io().send(Change_Cipher_Spec());
  574|       |
  575|      0|      change_cipher_spec_writer(Connection_Side::Client);
  576|       |
  577|      0|      state.client_finished(new Finished_12(state.handshake_io(), state, Connection_Side::Client));
  578|       |
  579|      0|      if(state.server_hello()->supports_session_ticket())
  ------------------
  |  Branch (579:10): [True: 0, False: 0]
  ------------------
  580|      0|         state.set_expected_next(Handshake_Type::NewSessionTicket);
  581|      0|      else
  582|      0|         state.set_expected_next(Handshake_Type::HandshakeCCS);
  583|     72|   } else if(type == Handshake_Type::NewSessionTicket) {
  ------------------
  |  Branch (583:14): [True: 0, False: 72]
  ------------------
  584|      0|      state.new_session_ticket(new New_Session_Ticket_12(contents));
  585|       |
  586|      0|      state.set_expected_next(Handshake_Type::HandshakeCCS);
  587|     72|   } else if(type == Handshake_Type::HandshakeCCS) {
  ------------------
  |  Branch (587:14): [True: 0, False: 72]
  ------------------
  588|      0|      state.set_expected_next(Handshake_Type::Finished);
  589|       |
  590|      0|      change_cipher_spec_reader(Connection_Side::Client);
  591|     72|   } else if(type == Handshake_Type::Finished) {
  ------------------
  |  Branch (591:14): [True: 0, False: 72]
  ------------------
  592|      0|      if(state.handshake_io().have_more_data())
  ------------------
  |  Branch (592:10): [True: 0, False: 0]
  ------------------
  593|      0|         throw TLS_Exception(Alert::UnexpectedMessage, "Have data remaining in buffer after Finished");
  594|       |
  595|      0|      state.server_finished(new Finished_12(contents));
  596|       |
  597|      0|      if(!state.server_finished()->verify(state, Connection_Side::Server))
  ------------------
  |  Branch (597:10): [True: 0, False: 0]
  ------------------
  598|      0|         throw TLS_Exception(Alert::DecryptError, "Finished message didn't verify");
  599|       |
  600|      0|      state.hash().update(state.handshake_io().format(contents, type));
  601|       |
  602|      0|      if(!state.client_finished()) {
  ------------------
  |  Branch (602:10): [True: 0, False: 0]
  ------------------
  603|       |         // session resume case
  604|      0|         state.handshake_io().send(Change_Cipher_Spec());
  605|      0|         change_cipher_spec_writer(Connection_Side::Client);
  606|      0|         state.client_finished(new Finished_12(state.handshake_io(), state, Connection_Side::Client));
  607|      0|      }
  608|       |
  609|      0|      Session session_info(state.session_keys().master_secret(),
  610|      0|                           state.server_hello()->legacy_version(),
  611|      0|                           state.server_hello()->ciphersuite(),
  612|      0|                           Connection_Side::Client,
  613|      0|                           state.server_hello()->supports_extended_master_secret(),
  614|      0|                           state.server_hello()->supports_encrypt_then_mac(),
  615|      0|                           get_peer_cert_chain(state),
  616|      0|                           m_info,
  617|      0|                           state.server_hello()->srtp_profile(),
  618|      0|                           callbacks().tls_current_timestamp(),
  619|       |
  620|       |                           // Session Tickets (as defined in RFC 5077) contain a lifetime_hint,
  621|       |                           // sessions identified via a Session_ID do not.
  622|      0|                           ((state.new_session_ticket()) ? state.new_session_ticket()->ticket_lifetime_hint()
  ------------------
  |  Branch (622:29): [True: 0, False: 0]
  ------------------
  623|      0|                                                         : std::chrono::seconds::max()));
  624|       |
  625|       |      // RFC 5077 3.4
  626|       |      //    If the client receives a session ticket from the server, then it
  627|       |      //    discards any Session ID that was sent in the ServerHello.
  628|      0|      const auto handle = [&]() -> std::optional<Session_Handle> {
  629|      0|         if(const auto& session_ticket = state.session_ticket(); !session_ticket.empty()) {
  630|      0|            return session_ticket;
  631|      0|         } else if(const auto& session_id = state.server_hello()->session_id(); !session_id.empty()) {
  632|      0|            return session_id;
  633|      0|         } else {
  634|      0|            return std::nullopt;
  635|      0|         }
  636|      0|      }();
  637|       |
  638|       |      // Give the application a chance for a final veto before fully
  639|       |      // establishing the connection.
  640|      0|      callbacks().tls_session_established([&] {
  641|      0|         Session_Summary summary(session_info, state.is_a_resumption());
  642|      0|         summary.set_session_id(state.server_hello()->session_id());
  643|      0|         if(auto nst = state.new_session_ticket()) {
  644|      0|            summary.set_session_ticket(nst->ticket());
  645|      0|         }
  646|      0|         return summary;
  647|      0|      }());
  648|       |
  649|      0|      if(handle.has_value()) {
  ------------------
  |  Branch (649:10): [True: 0, False: 0]
  ------------------
  650|      0|         const bool should_save = callbacks().tls_should_persist_resumption_information(session_info);
  651|       |
  652|       |         // RFC 5077 3.3
  653|       |         //    If the server successfully verifies the client's ticket, then it
  654|       |         //    MAY renew the ticket by including a NewSessionTicket handshake
  655|       |         //    message after the ServerHello in the abbreviated handshake. The
  656|       |         //    client should start using the new ticket as soon as possible
  657|       |         //    after it verifies the server's Finished message for new
  658|       |         //    connections.
  659|      0|         if(state.is_a_resumption() && !state.client_hello()->session_ticket().empty() && handle->is_ticket() &&
  ------------------
  |  Branch (659:13): [True: 0, False: 0]
  |  Branch (659:13): [True: 0, False: 0]
  |  Branch (659:40): [True: 0, False: 0]
  |  Branch (659:91): [True: 0, False: 0]
  ------------------
  660|      0|            should_save) {
  ------------------
  |  Branch (660:13): [True: 0, False: 0]
  ------------------
  661|       |            // renew the session ticket by removing the one we used to establish
  662|       |            // this connection and replace it with the one we just received
  663|      0|            session_manager().remove(state.client_hello()->session_ticket());
  664|      0|            session_manager().store(session_info, handle.value());
  665|      0|         }
  666|       |
  667|      0|         if(!state.is_a_resumption()) {
  ------------------
  |  Branch (667:13): [True: 0, False: 0]
  ------------------
  668|      0|            if(should_save)
  ------------------
  |  Branch (668:16): [True: 0, False: 0]
  ------------------
  669|      0|               session_manager().store(session_info, handle.value());
  670|      0|            else
  671|      0|               session_manager().remove(handle.value());
  672|      0|         }
  673|      0|      }
  674|       |
  675|      0|      activate_session();
  676|      0|   } else
  677|     72|      throw Unexpected_Message("Unknown handshake message received");
  678|  2.03k|}
tls_client_impl_12.cpp:_ZN5Botan3TLS12_GLOBAL__N_125Client_Handshake_State_12C2ENSt3__110unique_ptrINS0_12Handshake_IOENS3_14default_deleteIS5_EEEERNS0_9CallbacksE:
   28|  3.66k|            Handshake_State(std::move(io), cb), m_is_reneg(false) {}

_ZNK5Botan3TLS19Stream_Handshake_IO22initial_record_versionEv:
   36|  3.66k|Protocol_Version Stream_Handshake_IO::initial_record_version() const { return Protocol_Version::TLS_V12; }
_ZN5Botan3TLS19Stream_Handshake_IO10add_recordEPKhmNS0_11Record_TypeEm:
   41|  5.43k|                                     uint64_t /*sequence_number*/) {
   42|  5.43k|   if(record_type == Record_Type::Handshake) {
  ------------------
  |  Branch (42:7): [True: 4.91k, False: 519]
  ------------------
   43|  4.91k|      m_queue.insert(m_queue.end(), record, record + record_len);
   44|  4.91k|   } else if(record_type == Record_Type::ChangeCipherSpec) {
  ------------------
  |  Branch (44:14): [True: 519, False: 0]
  ------------------
   45|    519|      if(record_len != 1 || record[0] != 1) {
  ------------------
  |  Branch (45:10): [True: 15, False: 504]
  |  Branch (45:29): [True: 19, False: 485]
  ------------------
   46|     34|         throw Decoding_Error("Invalid ChangeCipherSpec");
   47|     34|      }
   48|       |
   49|       |      // Pretend it's a regular handshake message of zero length
   50|    485|      const uint8_t ccs_hs[] = {static_cast<uint8_t>(Handshake_Type::HandshakeCCS), 0, 0, 0};
   51|    485|      m_queue.insert(m_queue.end(), ccs_hs, ccs_hs + sizeof(ccs_hs));
   52|    485|   } else {
   53|      0|      throw Decoding_Error("Unknown message type " + std::to_string(static_cast<size_t>(record_type)) +
   54|      0|                           " in handshake processing");
   55|      0|   }
   56|  5.43k|}
_ZN5Botan3TLS19Stream_Handshake_IO15get_next_recordEb:
   58|  5.39k|std::pair<Handshake_Type, std::vector<uint8_t>> Stream_Handshake_IO::get_next_record(bool /*expecting_ccs*/) {
   59|  5.39k|   if(m_queue.size() >= 4) {
  ------------------
  |  Branch (59:7): [True: 3.94k, False: 1.45k]
  ------------------
   60|  3.94k|      const size_t length = 4 + make_uint32(0, m_queue[1], m_queue[2], m_queue[3]);
   61|       |
   62|  3.94k|      if(m_queue.size() >= length) {
  ------------------
  |  Branch (62:10): [True: 2.03k, False: 1.91k]
  ------------------
   63|  2.03k|         Handshake_Type type = static_cast<Handshake_Type>(m_queue[0]);
   64|       |
   65|  2.03k|         if(type == Handshake_Type::None) {
  ------------------
  |  Branch (65:13): [True: 2, False: 2.03k]
  ------------------
   66|      2|            throw Decoding_Error("Invalid handshake message type");
   67|      2|         }
   68|       |
   69|  2.03k|         std::vector<uint8_t> contents(m_queue.begin() + 4, m_queue.begin() + length);
   70|       |
   71|  2.03k|         m_queue.erase(m_queue.begin(), m_queue.begin() + length);
   72|       |
   73|  2.03k|         return std::make_pair(type, contents);
   74|  2.03k|      }
   75|  3.94k|   }
   76|       |
   77|  3.36k|   return std::make_pair(Handshake_Type::None, std::vector<uint8_t>());
   78|  5.39k|}
_ZNK5Botan3TLS19Stream_Handshake_IO6formatERKNSt3__16vectorIhNS2_9allocatorIhEEEENS0_14Handshake_TypeE:
   80|  4.45k|std::vector<uint8_t> Stream_Handshake_IO::format(const std::vector<uint8_t>& msg, Handshake_Type type) const {
   81|  4.45k|   std::vector<uint8_t> send_buf(4 + msg.size());
   82|       |
   83|  4.45k|   const size_t buf_size = msg.size();
   84|       |
   85|  4.45k|   send_buf[0] = static_cast<uint8_t>(type);
   86|       |
   87|  4.45k|   store_be24(&send_buf[1], buf_size);
   88|       |
   89|  4.45k|   if(!msg.empty()) {
  ------------------
  |  Branch (89:7): [True: 4.45k, False: 3]
  ------------------
   90|  4.45k|      copy_mem(&send_buf[4], msg.data(), msg.size());
   91|  4.45k|   }
   92|       |
   93|  4.45k|   return send_buf;
   94|  4.45k|}
_ZN5Botan3TLS19Stream_Handshake_IO4sendERKNS0_17Handshake_MessageE:
  100|  2.50k|std::vector<uint8_t> Stream_Handshake_IO::send(const Handshake_Message& msg) {
  101|  2.50k|   const std::vector<uint8_t> msg_bits = msg.serialize();
  102|       |
  103|  2.50k|   if(msg.type() == Handshake_Type::HandshakeCCS) {
  ------------------
  |  Branch (103:7): [True: 0, False: 2.50k]
  ------------------
  104|      0|      m_send_hs(Record_Type::ChangeCipherSpec, msg_bits);
  105|      0|      return std::vector<uint8_t>();  // not included in handshake hashes
  106|      0|   }
  107|       |
  108|  2.50k|   auto buf = format(msg_bits, msg.wire_type());
  109|  2.50k|   m_send_hs(Record_Type::Handshake, buf);
  110|  2.50k|   return buf;
  111|  2.50k|}
tls_handshake_io.cpp:_ZN5Botan3TLS12_GLOBAL__N_110store_be24EPhm:
   23|  4.45k|void store_be24(uint8_t out[3], size_t val) {
   24|  4.45k|   out[0] = get_byte<1>(static_cast<uint32_t>(val));
   25|  4.45k|   out[1] = get_byte<2>(static_cast<uint32_t>(val));
   26|  4.45k|   out[2] = get_byte<3>(static_cast<uint32_t>(val));
   27|  4.45k|}

_ZN5Botan3TLS24handshake_type_to_stringENS0_14Handshake_TypeE:
   21|    112|const char* handshake_type_to_string(Handshake_Type type) {
   22|    112|   switch(type) {
  ------------------
  |  Branch (22:11): [True: 0, False: 112]
  ------------------
   23|      2|      case Handshake_Type::HelloVerifyRequest:
  ------------------
  |  Branch (23:7): [True: 2, False: 110]
  ------------------
   24|      2|         return "hello_verify_request";
   25|       |
   26|     19|      case Handshake_Type::HelloRequest:
  ------------------
  |  Branch (26:7): [True: 19, False: 93]
  ------------------
   27|     19|         return "hello_request";
   28|       |
   29|      2|      case Handshake_Type::ClientHello:
  ------------------
  |  Branch (29:7): [True: 2, False: 110]
  ------------------
   30|      2|         return "client_hello";
   31|       |
   32|     55|      case Handshake_Type::ServerHello:
  ------------------
  |  Branch (32:7): [True: 55, False: 57]
  ------------------
   33|     55|         return "server_hello";
   34|       |
   35|      2|      case Handshake_Type::HelloRetryRequest:
  ------------------
  |  Branch (35:7): [True: 2, False: 110]
  ------------------
   36|      2|         return "hello_retry_request";
   37|       |
   38|      4|      case Handshake_Type::Certificate:
  ------------------
  |  Branch (38:7): [True: 4, False: 108]
  ------------------
   39|      4|         return "certificate";
   40|       |
   41|      2|      case Handshake_Type::CertificateUrl:
  ------------------
  |  Branch (41:7): [True: 2, False: 110]
  ------------------
   42|      2|         return "certificate_url";
   43|       |
   44|      2|      case Handshake_Type::CertificateStatus:
  ------------------
  |  Branch (44:7): [True: 2, False: 110]
  ------------------
   45|      2|         return "certificate_status";
   46|       |
   47|      1|      case Handshake_Type::ServerKeyExchange:
  ------------------
  |  Branch (47:7): [True: 1, False: 111]
  ------------------
   48|      1|         return "server_key_exchange";
   49|       |
   50|      1|      case Handshake_Type::CertificateRequest:
  ------------------
  |  Branch (50:7): [True: 1, False: 111]
  ------------------
   51|      1|         return "certificate_request";
   52|       |
   53|      3|      case Handshake_Type::ServerHelloDone:
  ------------------
  |  Branch (53:7): [True: 3, False: 109]
  ------------------
   54|      3|         return "server_hello_done";
   55|       |
   56|      1|      case Handshake_Type::CertificateVerify:
  ------------------
  |  Branch (56:7): [True: 1, False: 111]
  ------------------
   57|      1|         return "certificate_verify";
   58|       |
   59|      4|      case Handshake_Type::ClientKeyExchange:
  ------------------
  |  Branch (59:7): [True: 4, False: 108]
  ------------------
   60|      4|         return "client_key_exchange";
   61|       |
   62|      1|      case Handshake_Type::NewSessionTicket:
  ------------------
  |  Branch (62:7): [True: 1, False: 111]
  ------------------
   63|      1|         return "new_session_ticket";
   64|       |
   65|      4|      case Handshake_Type::HandshakeCCS:
  ------------------
  |  Branch (65:7): [True: 4, False: 108]
  ------------------
   66|      4|         return "change_cipher_spec";
   67|       |
   68|      1|      case Handshake_Type::Finished:
  ------------------
  |  Branch (68:7): [True: 1, False: 111]
  ------------------
   69|      1|         return "finished";
   70|       |
   71|      2|      case Handshake_Type::EndOfEarlyData:
  ------------------
  |  Branch (71:7): [True: 2, False: 110]
  ------------------
   72|      2|         return "end_of_early_data";
   73|       |
   74|      4|      case Handshake_Type::EncryptedExtensions:
  ------------------
  |  Branch (74:7): [True: 4, False: 108]
  ------------------
   75|      4|         return "encrypted_extensions";
   76|       |
   77|      2|      case Handshake_Type::KeyUpdate:
  ------------------
  |  Branch (77:7): [True: 2, False: 110]
  ------------------
   78|      2|         return "key_update";
   79|       |
   80|      0|      case Handshake_Type::None:
  ------------------
  |  Branch (80:7): [True: 0, False: 112]
  ------------------
   81|      0|         return "invalid";
   82|    112|   }
   83|       |
   84|      0|   throw TLS_Exception(Alert::UnexpectedMessage,
   85|      0|                       "Unknown TLS handshake message type " + std::to_string(static_cast<size_t>(type)));
   86|    112|}
_ZN5Botan3TLS15Handshake_StateD2Ev:
   91|  3.66k|Handshake_State::~Handshake_State() = default;
_ZN5Botan3TLS15Handshake_StateC2ENSt3__110unique_ptrINS0_12Handshake_IOENS2_14default_deleteIS4_EEEERNS0_9CallbacksE:
   94|  3.66k|      m_callbacks(cb), m_handshake_io(std::move(io)), m_version(m_handshake_io->initial_record_version()) {}
_ZN5Botan3TLS15Handshake_State12note_messageERKNS0_17Handshake_MessageE:
   96|  2.62k|void Handshake_State::note_message(const Handshake_Message& msg) { m_callbacks.tls_inspect_handshake_msg(msg); }
_ZN5Botan3TLS15Handshake_State12client_helloEPNS0_15Client_Hello_12E:
  107|  2.50k|void Handshake_State::client_hello(Client_Hello_12* client_hello) {
  108|  2.50k|   if(client_hello == nullptr) {
  ------------------
  |  Branch (108:7): [True: 0, False: 2.50k]
  ------------------
  109|      0|      m_client_hello.reset();
  110|      0|      hash().reset();
  111|  2.50k|   } else {
  112|  2.50k|      m_client_hello.reset(client_hello);
  113|  2.50k|      note_message(*m_client_hello);
  114|  2.50k|   }
  115|  2.50k|}
_ZN5Botan3TLS15Handshake_State12server_helloEPNS0_15Server_Hello_12E:
  117|    129|void Handshake_State::server_hello(Server_Hello_12* server_hello) {
  118|    129|   m_server_hello.reset(server_hello);
  119|    129|   m_ciphersuite = Ciphersuite::by_id(m_server_hello->ciphersuite());
  120|    129|   note_message(*m_server_hello);
  121|    129|}
_ZN5Botan3TLS15Handshake_State21confirm_transition_toENS0_14Handshake_TypeE:
  200|  2.03k|void Handshake_State::confirm_transition_to(Handshake_Type handshake_msg) {
  201|  2.03k|   m_transitions.confirm_transition_to(handshake_msg);
  202|  2.03k|}
_ZN5Botan3TLS15Handshake_State17set_expected_nextENS0_14Handshake_TypeE:
  204|  2.50k|void Handshake_State::set_expected_next(Handshake_Type handshake_msg) {
  205|  2.50k|   m_transitions.set_expected_next(handshake_msg);
  206|  2.50k|}
_ZN5Botan3TLS15Handshake_State22get_next_handshake_msgEv:
  212|  5.39k|std::pair<Handshake_Type, std::vector<uint8_t>> Handshake_State::get_next_handshake_msg() {
  213|  5.39k|   return m_handshake_io->get_next_record(m_transitions.change_cipher_spec_expected());
  214|  5.39k|}

_ZN5Botan3TLS24write_unencrypted_recordERNSt3__16vectorIhNS_16secure_allocatorIhEEEENS0_11Record_TypeENS0_16Protocol_VersionEmPKhm:
  191|  4.70k|                              size_t message_len) {
  192|  4.70k|   if(record_type == Record_Type::ApplicationData) {
  ------------------
  |  Branch (192:7): [True: 0, False: 4.70k]
  ------------------
  193|      0|      throw Internal_Error("Writing an unencrypted TLS application data record");
  194|      0|   }
  195|  4.70k|   write_record_header(output, record_type, version, record_sequence);
  196|  4.70k|   append_u16_len(output, message_len);
  197|  4.70k|   output.insert(output.end(), message, message + message_len);
  198|  4.70k|}
_ZN5Botan3TLS11read_recordEbRNSt3__16vectorIhNS_16secure_allocatorIhEEEEPKhmRmS6_PNS0_27Connection_Sequence_NumbersERKNS1_8functionIFNS1_10shared_ptrINS0_23Connection_Cipher_StateEEEtEEEb:
  499|  8.39k|                          bool allow_epoch0_restart) {
  500|  8.39k|   if(is_datagram) {
  ------------------
  |  Branch (500:7): [True: 0, False: 8.39k]
  ------------------
  501|      0|      return read_dtls_record(
  502|      0|         readbuf, input, input_len, consumed, recbuf, sequence_numbers, get_cipherstate, allow_epoch0_restart);
  503|  8.39k|   } else {
  504|  8.39k|      return read_tls_record(readbuf, input, input_len, consumed, recbuf, sequence_numbers, get_cipherstate);
  505|  8.39k|   }
  506|  8.39k|}
tls_record.cpp:_ZN5Botan3TLS12_GLOBAL__N_119write_record_headerERNSt3__16vectorIhNS_16secure_allocatorIhEEEENS0_11Record_TypeENS0_16Protocol_VersionEm:
  170|  4.70k|                         uint64_t record_sequence) {
  171|  4.70k|   output.clear();
  172|       |
  173|  4.70k|   output.push_back(static_cast<uint8_t>(record_type));
  174|  4.70k|   output.push_back(version.major_version());
  175|  4.70k|   output.push_back(version.minor_version());
  176|       |
  177|  4.70k|   if(version.is_datagram_protocol()) {
  ------------------
  |  Branch (177:7): [True: 0, False: 4.70k]
  ------------------
  178|      0|      for(size_t i = 0; i != 8; ++i) {
  ------------------
  |  Branch (178:25): [True: 0, False: 0]
  ------------------
  179|      0|         output.push_back(get_byte_var(i, record_sequence));
  180|      0|      }
  181|      0|   }
  182|  4.70k|}
tls_record.cpp:_ZN5Botan3TLS12_GLOBAL__N_114append_u16_lenERNSt3__16vectorIhNS_16secure_allocatorIhEEEEm:
  160|  4.70k|inline void append_u16_len(secure_vector<uint8_t>& output, size_t len_field) {
  161|  4.70k|   const uint16_t len16 = static_cast<uint16_t>(len_field);
  162|  4.70k|   BOTAN_ASSERT_EQUAL(len_field, len16, "No truncation");
  ------------------
  |  |   69|  4.70k|   do {                                                                                                \
  |  |   70|  4.70k|      if((expr1) != (expr2))                                                                           \
  |  |  ------------------
  |  |  |  Branch (70:10): [True: 0, False: 4.70k]
  |  |  ------------------
  |  |   71|  4.70k|         Botan::assertion_failure(#expr1 " == " #expr2, assertion_made, __func__, __FILE__, __LINE__); \
  |  |   72|  4.70k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (72:12): [Folded - Ignored]
  |  |  ------------------
  ------------------
  163|  4.70k|   output.push_back(get_byte<0>(len16));
  164|  4.70k|   output.push_back(get_byte<1>(len16));
  165|  4.70k|}
tls_record.cpp:_ZN5Botan3TLS12_GLOBAL__N_114fill_buffer_toERNSt3__16vectorIhNS_16secure_allocatorIhEEEERPKhRmSB_m:
  243|  16.6k|   secure_vector<uint8_t>& readbuf, const uint8_t*& input, size_t& input_size, size_t& input_consumed, size_t desired) {
  244|  16.6k|   if(readbuf.size() >= desired) {
  ------------------
  |  Branch (244:7): [True: 0, False: 16.6k]
  ------------------
  245|      0|      return 0;  // already have it
  246|      0|   }
  247|       |
  248|  16.6k|   const size_t taken = std::min(input_size, desired - readbuf.size());
  249|       |
  250|  16.6k|   readbuf.insert(readbuf.end(), input, input + taken);
  251|  16.6k|   input_consumed += taken;
  252|  16.6k|   input_size -= taken;
  253|  16.6k|   input += taken;
  254|       |
  255|  16.6k|   return (desired - readbuf.size());  // how many bytes do we still need?
  256|  16.6k|}
tls_record.cpp:_ZN5Botan3TLS12_GLOBAL__N_115read_tls_recordERNSt3__16vectorIhNS_16secure_allocatorIhEEEEPKhmRmS7_PNS0_27Connection_Sequence_NumbersERKNS2_8functionIFNS2_10shared_ptrINS0_23Connection_Cipher_StateEEEtEEE:
  299|  8.39k|                              const get_cipherstate_fn& get_cipherstate) {
  300|  8.39k|   if(readbuf.size() < TLS_HEADER_SIZE)  // header incomplete?
  ------------------
  |  Branch (300:7): [True: 8.39k, False: 0]
  ------------------
  301|  8.39k|   {
  302|  8.39k|      if(size_t needed = fill_buffer_to(readbuf, input, input_len, consumed, TLS_HEADER_SIZE)) {
  ------------------
  |  Branch (302:17): [True: 29, False: 8.36k]
  ------------------
  303|     29|         return Record_Header(needed);
  304|     29|      }
  305|       |
  306|  8.36k|      BOTAN_ASSERT_EQUAL(readbuf.size(), TLS_HEADER_SIZE, "Have an entire header");
  ------------------
  |  |   69|  8.36k|   do {                                                                                                \
  |  |   70|  8.36k|      if((expr1) != (expr2))                                                                           \
  |  |  ------------------
  |  |  |  Branch (70:10): [True: 0, False: 8.36k]
  |  |  ------------------
  |  |   71|  8.36k|         Botan::assertion_failure(#expr1 " == " #expr2, assertion_made, __func__, __FILE__, __LINE__); \
  |  |   72|  8.36k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (72:12): [Folded - Ignored]
  |  |  ------------------
  ------------------
  307|  8.36k|   }
  308|       |
  309|       |   /*
  310|       |   Verify that the record type and record version are within some expected
  311|       |   range, so we can quickly reject totally invalid packets.
  312|       |
  313|       |   The version check is a little hacky but given how TLS 1.3 versioning works
  314|       |   this is probably safe
  315|       |
  316|       |   - The first byte is the record version which in TLS 1.2 is always in [20..23)
  317|       |   - The second byte is the TLS major version which is effectively fossilized at 3
  318|       |   - The third byte is the TLS minor version which (due to TLS 1.3 versioning changes)
  319|       |     will never be more than 3 (signifying TLS 1.2)
  320|       |   */
  321|  8.36k|   const bool bad_record_type = readbuf[0] < 20 || readbuf[0] > 23;
  ------------------
  |  Branch (321:33): [True: 16, False: 8.34k]
  |  Branch (321:52): [True: 55, False: 8.29k]
  ------------------
  322|  8.36k|   const bool bad_record_version = readbuf[1] != 3 || readbuf[2] >= 4;
  ------------------
  |  Branch (322:36): [True: 61, False: 8.30k]
  |  Branch (322:55): [True: 11, False: 8.29k]
  ------------------
  323|       |
  324|  8.36k|   if(bad_record_type || bad_record_version) {
  ------------------
  |  Branch (324:7): [True: 71, False: 8.29k]
  |  Branch (324:26): [True: 8, False: 8.28k]
  ------------------
  325|       |      // We know we read up to at least the 5 byte TLS header
  326|     79|      const std::string first5 = std::string(reinterpret_cast<const char*>(readbuf.data()), 5);
  327|       |
  328|     79|      if(first5 == "GET /" || first5 == "PUT /" || first5 == "POST " || first5 == "HEAD ") {
  ------------------
  |  Branch (328:10): [True: 1, False: 78]
  |  Branch (328:31): [True: 1, False: 77]
  |  Branch (328:52): [True: 2, False: 75]
  |  Branch (328:73): [True: 1, False: 74]
  ------------------
  329|      5|         throw TLS_Exception(Alert::ProtocolVersion, "Client sent plaintext HTTP request instead of TLS handshake");
  330|      5|      }
  331|       |
  332|     74|      if(first5 == "CONNE") {
  ------------------
  |  Branch (332:10): [True: 1, False: 73]
  ------------------
  333|      1|         throw TLS_Exception(Alert::ProtocolVersion,
  334|      1|                             "Client sent plaintext HTTP proxy CONNECT request instead of TLS handshake");
  335|      1|      }
  336|       |
  337|     73|      std::ostringstream oss;
  338|     73|      oss << "TLS record ";
  339|     73|      if(bad_record_type) {
  ------------------
  |  Branch (339:10): [True: 65, False: 8]
  ------------------
  340|     65|         oss << "type";
  341|     65|      } else {
  342|      8|         oss << "version";
  343|      8|      }
  344|     73|      oss << " had unexpected value";
  345|       |
  346|     73|      throw TLS_Exception(Alert::ProtocolVersion, oss.str());
  347|     74|   }
  348|       |
  349|  8.28k|   const Protocol_Version version(readbuf[1], readbuf[2]);
  350|       |
  351|  8.28k|   if(version.is_datagram_protocol()) {
  ------------------
  |  Branch (351:7): [True: 0, False: 8.28k]
  ------------------
  352|      0|      throw TLS_Exception(Alert::ProtocolVersion, "Expected TLS but got a record with DTLS version");
  353|      0|   }
  354|       |
  355|  8.28k|   const size_t record_size = make_uint16(readbuf[TLS_HEADER_SIZE - 2], readbuf[TLS_HEADER_SIZE - 1]);
  356|       |
  357|  8.28k|   if(record_size > MAX_CIPHERTEXT_SIZE) {
  ------------------
  |  Branch (357:7): [True: 5, False: 8.28k]
  ------------------
  358|      5|      throw TLS_Exception(Alert::RecordOverflow, "Received a record that exceeds maximum size");
  359|      5|   }
  360|       |
  361|  8.28k|   if(record_size == 0) {
  ------------------
  |  Branch (361:7): [True: 6, False: 8.27k]
  ------------------
  362|      6|      throw TLS_Exception(Alert::DecodeError, "Received a completely empty record");
  363|      6|   }
  364|       |
  365|  8.27k|   if(size_t needed = fill_buffer_to(readbuf, input, input_len, consumed, TLS_HEADER_SIZE + record_size)) {
  ------------------
  |  Branch (365:14): [True: 60, False: 8.21k]
  ------------------
  366|     60|      return Record_Header(needed);
  367|     60|   }
  368|       |
  369|  8.21k|   BOTAN_ASSERT_EQUAL(static_cast<size_t>(TLS_HEADER_SIZE) + record_size, readbuf.size(), "Have the full record");
  ------------------
  |  |   69|  8.21k|   do {                                                                                                \
  |  |   70|  8.21k|      if((expr1) != (expr2))                                                                           \
  |  |  ------------------
  |  |  |  Branch (70:10): [True: 0, False: 8.21k]
  |  |  ------------------
  |  |   71|  8.21k|         Botan::assertion_failure(#expr1 " == " #expr2, assertion_made, __func__, __FILE__, __LINE__); \
  |  |   72|  8.21k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (72:12): [Folded - Ignored]
  |  |  ------------------
  ------------------
  370|       |
  371|  8.21k|   const Record_Type type = static_cast<Record_Type>(readbuf[0]);
  372|       |
  373|  8.21k|   uint16_t epoch = 0;
  374|       |
  375|  8.21k|   uint64_t sequence = 0;
  376|  8.21k|   if(sequence_numbers) {
  ------------------
  |  Branch (376:7): [True: 8.21k, False: 0]
  ------------------
  377|  8.21k|      sequence = sequence_numbers->next_read_sequence();
  378|  8.21k|      epoch = sequence_numbers->current_read_epoch();
  379|  8.21k|   } else {
  380|       |      // server initial handshake case
  381|      0|      epoch = 0;
  382|      0|   }
  383|       |
  384|  8.21k|   if(epoch == 0)  // Unencrypted initial handshake
  ------------------
  |  Branch (384:7): [True: 8.21k, False: 0]
  ------------------
  385|  8.21k|   {
  386|  8.21k|      recbuf.assign(readbuf.begin() + TLS_HEADER_SIZE, readbuf.begin() + TLS_HEADER_SIZE + record_size);
  387|  8.21k|      readbuf.clear();
  388|  8.21k|      return Record_Header(sequence, version, type);
  389|  8.21k|   }
  390|       |
  391|       |   // Otherwise, decrypt, check MAC, return plaintext
  392|      0|   auto cs = get_cipherstate(epoch);
  393|       |
  394|      0|   BOTAN_ASSERT(cs, "Have cipherstate for this epoch");
  ------------------
  |  |   51|      0|   do {                                                                                 \
  |  |   52|      0|      if(!(expr))                                                                       \
  |  |  ------------------
  |  |  |  Branch (52:10): [True: 0, False: 0]
  |  |  ------------------
  |  |   53|      0|         Botan::assertion_failure(#expr, assertion_made, __func__, __FILE__, __LINE__); \
  |  |   54|      0|   } while(0)
  |  |  ------------------
  |  |  |  Branch (54:12): [Folded - Ignored]
  |  |  ------------------
  ------------------
  395|       |
  396|      0|   decrypt_record(recbuf, &readbuf[TLS_HEADER_SIZE], record_size, sequence, version, type, *cs);
  397|       |
  398|      0|   if(sequence_numbers) {
  ------------------
  |  Branch (398:7): [True: 0, False: 0]
  ------------------
  399|      0|      sequence_numbers->read_accept(sequence);
  400|      0|   }
  401|       |
  402|      0|   readbuf.clear();
  403|      0|   return Record_Header(sequence, version, type);
  404|  8.21k|}

_ZN5Botan3TLS9Key_ShareC2ERNS0_15TLS_Data_ReaderEtNS0_14Handshake_TypeE:
  391|     24|Key_Share::Key_Share(TLS_Data_Reader& reader, uint16_t extension_size, Handshake_Type message_type) {
  392|     24|   if(message_type == Handshake_Type::ClientHello) {
  ------------------
  |  Branch (392:7): [True: 0, False: 24]
  ------------------
  393|      0|      m_impl = std::make_unique<Key_Share_Impl>(Key_Share_ClientHello(reader, extension_size));
  394|     24|   } else if(message_type == Handshake_Type::HelloRetryRequest)  // Connection_Side::Server
  ------------------
  |  Branch (394:14): [True: 4, False: 20]
  ------------------
  395|      4|   {
  396|      4|      m_impl = std::make_unique<Key_Share_Impl>(Key_Share_HelloRetryRequest(reader, extension_size));
  397|     20|   } else if(message_type == Handshake_Type::ServerHello)  // Connection_Side::Server
  ------------------
  |  Branch (397:14): [True: 20, False: 0]
  ------------------
  398|     20|   {
  399|     20|      m_impl = std::make_unique<Key_Share_Impl>(Key_Share_ServerHello(reader, extension_size));
  400|     20|   } else {
  401|      0|      throw Invalid_Argument(std::string("cannot create a Key_Share extension for message of type: ") +
  402|      0|                             handshake_type_to_string(message_type));
  403|      0|   }
  404|     24|}
_ZN5Botan3TLS9Key_ShareD2Ev:
  418|     19|Key_Share::~Key_Share() = default;
tls_extensions_key_share.cpp:_ZN5Botan3TLS12_GLOBAL__N_115Key_Share_EntryC2ERNS0_15TLS_Data_ReaderE:
   38|     20|      Key_Share_Entry(TLS_Data_Reader& reader) {
   39|       |         // TODO check that the group actually exists before casting...
   40|     20|         m_group = static_cast<Named_Group>(reader.get_uint16_t());
   41|     20|         m_key_exchange = reader.get_tls_length_value(2);
   42|     20|      }
tls_extensions_key_share.cpp:_ZN5Botan3TLS12_GLOBAL__N_127Key_Share_HelloRetryRequestC2ERNS0_15TLS_Data_ReaderEt:
  340|      4|      Key_Share_HelloRetryRequest(TLS_Data_Reader& reader, uint16_t extension_size) {
  341|      4|         constexpr auto sizeof_uint16_t = sizeof(uint16_t);
  342|       |
  343|      4|         if(extension_size != sizeof_uint16_t) {
  ------------------
  |  Branch (343:13): [True: 3, False: 1]
  ------------------
  344|      3|            throw Decoding_Error("Size of KeyShare extension in HelloRetryRequest must be " +
  345|      3|                                 std::to_string(sizeof_uint16_t) + " bytes");
  346|      3|         }
  347|       |
  348|      1|         m_selected_group = static_cast<Named_Group>(reader.get_uint16_t());
  349|      1|      }
tls_extensions_key_share.cpp:_ZN5Botan3TLS12_GLOBAL__N_121Key_Share_ServerHelloC2ERNS0_15TLS_Data_ReaderEt:
  125|     20|      Key_Share_ServerHello(TLS_Data_Reader& reader, uint16_t) : m_server_share(reader) {}
tls_extensions_key_share.cpp:_ZN5Botan3TLS12_GLOBAL__N_121Key_Share_ServerHelloD2Ev:
  130|     54|      ~Key_Share_ServerHello() = default;
tls_extensions_key_share.cpp:_ZN5Botan3TLS9Key_Share14Key_Share_ImplC2ENSt3__17variantIJNS0_12_GLOBAL__N_121Key_Share_ClientHelloENS5_21Key_Share_ServerHelloENS5_27Key_Share_HelloRetryRequestEEEE:
  386|     19|      Key_Share_Impl(Key_Share_Type ks) : key_share(std::move(ks)) {}
tls_extensions_key_share.cpp:_ZN5Botan3TLS12_GLOBAL__N_121Key_Share_ServerHelloC2EOS2_:
  135|     36|      Key_Share_ServerHello(Key_Share_ServerHello&&) = default;

_ZN5Botan3TLS3PSKC2ERNS0_15TLS_Data_ReaderEtNS0_14Handshake_TypeE:
   56|     21|PSK::PSK(TLS_Data_Reader& reader, uint16_t extension_size, Handshake_Type message_type) {
   57|     21|   if(message_type == Handshake_Type::ServerHello) {
  ------------------
  |  Branch (57:7): [True: 20, False: 1]
  ------------------
   58|     20|      if(extension_size != 2) {
  ------------------
  |  Branch (58:10): [True: 11, False: 9]
  ------------------
   59|     11|         throw TLS_Exception(Alert::DecodeError, "Server provided a malformed PSK extension");
   60|     11|      }
   61|       |
   62|      9|      m_impl = std::make_unique<PSK_Internal>(
   63|      9|         Server_PSK{.selected_identity = reader.get_uint16_t(), .session_to_resume = std::nullopt});
   64|      9|   } else if(message_type == Handshake_Type::ClientHello) {
  ------------------
  |  Branch (64:14): [True: 0, False: 1]
  ------------------
   65|      0|      std::vector<Client_PSK> psks;
   66|       |
   67|      0|      const auto identities_length = reader.get_uint16_t();
   68|      0|      const auto identities_offset = reader.read_so_far();
   69|       |
   70|      0|      while(reader.has_remaining() && (reader.read_so_far() - identities_offset) < identities_length) {
  ------------------
  |  Branch (70:13): [True: 0, False: 0]
  |  Branch (70:39): [True: 0, False: 0]
  ------------------
   71|      0|         auto identity = Opaque_Session_Handle(reader.get_tls_length_value(2));
   72|      0|         const auto obfuscated_ticket_age = reader.get_uint32_t();
   73|       |
   74|      0|         psks.emplace_back(Client_PSK{
   75|      0|            .ticket = Ticket(std::move(identity), obfuscated_ticket_age), .binder = {}, .cipher_state = nullptr});
   76|      0|      }
   77|       |
   78|      0|      if(psks.empty()) {
  ------------------
  |  Branch (78:10): [True: 0, False: 0]
  ------------------
   79|      0|         throw TLS_Exception(Alert::DecodeError, "Empty PSK list");
   80|      0|      }
   81|       |
   82|      0|      if(reader.read_so_far() - identities_offset != identities_length) {
  ------------------
  |  Branch (82:10): [True: 0, False: 0]
  ------------------
   83|      0|         throw TLS_Exception(Alert::DecodeError, "Inconsistent PSK identity list");
   84|      0|      }
   85|       |
   86|      0|      const auto binders_length = reader.get_uint16_t();
   87|      0|      const auto binders_offset = reader.read_so_far();
   88|       |
   89|      0|      if(binders_length == 0) {
  ------------------
  |  Branch (89:10): [True: 0, False: 0]
  ------------------
   90|      0|         throw TLS_Exception(Alert::DecodeError, "Empty PSK binders list");
   91|      0|      }
   92|       |
   93|      0|      for(auto& psk : psks) {
  ------------------
  |  Branch (93:21): [True: 0, False: 0]
  ------------------
   94|      0|         if(!reader.has_remaining() || reader.read_so_far() - binders_offset >= binders_length) {
  ------------------
  |  Branch (94:13): [True: 0, False: 0]
  |  Branch (94:40): [True: 0, False: 0]
  ------------------
   95|      0|            throw TLS_Exception(Alert::IllegalParameter, "Not enough PSK binders");
   96|      0|         }
   97|       |
   98|      0|         psk.binder = reader.get_tls_length_value(1);
   99|      0|      }
  100|       |
  101|      0|      if(reader.read_so_far() - binders_offset != binders_length) {
  ------------------
  |  Branch (101:10): [True: 0, False: 0]
  ------------------
  102|      0|         throw TLS_Exception(Alert::IllegalParameter, "Too many PSK binders");
  103|      0|      }
  104|       |
  105|      0|      m_impl = std::make_unique<PSK_Internal>(std::move(psks));
  106|      1|   } else {
  107|      1|      throw TLS_Exception(Alert::DecodeError, "Found a PSK extension in an unexpected handshake message");
  108|      1|   }
  109|     21|}
_ZN5Botan3TLS3PSKD2Ev:
  151|      9|PSK::~PSK() = default;
tls_extensions_psk.cpp:_ZN5Botan3TLS3PSK12PSK_InternalC2ENS0_12_GLOBAL__N_110Server_PSKE:
   49|      9|      PSK_Internal(Server_PSK srv_psk) : psk(srv_psk) {}

_ZN5Botan3TLS5AlertC2ERKNSt3__16vectorIhNS_16secure_allocatorIhEEEE:
   14|  2.77k|Alert::Alert(const secure_vector<uint8_t>& buf) {
   15|  2.77k|   if(buf.size() != 2) {
  ------------------
  |  Branch (15:7): [True: 34, False: 2.74k]
  ------------------
   16|     34|      throw Decoding_Error("Bad size (" + std::to_string(buf.size()) + ") for TLS alert message");
   17|     34|   }
   18|       |
   19|  2.74k|   if(buf[0] == 1) {
  ------------------
  |  Branch (19:7): [True: 2.04k, False: 705]
  ------------------
   20|  2.04k|      m_fatal = false;
   21|  2.04k|   } else if(buf[0] == 2) {
  ------------------
  |  Branch (21:14): [True: 693, False: 12]
  ------------------
   22|    693|      m_fatal = true;
   23|    693|   } else {
   24|     12|      throw TLS_Exception(Alert::IllegalParameter, "Bad code for TLS alert level");
   25|     12|   }
   26|       |
   27|  2.73k|   const uint8_t dc = buf[1];
   28|       |
   29|  2.73k|   m_type_code = static_cast<Type>(dc);
   30|  2.73k|}
_ZNK5Botan3TLS5Alert9serializeEv:
   32|  2.21k|std::vector<uint8_t> Alert::serialize() const {
   33|  2.21k|   return std::vector<uint8_t>({static_cast<uint8_t>(is_fatal() ? 2 : 1), static_cast<uint8_t>(type())});
  ------------------
  |  Branch (33:54): [True: 2.19k, False: 26]
  ------------------
   34|  2.21k|}

_ZN5Botan3TLS18kdf_algo_to_stringENS0_8KDF_AlgoE:
   15|     94|std::string kdf_algo_to_string(KDF_Algo algo) {
   16|     94|   switch(algo) {
  ------------------
  |  Branch (16:11): [True: 0, False: 94]
  ------------------
   17|     18|      case KDF_Algo::SHA_1:
  ------------------
  |  Branch (17:7): [True: 18, False: 76]
  ------------------
   18|     18|         return "SHA-1";
   19|     55|      case KDF_Algo::SHA_256:
  ------------------
  |  Branch (19:7): [True: 55, False: 39]
  ------------------
   20|     55|         return "SHA-256";
   21|     21|      case KDF_Algo::SHA_384:
  ------------------
  |  Branch (21:7): [True: 21, False: 73]
  ------------------
   22|     21|         return "SHA-384";
   23|     94|   }
   24|       |
   25|      0|   throw Invalid_State("kdf_algo_to_string unknown enum value");
   26|     94|}
_ZN5Botan3TLS17group_param_is_dhENS0_12Group_ParamsE:
  113|  30.0k|bool group_param_is_dh(Group_Params group) {
  114|  30.0k|   uint16_t group_id = static_cast<uint16_t>(group);
  115|  30.0k|   return (group_id >= 256 && group_id < 512);
  ------------------
  |  Branch (115:12): [True: 12.5k, False: 17.5k]
  |  Branch (115:31): [True: 12.5k, False: 0]
  ------------------
  116|  30.0k|}

_ZN5Botan3TLS9Callbacks25tls_inspect_handshake_msgERKNS0_17Handshake_MessageE:
   30|  2.62k|void TLS::Callbacks::tls_inspect_handshake_msg(const Handshake_Message& /*unused*/) {
   31|       |   // default is no op
   32|  2.62k|}
_ZN5Botan3TLS9Callbacks21tls_current_timestampEv:
   38|  5.00k|std::chrono::system_clock::time_point TLS::Callbacks::tls_current_timestamp() {
   39|  5.00k|   return std::chrono::system_clock::now();
   40|  5.00k|}
_ZN5Botan3TLS9Callbacks21tls_modify_extensionsERNS0_10ExtensionsENS0_15Connection_SideENS0_14Handshake_TypeE:
   44|  2.50k|                                           Handshake_Type /*unused*/) {}

_ZN5Botan3TLS11Ciphersuite5by_idEt:
   84|    129|std::optional<Ciphersuite> Ciphersuite::by_id(uint16_t suite) {
   85|    129|   const std::vector<Ciphersuite>& all_suites = all_known_ciphersuites();
   86|    129|   auto s = std::lower_bound(all_suites.begin(), all_suites.end(), suite);
   87|       |
   88|    129|   if(s != all_suites.end() && s->ciphersuite_code() == suite) {
  ------------------
  |  Branch (88:7): [True: 127, False: 2]
  |  Branch (88:7): [True: 12, False: 117]
  |  Branch (88:32): [True: 12, False: 115]
  ------------------
   89|     12|      return *s;
   90|     12|   }
   91|       |
   92|    117|   return std::nullopt;  // some unknown ciphersuite
   93|    129|}
_ZNK5Botan3TLS11Ciphersuite9is_usableEv:
  117|     94|bool Ciphersuite::is_usable() const {
  118|     94|   if(!m_cipher_keylen) {  // uninitialized object
  ------------------
  |  Branch (118:7): [True: 0, False: 94]
  ------------------
  119|      0|      return false;
  120|      0|   }
  121|       |
  122|     94|   if(!have_hash(prf_algo())) {
  ------------------
  |  Branch (122:7): [True: 0, False: 94]
  ------------------
  123|      0|      return false;
  124|      0|   }
  125|       |
  126|       |#if !defined(BOTAN_HAS_TLS_CBC)
  127|       |   if(cbc_ciphersuite())
  128|       |      return false;
  129|       |#endif
  130|       |
  131|     94|   if(mac_algo() == "AEAD") {
  ------------------
  |  Branch (131:7): [True: 64, False: 30]
  ------------------
  132|     64|      if(cipher_algo() == "ChaCha20Poly1305") {
  ------------------
  |  Branch (132:10): [True: 6, False: 58]
  ------------------
  133|       |#if !defined(BOTAN_HAS_AEAD_CHACHA20_POLY1305)
  134|       |         return false;
  135|       |#endif
  136|     58|      } else {
  137|     58|         auto cipher_and_mode = split_on(cipher_algo(), '/');
  138|     58|         BOTAN_ASSERT(cipher_and_mode.size() == 2, "Expected format for AEAD algo");
  ------------------
  |  |   51|     58|   do {                                                                                 \
  |  |   52|     58|      if(!(expr))                                                                       \
  |  |  ------------------
  |  |  |  Branch (52:10): [True: 0, False: 58]
  |  |  ------------------
  |  |   53|     58|         Botan::assertion_failure(#expr, assertion_made, __func__, __FILE__, __LINE__); \
  |  |   54|     58|   } while(0)
  |  |  ------------------
  |  |  |  Branch (54:12): [Folded - Ignored]
  |  |  ------------------
  ------------------
  139|     58|         if(!have_cipher(cipher_and_mode[0])) {
  ------------------
  |  Branch (139:13): [True: 0, False: 58]
  ------------------
  140|      0|            return false;
  141|      0|         }
  142|       |
  143|     58|         const auto mode = cipher_and_mode[1];
  144|       |
  145|       |#if !defined(BOTAN_HAS_AEAD_CCM)
  146|       |         if(mode == "CCM" || mode == "CCM-8")
  147|       |            return false;
  148|       |#endif
  149|       |
  150|       |#if !defined(BOTAN_HAS_AEAD_GCM)
  151|       |         if(mode == "GCM")
  152|       |            return false;
  153|       |#endif
  154|       |
  155|       |#if !defined(BOTAN_HAS_AEAD_OCB)
  156|       |         if(mode == "OCB(12)" || mode == "OCB")
  157|       |            return false;
  158|       |#endif
  159|     58|      }
  160|     64|   } else {
  161|       |      // Old non-AEAD schemes
  162|     30|      if(!have_cipher(cipher_algo())) {
  ------------------
  |  Branch (162:10): [True: 0, False: 30]
  ------------------
  163|      0|         return false;
  164|      0|      }
  165|     30|      if(!have_hash(mac_algo())) {  // HMAC
  ------------------
  |  Branch (165:10): [True: 0, False: 30]
  ------------------
  166|      0|         return false;
  167|      0|      }
  168|     30|   }
  169|       |
  170|     94|   if(kex_method() == Kex_Algo::ECDH || kex_method() == Kex_Algo::ECDHE_PSK) {
  ------------------
  |  Branch (170:7): [True: 30, False: 64]
  |  Branch (170:41): [True: 11, False: 53]
  ------------------
  171|       |#if !defined(BOTAN_HAS_ECDH)
  172|       |      return false;
  173|       |#endif
  174|     53|   } else if(kex_method() == Kex_Algo::DH) {
  ------------------
  |  Branch (174:14): [True: 16, False: 37]
  ------------------
  175|       |#if !defined(BOTAN_HAS_DIFFIE_HELLMAN)
  176|       |      return false;
  177|       |#endif
  178|     16|   }
  179|       |
  180|     94|   if(auth_method() == Auth_Method::ECDSA) {
  ------------------
  |  Branch (180:7): [True: 17, False: 77]
  ------------------
  181|       |#if !defined(BOTAN_HAS_ECDSA)
  182|       |      return false;
  183|       |#endif
  184|     77|   } else if(auth_method() == Auth_Method::RSA) {
  ------------------
  |  Branch (184:14): [True: 29, False: 48]
  ------------------
  185|       |#if !defined(BOTAN_HAS_RSA)
  186|       |      return false;
  187|       |#endif
  188|     29|   }
  189|       |
  190|     94|   return true;
  191|     94|}
tls_ciphersuite.cpp:_ZN5Botan3TLS12_GLOBAL__N_19have_hashENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEE:
  109|    124|bool have_hash(std::string_view prf) { return (!HashFunction::providers(prf).empty()); }
tls_ciphersuite.cpp:_ZN5Botan3TLS12_GLOBAL__N_111have_cipherENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEE:
  111|     88|bool have_cipher(std::string_view cipher) {
  112|     88|   return (!BlockCipher::providers(cipher).empty()) || (!StreamCipher::providers(cipher).empty());
  ------------------
  |  Branch (112:11): [True: 88, False: 0]
  |  Branch (112:56): [True: 0, False: 0]
  ------------------
  113|     88|}

_ZN5Botan3TLS6ClientC2ERKNSt3__110shared_ptrINS0_9CallbacksEEERKNS3_INS0_15Session_ManagerEEERKNS3_INS_19Credentials_ManagerEEERKNS3_IKNS0_6PolicyEEERKNS3_INS_21RandomNumberGeneratorEEENS0_18Server_InformationENS0_16Protocol_VersionERKNS2_6vectorINS2_12basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEENSV_ISX_EEEEm:
   38|  2.50k|               size_t io_buf_sz) {
   39|  2.50k|   BOTAN_ARG_CHECK(policy->acceptable_protocol_version(offer_version),
  ------------------
  |  |   30|  2.50k|   do {                                                          \
  |  |   31|  2.50k|      if(!(expr))                                                \
  |  |  ------------------
  |  |  |  Branch (31:10): [True: 0, False: 2.50k]
  |  |  ------------------
  |  |   32|  2.50k|         Botan::throw_invalid_argument(msg, __func__, __FILE__); \
  |  |   33|  2.50k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (33:12): [Folded - Ignored]
  |  |  ------------------
  ------------------
   40|  2.50k|                   "Policy does not allow to offer requested protocol version");
   41|       |
   42|  2.50k|#if defined(BOTAN_HAS_TLS_13)
   43|  2.50k|   if(offer_version == Protocol_Version::TLS_V13) {
  ------------------
  |  Branch (43:7): [True: 0, False: 2.50k]
  ------------------
   44|      0|      m_impl = std::make_unique<Client_Impl_13>(
   45|      0|         callbacks, session_manager, creds, policy, rng, std::move(info), next_protocols);
   46|       |
   47|      0|      if(m_impl->expects_downgrade()) {
  ------------------
  |  Branch (47:10): [True: 0, False: 0]
  ------------------
   48|      0|         m_impl->set_io_buffer_size(io_buf_sz);
   49|      0|      }
   50|       |
   51|      0|      if(m_impl->is_downgrading()) {
  ------------------
  |  Branch (51:10): [True: 0, False: 0]
  ------------------
   52|       |         // TLS 1.3 implementation found a resumable TLS 1.2 session and
   53|       |         // requested a downgrade right away.
   54|      0|         downgrade();
   55|      0|      }
   56|       |
   57|      0|      return;
   58|      0|   }
   59|  2.50k|#endif
   60|       |
   61|  2.50k|   m_impl = std::make_unique<Client_Impl_12>(callbacks,
   62|  2.50k|                                             session_manager,
   63|  2.50k|                                             creds,
   64|  2.50k|                                             policy,
   65|  2.50k|                                             rng,
   66|  2.50k|                                             std::move(info),
   67|  2.50k|                                             offer_version.is_datagram_protocol(),
   68|  2.50k|                                             next_protocols,
   69|  2.50k|                                             io_buf_sz);
   70|  2.50k|}
_ZN5Botan3TLS6ClientD2Ev:
   72|  2.50k|Client::~Client() = default;
_ZN5Botan3TLS6Client9from_peerENSt3__14spanIKhLm18446744073709551615EEE:
   90|  2.50k|size_t Client::from_peer(std::span<const uint8_t> data) {
   91|  2.50k|   auto read = m_impl->from_peer(data);
   92|       |
   93|  2.50k|   if(m_impl->is_downgrading()) {
  ------------------
  |  Branch (93:7): [True: 0, False: 2.50k]
  ------------------
   94|      0|      read = downgrade();
   95|      0|   }
   96|       |
   97|  2.50k|   return read;
   98|  2.50k|}

_ZN5Botan3TLS10Extensions3addENSt3__110unique_ptrINS0_9ExtensionENS2_14default_deleteIS4_EEEE:
  101|  30.8k|void Extensions::add(std::unique_ptr<Extension> extn) {
  102|  30.8k|   if(has(extn->type())) {
  ------------------
  |  Branch (102:7): [True: 0, False: 30.8k]
  ------------------
  103|      0|      throw Invalid_Argument("cannot add the same extension twice: " +
  104|      0|                             std::to_string(static_cast<uint16_t>(extn->type())));
  105|      0|   }
  106|       |
  107|  30.8k|   m_extensions.emplace_back(extn.release());
  108|  30.8k|}
_ZN5Botan3TLS10Extensions11deserializeERNS0_15TLS_Data_ReaderENS0_15Connection_SideENS0_14Handshake_TypeE:
  110|  1.91k|void Extensions::deserialize(TLS_Data_Reader& reader, const Connection_Side from, const Handshake_Type message_type) {
  111|  1.91k|   if(reader.has_remaining()) {
  ------------------
  |  Branch (111:7): [True: 1.84k, False: 65]
  ------------------
  112|  1.84k|      const uint16_t all_extn_size = reader.get_uint16_t();
  113|       |
  114|  1.84k|      if(reader.remaining_bytes() != all_extn_size) {
  ------------------
  |  Branch (114:10): [True: 60, False: 1.78k]
  ------------------
  115|     60|         throw Decoding_Error("Bad extension size");
  116|     60|      }
  117|       |
  118|  9.14k|      while(reader.has_remaining()) {
  ------------------
  |  Branch (118:13): [True: 7.37k, False: 1.76k]
  ------------------
  119|  7.37k|         const uint16_t extension_code = reader.get_uint16_t();
  120|  7.37k|         const uint16_t extension_size = reader.get_uint16_t();
  121|       |
  122|  7.37k|         const auto type = static_cast<Extension_Code>(extension_code);
  123|       |
  124|  7.37k|         if(this->has(type)) {
  ------------------
  |  Branch (124:13): [True: 20, False: 7.35k]
  ------------------
  125|     20|            throw TLS_Exception(TLS::Alert::DecodeError, "Peer sent duplicated extensions");
  126|     20|         }
  127|       |
  128|       |         // TODO offer a function on reader that returns a byte range as a reference
  129|       |         // to avoid this copy of the extension data
  130|  7.35k|         const std::vector<uint8_t> extn_data = reader.get_fixed<uint8_t>(extension_size);
  131|  7.35k|         TLS_Data_Reader extn_reader("Extension", extn_data);
  132|  7.35k|         this->add(make_extension(extn_reader, type, from, message_type));
  133|  7.35k|         extn_reader.assert_done();
  134|  7.35k|      }
  135|  1.78k|   }
  136|  1.91k|}
_ZNK5Botan3TLS10Extensions9serializeENS0_15Connection_SideE:
  174|  2.50k|std::vector<uint8_t> Extensions::serialize(Connection_Side whoami) const {
  175|  2.50k|   std::vector<uint8_t> buf(2);  // 2 bytes for length field
  176|       |
  177|  25.0k|   for(const auto& extn : m_extensions) {
  ------------------
  |  Branch (177:25): [True: 25.0k, False: 2.50k]
  ------------------
  178|  25.0k|      if(extn->empty()) {
  ------------------
  |  Branch (178:10): [True: 0, False: 25.0k]
  ------------------
  179|      0|         continue;
  180|      0|      }
  181|       |
  182|  25.0k|      const uint16_t extn_code = static_cast<uint16_t>(extn->type());
  183|       |
  184|  25.0k|      const std::vector<uint8_t> extn_val = extn->serialize(whoami);
  185|       |
  186|  25.0k|      buf.push_back(get_byte<0>(extn_code));
  187|  25.0k|      buf.push_back(get_byte<1>(extn_code));
  188|       |
  189|  25.0k|      buf.push_back(get_byte<0>(static_cast<uint16_t>(extn_val.size())));
  190|  25.0k|      buf.push_back(get_byte<1>(static_cast<uint16_t>(extn_val.size())));
  191|       |
  192|  25.0k|      buf += extn_val;
  193|  25.0k|   }
  194|       |
  195|  2.50k|   const uint16_t extn_size = static_cast<uint16_t>(buf.size() - 2);
  196|       |
  197|  2.50k|   buf[0] = get_byte<0>(extn_size);
  198|  2.50k|   buf[1] = get_byte<1>(extn_size);
  199|       |
  200|       |   // avoid sending a completely empty extensions block
  201|  2.50k|   if(buf.size() == 2) {
  ------------------
  |  Branch (201:7): [True: 0, False: 2.50k]
  ------------------
  202|      0|      return std::vector<uint8_t>();
  203|      0|   }
  204|       |
  205|  2.50k|   return buf;
  206|  2.50k|}
_ZN5Botan3TLS17Unknown_ExtensionC2ENS0_14Extension_CodeERNS0_15TLS_Data_ReaderEt:
  218|  5.06k|      m_type(type), m_value(reader.get_fixed<uint8_t>(extension_size)) {}
_ZN5Botan3TLS21Server_Name_IndicatorC2ERNS0_15TLS_Data_ReaderEt:
  222|    207|Server_Name_Indicator::Server_Name_Indicator(TLS_Data_Reader& reader, uint16_t extension_size) {
  223|       |   /*
  224|       |   * This is used by the server to confirm that it knew the name
  225|       |   */
  226|    207|   if(extension_size == 0) {
  ------------------
  |  Branch (226:7): [True: 117, False: 90]
  ------------------
  227|    117|      return;
  228|    117|   }
  229|       |
  230|     90|   uint16_t name_bytes = reader.get_uint16_t();
  231|       |
  232|     90|   if(name_bytes + 2 != extension_size) {
  ------------------
  |  Branch (232:7): [True: 28, False: 62]
  ------------------
  233|     28|      throw Decoding_Error("Bad encoding of SNI extension");
  234|     28|   }
  235|       |
  236|    268|   while(name_bytes) {
  ------------------
  |  Branch (236:10): [True: 206, False: 62]
  ------------------
  237|    206|      uint8_t name_type = reader.get_byte();
  238|    206|      name_bytes--;
  239|       |
  240|    206|      if(name_type == 0)  // DNS
  ------------------
  |  Branch (240:10): [True: 187, False: 19]
  ------------------
  241|    187|      {
  242|    187|         m_sni_host_name = reader.get_string(2, 1, 65535);
  243|    187|         name_bytes -= static_cast<uint16_t>(2 + m_sni_host_name.size());
  244|    187|      } else  // some other unknown name type
  245|     19|      {
  246|     19|         reader.discard_next(name_bytes);
  247|     19|         name_bytes = 0;
  248|     19|      }
  249|    206|   }
  250|     62|}
_ZNK5Botan3TLS21Server_Name_Indicator9serializeENS0_15Connection_SideE:
  252|  2.50k|std::vector<uint8_t> Server_Name_Indicator::serialize(Connection_Side whoami) const {
  253|       |   // RFC 6066
  254|       |   //    [...] the server SHALL include an extension of type "server_name" in
  255|       |   //    the (extended) server hello. The "extension_data" field of this
  256|       |   //    extension SHALL be empty.
  257|  2.50k|   if(whoami == Connection_Side::Server) {
  ------------------
  |  Branch (257:7): [True: 0, False: 2.50k]
  ------------------
  258|      0|      return {};
  259|      0|   }
  260|       |
  261|  2.50k|   std::vector<uint8_t> buf;
  262|       |
  263|  2.50k|   size_t name_len = m_sni_host_name.size();
  264|       |
  265|  2.50k|   buf.push_back(get_byte<0>(static_cast<uint16_t>(name_len + 3)));
  266|  2.50k|   buf.push_back(get_byte<1>(static_cast<uint16_t>(name_len + 3)));
  267|  2.50k|   buf.push_back(0);  // DNS
  268|       |
  269|  2.50k|   buf.push_back(get_byte<0>(static_cast<uint16_t>(name_len)));
  270|  2.50k|   buf.push_back(get_byte<1>(static_cast<uint16_t>(name_len)));
  271|       |
  272|  2.50k|   buf += std::make_pair(cast_char_ptr_to_uint8(m_sni_host_name.data()), m_sni_host_name.size());
  273|       |
  274|  2.50k|   return buf;
  275|  2.50k|}
_ZN5Botan3TLS23Renegotiation_ExtensionC2ERNS0_15TLS_Data_ReaderEt:
  278|     38|      m_reneg_data(reader.get_range<uint8_t>(1, 0, 255)) {
  279|     38|   if(m_reneg_data.size() + 1 != extension_size) {
  ------------------
  |  Branch (279:7): [True: 10, False: 28]
  ------------------
  280|     10|      throw Decoding_Error("Bad encoding for secure renegotiation extn");
  281|     10|   }
  282|     38|}
_ZNK5Botan3TLS23Renegotiation_Extension9serializeENS0_15Connection_SideE:
  284|  2.50k|std::vector<uint8_t> Renegotiation_Extension::serialize(Connection_Side /*whoami*/) const {
  285|  2.50k|   std::vector<uint8_t> buf;
  286|  2.50k|   append_tls_length_value(buf, m_reneg_data, 1);
  287|  2.50k|   return buf;
  288|  2.50k|}
_ZN5Botan3TLS39Application_Layer_Protocol_NotificationC2ERNS0_15TLS_Data_ReaderEtNS0_15Connection_SideE:
  292|    144|                                                                                 Connection_Side from) {
  293|    144|   if(extension_size == 0) {
  ------------------
  |  Branch (293:7): [True: 42, False: 102]
  ------------------
  294|     42|      return;  // empty extension
  295|     42|   }
  296|       |
  297|    102|   const uint16_t name_bytes = reader.get_uint16_t();
  298|       |
  299|    102|   size_t bytes_remaining = extension_size - 2;
  300|       |
  301|    102|   if(name_bytes != bytes_remaining) {
  ------------------
  |  Branch (301:7): [True: 34, False: 68]
  ------------------
  302|     34|      throw Decoding_Error("Bad encoding of ALPN extension, bad length field");
  303|     34|   }
  304|       |
  305|  3.57k|   while(bytes_remaining) {
  ------------------
  |  Branch (305:10): [True: 3.51k, False: 54]
  ------------------
  306|  3.51k|      const std::string p = reader.get_string(1, 0, 255);
  307|       |
  308|  3.51k|      if(bytes_remaining < p.size() + 1) {
  ------------------
  |  Branch (308:10): [True: 0, False: 3.51k]
  ------------------
  309|      0|         throw Decoding_Error("Bad encoding of ALPN, length field too long");
  310|      0|      }
  311|       |
  312|  3.51k|      if(p.empty()) {
  ------------------
  |  Branch (312:10): [True: 14, False: 3.50k]
  ------------------
  313|     14|         throw Decoding_Error("Empty ALPN protocol not allowed");
  314|     14|      }
  315|       |
  316|  3.50k|      bytes_remaining -= (p.size() + 1);
  317|       |
  318|  3.50k|      m_protocols.push_back(p);
  319|  3.50k|   }
  320|       |
  321|       |   // RFC 7301 3.1
  322|       |   //    The "extension_data" field of the [...] extension is structured the
  323|       |   //    same as described above for the client "extension_data", except that
  324|       |   //    the "ProtocolNameList" MUST contain exactly one "ProtocolName".
  325|     54|   if(from == Connection_Side::Server && m_protocols.size() != 1) {
  ------------------
  |  Branch (325:7): [True: 25, False: 29]
  |  Branch (325:42): [True: 20, False: 5]
  ------------------
  326|     20|      throw TLS_Exception(
  327|     20|         Alert::DecodeError,
  328|     20|         "Server sent " + std::to_string(m_protocols.size()) + " protocols in ALPN extension response");
  329|     20|   }
  330|     54|}
_ZN5Botan3TLS16Supported_GroupsC2ERKNSt3__16vectorINS0_12Group_ParamsENS2_9allocatorIS4_EEEE:
  355|  2.50k|Supported_Groups::Supported_Groups(const std::vector<Group_Params>& groups) : m_groups(groups) {}
_ZNK5Botan3TLS16Supported_Groups9ec_groupsEv:
  359|  2.50k|std::vector<Group_Params> Supported_Groups::ec_groups() const {
  360|  2.50k|   std::vector<Group_Params> ec;
  361|  30.0k|   for(auto g : m_groups) {
  ------------------
  |  Branch (361:15): [True: 30.0k, False: 2.50k]
  ------------------
  362|  30.0k|      if(group_param_is_dh(g) == false) {
  ------------------
  |  Branch (362:10): [True: 17.5k, False: 12.5k]
  ------------------
  363|  17.5k|         ec.push_back(g);
  364|  17.5k|      }
  365|  30.0k|   }
  366|  2.50k|   return ec;
  367|  2.50k|}
_ZNK5Botan3TLS16Supported_Groups9serializeENS0_15Connection_SideE:
  379|  2.50k|std::vector<uint8_t> Supported_Groups::serialize(Connection_Side /*whoami*/) const {
  380|  2.50k|   std::vector<uint8_t> buf(2);
  381|       |
  382|  30.0k|   for(auto g : m_groups) {
  ------------------
  |  Branch (382:15): [True: 30.0k, False: 2.50k]
  ------------------
  383|  30.0k|      const uint16_t id = static_cast<uint16_t>(g);
  384|       |
  385|  30.0k|      if(id > 0) {
  ------------------
  |  Branch (385:10): [True: 30.0k, False: 0]
  ------------------
  386|  30.0k|         buf.push_back(get_byte<0>(id));
  387|  30.0k|         buf.push_back(get_byte<1>(id));
  388|  30.0k|      }
  389|  30.0k|   }
  390|       |
  391|  2.50k|   buf[0] = get_byte<0>(static_cast<uint16_t>(buf.size() - 2));
  392|  2.50k|   buf[1] = get_byte<1>(static_cast<uint16_t>(buf.size() - 2));
  393|       |
  394|  2.50k|   return buf;
  395|  2.50k|}
_ZN5Botan3TLS16Supported_GroupsC2ERNS0_15TLS_Data_ReaderEt:
  397|     94|Supported_Groups::Supported_Groups(TLS_Data_Reader& reader, uint16_t extension_size) {
  398|     94|   const uint16_t len = reader.get_uint16_t();
  399|       |
  400|     94|   if(len + 2 != extension_size) {
  ------------------
  |  Branch (400:7): [True: 18, False: 76]
  ------------------
  401|     18|      throw Decoding_Error("Inconsistent length field in supported groups list");
  402|     18|   }
  403|       |
  404|     76|   if(len % 2 == 1) {
  ------------------
  |  Branch (404:7): [True: 1, False: 75]
  ------------------
  405|      1|      throw Decoding_Error("Supported groups list of strange size");
  406|      1|   }
  407|       |
  408|     75|   const size_t elems = len / 2;
  409|       |
  410|  2.75k|   for(size_t i = 0; i != elems; ++i) {
  ------------------
  |  Branch (410:22): [True: 2.67k, False: 75]
  ------------------
  411|  2.67k|      const auto group = static_cast<Group_Params>(reader.get_uint16_t());
  412|       |      // Note: RFC 8446 does not explicitly enforce that groups must be unique.
  413|  2.67k|      if(!value_exists(m_groups, group)) {
  ------------------
  |  Branch (413:10): [True: 1.61k, False: 1.06k]
  ------------------
  414|  1.61k|         m_groups.push_back(group);
  415|  1.61k|      }
  416|  2.67k|   }
  417|     75|}
_ZNK5Botan3TLS23Supported_Point_Formats9serializeENS0_15Connection_SideE:
  419|  2.50k|std::vector<uint8_t> Supported_Point_Formats::serialize(Connection_Side /*whoami*/) const {
  420|       |   // if this extension is sent, it MUST include uncompressed (RFC 4492, section 5.1)
  421|  2.50k|   if(m_prefers_compressed) {
  ------------------
  |  Branch (421:7): [True: 0, False: 2.50k]
  ------------------
  422|      0|      return std::vector<uint8_t>{2, ANSIX962_COMPRESSED_PRIME, UNCOMPRESSED};
  423|  2.50k|   } else {
  424|  2.50k|      return std::vector<uint8_t>{1, UNCOMPRESSED};
  425|  2.50k|   }
  426|  2.50k|}
_ZN5Botan3TLS23Supported_Point_FormatsC2ERNS0_15TLS_Data_ReaderEt:
  428|     53|Supported_Point_Formats::Supported_Point_Formats(TLS_Data_Reader& reader, uint16_t extension_size) {
  429|     53|   uint8_t len = reader.get_byte();
  430|       |
  431|     53|   if(len + 1 != extension_size) {
  ------------------
  |  Branch (431:7): [True: 1, False: 52]
  ------------------
  432|      1|      throw Decoding_Error("Inconsistent length field in supported point formats list");
  433|      1|   }
  434|       |
  435|     52|   bool includes_uncompressed = false;
  436|    454|   for(size_t i = 0; i != len; ++i) {
  ------------------
  |  Branch (436:22): [True: 436, False: 18]
  ------------------
  437|    436|      uint8_t format = reader.get_byte();
  438|       |
  439|    436|      if(static_cast<ECPointFormat>(format) == UNCOMPRESSED) {
  ------------------
  |  Branch (439:10): [True: 13, False: 423]
  ------------------
  440|     13|         m_prefers_compressed = false;
  441|     13|         reader.discard_next(len - i - 1);
  442|     13|         return;
  443|    423|      } else if(static_cast<ECPointFormat>(format) == ANSIX962_COMPRESSED_PRIME) {
  ------------------
  |  Branch (443:17): [True: 21, False: 402]
  ------------------
  444|     21|         m_prefers_compressed = true;
  445|     21|         std::vector<uint8_t> remaining_formats = reader.get_fixed<uint8_t>(len - i - 1);
  446|     21|         includes_uncompressed =
  447|     21|            std::any_of(std::begin(remaining_formats), std::end(remaining_formats), [](uint8_t remaining_format) {
  448|     21|               return static_cast<ECPointFormat>(remaining_format) == UNCOMPRESSED;
  449|     21|            });
  450|     21|         break;
  451|     21|      }
  452|       |
  453|       |      // ignore ANSIX962_COMPRESSED_CHAR2, we don't support these curves
  454|    436|   }
  455|       |
  456|       |   // RFC 4492 5.1.:
  457|       |   //   If the Supported Point Formats Extension is indeed sent, it MUST contain the value 0 (uncompressed)
  458|       |   //   as one of the items in the list of point formats.
  459|       |   // Note:
  460|       |   //   RFC 8422 5.1.2. explicitly requires this check,
  461|       |   //   but only if the Supported Groups extension was sent.
  462|     39|   if(!includes_uncompressed) {
  ------------------
  |  Branch (462:7): [True: 32, False: 7]
  ------------------
  463|     32|      throw TLS_Exception(Alert::IllegalParameter,
  464|     32|                          "Supported Point Formats Extension must contain the uncompressed point format");
  465|     32|   }
  466|     39|}
_ZNK5Botan3TLS20Signature_Algorithms9serializeENS0_15Connection_SideE:
  507|  2.50k|std::vector<uint8_t> Signature_Algorithms::serialize(Connection_Side /*whoami*/) const {
  508|  2.50k|   return serialize_signature_algorithms(m_schemes);
  509|  2.50k|}
_ZN5Botan3TLS20Signature_AlgorithmsC2ERNS0_15TLS_Data_ReaderEt:
  512|     24|      m_schemes(parse_signature_algorithms(reader, extension_size)) {}
_ZN5Botan3TLS25Signature_Algorithms_CertC2ERNS0_15TLS_Data_ReaderEt:
  519|     37|      m_schemes(parse_signature_algorithms(reader, extension_size)) {}
_ZN5Botan3TLS24Session_Ticket_ExtensionC2ERNS0_15TLS_Data_ReaderEt:
  522|     36|      m_ticket(Session_Ticket(reader.get_elem<uint8_t, std::vector<uint8_t>>(extension_size))) {}
_ZN5Botan3TLS24SRTP_Protection_ProfilesC2ERNS0_15TLS_Data_ReaderEt:
  525|     38|      m_pp(reader.get_range<uint16_t>(2, 0, 65535)) {
  526|     38|   const std::vector<uint8_t> mki = reader.get_range<uint8_t>(1, 0, 255);
  527|       |
  528|     38|   if(m_pp.size() * 2 + mki.size() + 3 != extension_size) {
  ------------------
  |  Branch (528:7): [True: 11, False: 27]
  ------------------
  529|     11|      throw Decoding_Error("Bad encoding for SRTP protection extension");
  530|     11|   }
  531|       |
  532|     27|   if(!mki.empty()) {
  ------------------
  |  Branch (532:7): [True: 1, False: 26]
  ------------------
  533|      1|      throw Decoding_Error("Unhandled non-empty MKI for SRTP protection extension");
  534|      1|   }
  535|     27|}
_ZN5Botan3TLS22Extended_Master_SecretC2ERNS0_15TLS_Data_ReaderEt:
  554|     50|Extended_Master_Secret::Extended_Master_Secret(TLS_Data_Reader& /*unused*/, uint16_t extension_size) {
  555|     50|   if(extension_size != 0) {
  ------------------
  |  Branch (555:7): [True: 11, False: 39]
  ------------------
  556|     11|      throw Decoding_Error("Invalid extended_master_secret extension");
  557|     11|   }
  558|     50|}
_ZNK5Botan3TLS22Extended_Master_Secret9serializeENS0_15Connection_SideE:
  560|  2.50k|std::vector<uint8_t> Extended_Master_Secret::serialize(Connection_Side /*whoami*/) const {
  561|  2.50k|   return std::vector<uint8_t>();
  562|  2.50k|}
_ZN5Botan3TLS16Encrypt_then_MACC2ERNS0_15TLS_Data_ReaderEt:
  564|     53|Encrypt_then_MAC::Encrypt_then_MAC(TLS_Data_Reader& /*unused*/, uint16_t extension_size) {
  565|     53|   if(extension_size != 0) {
  ------------------
  |  Branch (565:7): [True: 13, False: 40]
  ------------------
  566|     13|      throw Decoding_Error("Invalid encrypt_then_mac extension");
  567|     13|   }
  568|     53|}
_ZNK5Botan3TLS16Encrypt_then_MAC9serializeENS0_15Connection_SideE:
  570|  2.50k|std::vector<uint8_t> Encrypt_then_MAC::serialize(Connection_Side /*whoami*/) const { return std::vector<uint8_t>(); }
_ZNK5Botan3TLS18Supported_Versions9serializeENS0_15Connection_SideE:
  572|  2.50k|std::vector<uint8_t> Supported_Versions::serialize(Connection_Side whoami) const {
  573|  2.50k|   std::vector<uint8_t> buf;
  574|       |
  575|  2.50k|   if(whoami == Connection_Side::Server) {
  ------------------
  |  Branch (575:7): [True: 0, False: 2.50k]
  ------------------
  576|      0|      BOTAN_ASSERT_NOMSG(m_versions.size() == 1);
  ------------------
  |  |   60|      0|   do {                                                                     \
  |  |   61|      0|      if(!(expr))                                                           \
  |  |  ------------------
  |  |  |  Branch (61:10): [True: 0, False: 0]
  |  |  ------------------
  |  |   62|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   63|      0|   } while(0)
  |  |  ------------------
  |  |  |  Branch (63:12): [Folded - Ignored]
  |  |  ------------------
  ------------------
  577|      0|      buf.push_back(m_versions[0].major_version());
  578|      0|      buf.push_back(m_versions[0].minor_version());
  579|  2.50k|   } else {
  580|  2.50k|      BOTAN_ASSERT_NOMSG(!m_versions.empty());
  ------------------
  |  |   60|  2.50k|   do {                                                                     \
  |  |   61|  2.50k|      if(!(expr))                                                           \
  |  |  ------------------
  |  |  |  Branch (61:10): [True: 0, False: 2.50k]
  |  |  ------------------
  |  |   62|  2.50k|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   63|  2.50k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (63:12): [Folded - Ignored]
  |  |  ------------------
  ------------------
  581|  2.50k|      const uint8_t len = static_cast<uint8_t>(m_versions.size() * 2);
  582|       |
  583|  2.50k|      buf.push_back(len);
  584|       |
  585|  2.50k|      for(Protocol_Version version : m_versions) {
  ------------------
  |  Branch (585:36): [True: 2.50k, False: 2.50k]
  ------------------
  586|  2.50k|         buf.push_back(version.major_version());
  587|  2.50k|         buf.push_back(version.minor_version());
  588|  2.50k|      }
  589|  2.50k|   }
  590|       |
  591|  2.50k|   return buf;
  592|  2.50k|}
_ZN5Botan3TLS18Supported_VersionsC2ENS0_16Protocol_VersionERKNS0_6PolicyE:
  594|  2.50k|Supported_Versions::Supported_Versions(Protocol_Version offer, const Policy& policy) {
  595|  2.50k|   if(offer.is_datagram_protocol()) {
  ------------------
  |  Branch (595:7): [True: 0, False: 2.50k]
  ------------------
  596|      0|#if defined(BOTAN_HAS_TLS_12)
  597|      0|      if(offer >= Protocol_Version::DTLS_V12 && policy.allow_dtls12()) {
  ------------------
  |  Branch (597:10): [True: 0, False: 0]
  |  Branch (597:10): [True: 0, False: 0]
  |  Branch (597:49): [True: 0, False: 0]
  ------------------
  598|      0|         m_versions.push_back(Protocol_Version::DTLS_V12);
  599|      0|      }
  600|      0|#endif
  601|  2.50k|   } else {
  602|  2.50k|#if defined(BOTAN_HAS_TLS_13)
  603|  2.50k|      if(offer >= Protocol_Version::TLS_V13 && policy.allow_tls13()) {
  ------------------
  |  Branch (603:10): [True: 0, False: 2.50k]
  |  Branch (603:10): [True: 0, False: 2.50k]
  |  Branch (603:48): [True: 0, False: 0]
  ------------------
  604|      0|         m_versions.push_back(Protocol_Version::TLS_V13);
  605|      0|      }
  606|  2.50k|#endif
  607|  2.50k|#if defined(BOTAN_HAS_TLS_12)
  608|  2.50k|      if(offer >= Protocol_Version::TLS_V12 && policy.allow_tls12()) {
  ------------------
  |  Branch (608:10): [True: 2.50k, False: 0]
  |  Branch (608:10): [True: 2.50k, False: 0]
  |  Branch (608:48): [True: 2.50k, False: 0]
  ------------------
  609|  2.50k|         m_versions.push_back(Protocol_Version::TLS_V12);
  610|  2.50k|      }
  611|  2.50k|#endif
  612|  2.50k|   }
  613|  2.50k|}
_ZN5Botan3TLS18Supported_VersionsC2ERNS0_15TLS_Data_ReaderEtNS0_15Connection_SideE:
  615|     24|Supported_Versions::Supported_Versions(TLS_Data_Reader& reader, uint16_t extension_size, Connection_Side from) {
  616|     24|   if(from == Connection_Side::Server) {
  ------------------
  |  Branch (616:7): [True: 24, False: 0]
  ------------------
  617|     24|      if(extension_size != 2) {
  ------------------
  |  Branch (617:10): [True: 13, False: 11]
  ------------------
  618|     13|         throw Decoding_Error("Server sent invalid supported_versions extension");
  619|     13|      }
  620|     11|      m_versions.push_back(Protocol_Version(reader.get_uint16_t()));
  621|     11|   } else {
  622|      0|      auto versions = reader.get_range<uint16_t>(1, 1, 127);
  623|       |
  624|      0|      for(auto v : versions) {
  ------------------
  |  Branch (624:18): [True: 0, False: 0]
  ------------------
  625|      0|         m_versions.push_back(Protocol_Version(v));
  626|      0|      }
  627|       |
  628|      0|      if(extension_size != 1 + 2 * versions.size()) {
  ------------------
  |  Branch (628:10): [True: 0, False: 0]
  ------------------
  629|      0|         throw Decoding_Error("Client sent invalid supported_versions extension");
  630|      0|      }
  631|      0|   }
  632|     24|}
_ZN5Botan3TLS17Record_Size_LimitC2ERNS0_15TLS_Data_ReaderEtNS0_15Connection_SideE:
  649|     40|Record_Size_Limit::Record_Size_Limit(TLS_Data_Reader& reader, uint16_t extension_size, Connection_Side from) {
  650|     40|   if(extension_size != 2) {
  ------------------
  |  Branch (650:7): [True: 3, False: 37]
  ------------------
  651|      3|      throw TLS_Exception(Alert::DecodeError, "invalid record_size_limit extension");
  652|      3|   }
  653|       |
  654|     37|   m_limit = reader.get_uint16_t();
  655|       |
  656|       |   // RFC 8449 4.
  657|       |   //    This value is the length of the plaintext of a protected record.
  658|       |   //    The value includes the content type and padding added in TLS 1.3 (that
  659|       |   //    is, the complete length of TLSInnerPlaintext).
  660|       |   //
  661|       |   //    A server MUST NOT enforce this restriction; a client might advertise
  662|       |   //    a higher limit that is enabled by an extension or version the server
  663|       |   //    does not understand. A client MAY abort the handshake with an
  664|       |   //    "illegal_parameter" alert.
  665|       |   //
  666|       |   // Note: We are currently supporting this extension in TLS 1.3 only, hence
  667|       |   //       we check for the TLS 1.3 limit. The TLS 1.2 limit would not include
  668|       |   //       the "content type byte" and hence be one byte less!
  669|     37|   if(m_limit > MAX_PLAINTEXT_SIZE + 1 /* encrypted content type byte */ && from == Connection_Side::Server) {
  ------------------
  |  Branch (669:7): [True: 3, False: 34]
  |  Branch (669:77): [True: 3, False: 0]
  ------------------
  670|      3|      throw TLS_Exception(Alert::IllegalParameter,
  671|      3|                          "Server requested a record size limit larger than the protocol's maximum");
  672|      3|   }
  673|       |
  674|       |   // RFC 8449 4.
  675|       |   //    Endpoints MUST NOT send a "record_size_limit" extension with a value
  676|       |   //    smaller than 64.  An endpoint MUST treat receipt of a smaller value
  677|       |   //    as a fatal error and generate an "illegal_parameter" alert.
  678|     34|   if(m_limit < 64) {
  ------------------
  |  Branch (678:7): [True: 7, False: 27]
  ------------------
  679|      7|      throw TLS_Exception(Alert::IllegalParameter, "Received a record size limit smaller than 64 bytes");
  680|      7|   }
  681|     34|}
_ZN5Botan3TLS6CookieC2ERNS0_15TLS_Data_ReaderEt:
  695|     93|Cookie::Cookie(TLS_Data_Reader& reader, uint16_t extension_size) {
  696|     93|   if(extension_size == 0) {
  ------------------
  |  Branch (696:7): [True: 36, False: 57]
  ------------------
  697|     36|      return;
  698|     36|   }
  699|       |
  700|     57|   const uint16_t len = reader.get_uint16_t();
  701|       |
  702|     57|   if(len == 0) {
  ------------------
  |  Branch (702:7): [True: 1, False: 56]
  ------------------
  703|       |      // Based on RFC 8446 4.2.2, len of the Cookie buffer must be at least 1
  704|      1|      throw Decoding_Error("Cookie length must be at least 1 byte");
  705|      1|   }
  706|       |
  707|     56|   if(len > reader.remaining_bytes()) {
  ------------------
  |  Branch (707:7): [True: 22, False: 34]
  ------------------
  708|     22|      throw Decoding_Error("Not enough bytes in the buffer to decode Cookie");
  709|     22|   }
  710|       |
  711|  4.85k|   for(size_t i = 0; i < len; ++i) {
  ------------------
  |  Branch (711:22): [True: 4.82k, False: 34]
  ------------------
  712|  4.82k|      m_cookie.push_back(reader.get_byte());
  713|  4.82k|   }
  714|     34|}
_ZN5Botan3TLS22PSK_Key_Exchange_ModesC2ERNS0_15TLS_Data_ReaderEt:
  743|     76|PSK_Key_Exchange_Modes::PSK_Key_Exchange_Modes(TLS_Data_Reader& reader, uint16_t extension_size) {
  744|     76|   if(extension_size < 2) {
  ------------------
  |  Branch (744:7): [True: 1, False: 75]
  ------------------
  745|      1|      throw Decoding_Error("Empty psk_key_exchange_modes extension is illegal");
  746|      1|   }
  747|       |
  748|     75|   const auto mode_count = reader.get_byte();
  749|  2.59k|   for(uint16_t i = 0; i < mode_count; ++i) {
  ------------------
  |  Branch (749:24): [True: 2.52k, False: 75]
  ------------------
  750|  2.52k|      const auto mode = static_cast<PSK_Key_Exchange_Mode>(reader.get_byte());
  751|  2.52k|      if(mode == PSK_Key_Exchange_Mode::PSK_KE || mode == PSK_Key_Exchange_Mode::PSK_DHE_KE) {
  ------------------
  |  Branch (751:10): [True: 1.00k, False: 1.51k]
  |  Branch (751:51): [True: 408, False: 1.10k]
  ------------------
  752|  1.37k|         m_modes.push_back(mode);
  753|  1.37k|      }
  754|  2.52k|   }
  755|     75|}
_ZN5Botan3TLS23Certificate_AuthoritiesC2ERNS0_15TLS_Data_ReaderEt:
  761|    929|Certificate_Authorities::Certificate_Authorities(TLS_Data_Reader& reader, uint16_t extension_size) {
  762|    929|   if(extension_size < 2) {
  ------------------
  |  Branch (762:7): [True: 2, False: 927]
  ------------------
  763|      2|      throw Decoding_Error("Empty certificate_authorities extension is illegal");
  764|      2|   }
  765|       |
  766|    927|   const uint16_t purported_size = reader.get_uint16_t();
  767|       |
  768|    927|   if(reader.remaining_bytes() != purported_size) {
  ------------------
  |  Branch (768:7): [True: 27, False: 900]
  ------------------
  769|     27|      throw Decoding_Error("Inconsistent length in certificate_authorities extension");
  770|     27|   }
  771|       |
  772|  2.78k|   while(reader.has_remaining()) {
  ------------------
  |  Branch (772:10): [True: 1.88k, False: 900]
  ------------------
  773|  1.88k|      std::vector<uint8_t> name_bits = reader.get_tls_length_value(2);
  774|       |
  775|  1.88k|      BER_Decoder decoder(name_bits.data(), name_bits.size());
  776|  1.88k|      m_distinguished_names.emplace_back();
  777|  1.88k|      decoder.decode(m_distinguished_names.back());
  778|  1.88k|   }
  779|    900|}
_ZN5Botan3TLS19EarlyDataIndicationC2ERNS0_15TLS_Data_ReaderEtNS0_14Handshake_TypeE:
  798|     32|                                         Handshake_Type message_type) {
  799|     32|   if(message_type == Handshake_Type::NewSessionTicket) {
  ------------------
  |  Branch (799:7): [True: 0, False: 32]
  ------------------
  800|      0|      if(extension_size != 4) {
  ------------------
  |  Branch (800:10): [True: 0, False: 0]
  ------------------
  801|      0|         throw TLS_Exception(Alert::DecodeError,
  802|      0|                             "Received an early_data extension in a NewSessionTicket message "
  803|      0|                             "without maximum early data size indication");
  804|      0|      }
  805|       |
  806|      0|      m_max_early_data_size = reader.get_uint32_t();
  807|     32|   } else if(extension_size != 0) {
  ------------------
  |  Branch (807:14): [True: 7, False: 25]
  ------------------
  808|      7|      throw TLS_Exception(Alert::DecodeError,
  809|      7|                          "Received an early_data extension containing an unexpected data "
  810|      7|                          "size indication");
  811|      7|   }
  812|     32|}
tls_extensions.cpp:_ZN5Botan3TLS12_GLOBAL__N_114make_extensionERNS0_15TLS_Data_ReaderENS0_14Extension_CodeENS0_15Connection_SideENS0_14Handshake_TypeE:
   28|  7.12k|                                          const Handshake_Type message_type) {
   29|       |   // This cast is safe because we read exactly a 16 bit length field for
   30|       |   // the extension in Extensions::deserialize
   31|  7.12k|   const uint16_t size = static_cast<uint16_t>(reader.remaining_bytes());
   32|  7.12k|   switch(code) {
  ------------------
  |  Branch (32:11): [True: 5.06k, False: 2.06k]
  ------------------
   33|    207|      case Extension_Code::ServerNameIndication:
  ------------------
  |  Branch (33:7): [True: 207, False: 6.91k]
  ------------------
   34|    207|         return std::make_unique<Server_Name_Indicator>(reader, size);
   35|       |
   36|     94|      case Extension_Code::SupportedGroups:
  ------------------
  |  Branch (36:7): [True: 94, False: 7.03k]
  ------------------
   37|     94|         return std::make_unique<Supported_Groups>(reader, size);
   38|       |
   39|     49|      case Extension_Code::CertificateStatusRequest:
  ------------------
  |  Branch (39:7): [True: 49, False: 7.07k]
  ------------------
   40|     49|         return std::make_unique<Certificate_Status_Request>(reader, size, message_type, from);
   41|       |
   42|     53|      case Extension_Code::EcPointFormats:
  ------------------
  |  Branch (42:7): [True: 53, False: 7.07k]
  ------------------
   43|     53|         return std::make_unique<Supported_Point_Formats>(reader, size);
   44|       |
   45|     38|      case Extension_Code::SafeRenegotiation:
  ------------------
  |  Branch (45:7): [True: 38, False: 7.08k]
  ------------------
   46|     38|         return std::make_unique<Renegotiation_Extension>(reader, size);
   47|       |
   48|     24|      case Extension_Code::SignatureAlgorithms:
  ------------------
  |  Branch (48:7): [True: 24, False: 7.10k]
  ------------------
   49|     24|         return std::make_unique<Signature_Algorithms>(reader, size);
   50|       |
   51|     37|      case Extension_Code::CertSignatureAlgorithms:
  ------------------
  |  Branch (51:7): [True: 37, False: 7.08k]
  ------------------
   52|     37|         return std::make_unique<Signature_Algorithms_Cert>(reader, size);
   53|       |
   54|     38|      case Extension_Code::UseSrtp:
  ------------------
  |  Branch (54:7): [True: 38, False: 7.08k]
  ------------------
   55|     38|         return std::make_unique<SRTP_Protection_Profiles>(reader, size);
   56|       |
   57|    144|      case Extension_Code::ApplicationLayerProtocolNegotiation:
  ------------------
  |  Branch (57:7): [True: 144, False: 6.98k]
  ------------------
   58|    144|         return std::make_unique<Application_Layer_Protocol_Notification>(reader, size, from);
   59|       |
   60|     50|      case Extension_Code::ExtendedMasterSecret:
  ------------------
  |  Branch (60:7): [True: 50, False: 7.07k]
  ------------------
   61|     50|         return std::make_unique<Extended_Master_Secret>(reader, size);
   62|       |
   63|     40|      case Extension_Code::RecordSizeLimit:
  ------------------
  |  Branch (63:7): [True: 40, False: 7.08k]
  ------------------
   64|     40|         return std::make_unique<Record_Size_Limit>(reader, size, from);
   65|       |
   66|     53|      case Extension_Code::EncryptThenMac:
  ------------------
  |  Branch (66:7): [True: 53, False: 7.07k]
  ------------------
   67|     53|         return std::make_unique<Encrypt_then_MAC>(reader, size);
   68|       |
   69|     36|      case Extension_Code::SessionTicket:
  ------------------
  |  Branch (69:7): [True: 36, False: 7.08k]
  ------------------
   70|     36|         return std::make_unique<Session_Ticket_Extension>(reader, size);
   71|       |
   72|     24|      case Extension_Code::SupportedVersions:
  ------------------
  |  Branch (72:7): [True: 24, False: 7.10k]
  ------------------
   73|     24|         return std::make_unique<Supported_Versions>(reader, size, from);
   74|       |
   75|      0|#if defined(BOTAN_HAS_TLS_13)
   76|     21|      case Extension_Code::PresharedKey:
  ------------------
  |  Branch (76:7): [True: 21, False: 7.10k]
  ------------------
   77|     21|         return std::make_unique<PSK>(reader, size, message_type);
   78|       |
   79|     32|      case Extension_Code::EarlyData:
  ------------------
  |  Branch (79:7): [True: 32, False: 7.09k]
  ------------------
   80|     32|         return std::make_unique<EarlyDataIndication>(reader, size, message_type);
   81|       |
   82|     93|      case Extension_Code::Cookie:
  ------------------
  |  Branch (82:7): [True: 93, False: 7.03k]
  ------------------
   83|     93|         return std::make_unique<Cookie>(reader, size);
   84|       |
   85|     76|      case Extension_Code::PskKeyExchangeModes:
  ------------------
  |  Branch (85:7): [True: 76, False: 7.04k]
  ------------------
   86|     76|         return std::make_unique<PSK_Key_Exchange_Modes>(reader, size);
   87|       |
   88|    929|      case Extension_Code::CertificateAuthorities:
  ------------------
  |  Branch (88:7): [True: 929, False: 6.19k]
  ------------------
   89|    929|         return std::make_unique<Certificate_Authorities>(reader, size);
   90|       |
   91|     24|      case Extension_Code::KeyShare:
  ------------------
  |  Branch (91:7): [True: 24, False: 7.10k]
  ------------------
   92|     24|         return std::make_unique<Key_Share>(reader, size, message_type);
   93|  7.12k|#endif
   94|  7.12k|   }
   95|       |
   96|  5.06k|   return std::make_unique<Unknown_Extension>(static_cast<Extension_Code>(code), reader, size);
   97|  7.12k|}
tls_extensions.cpp:_ZZN5Botan3TLS23Supported_Point_FormatsC1ERNS0_15TLS_Data_ReaderEtENK3$_3clEh:
  447|    230|            std::any_of(std::begin(remaining_formats), std::end(remaining_formats), [](uint8_t remaining_format) {
  448|    230|               return static_cast<ECPointFormat>(remaining_format) == UNCOMPRESSED;
  449|    230|            });
tls_extensions.cpp:_ZN5Botan3TLS12_GLOBAL__N_130serialize_signature_algorithmsERKNSt3__16vectorINS0_16Signature_SchemeENS2_9allocatorIS4_EEEE:
  470|  2.50k|std::vector<uint8_t> serialize_signature_algorithms(const std::vector<Signature_Scheme>& schemes) {
  471|  2.50k|   BOTAN_ASSERT(schemes.size() < 256, "Too many signature schemes");
  ------------------
  |  |   51|  2.50k|   do {                                                                                 \
  |  |   52|  2.50k|      if(!(expr))                                                                       \
  |  |  ------------------
  |  |  |  Branch (52:10): [True: 0, False: 2.50k]
  |  |  ------------------
  |  |   53|  2.50k|         Botan::assertion_failure(#expr, assertion_made, __func__, __FILE__, __LINE__); \
  |  |   54|  2.50k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (54:12): [Folded - Ignored]
  |  |  ------------------
  ------------------
  472|       |
  473|  2.50k|   std::vector<uint8_t> buf;
  474|       |
  475|  2.50k|   const uint16_t len = static_cast<uint16_t>(schemes.size() * 2);
  476|       |
  477|  2.50k|   buf.push_back(get_byte<0>(len));
  478|  2.50k|   buf.push_back(get_byte<1>(len));
  479|       |
  480|  22.5k|   for(Signature_Scheme scheme : schemes) {
  ------------------
  |  Branch (480:32): [True: 22.5k, False: 2.50k]
  ------------------
  481|  22.5k|      buf.push_back(get_byte<0>(scheme.wire_code()));
  482|  22.5k|      buf.push_back(get_byte<1>(scheme.wire_code()));
  483|  22.5k|   }
  484|       |
  485|  2.50k|   return buf;
  486|  2.50k|}
tls_extensions.cpp:_ZN5Botan3TLS12_GLOBAL__N_126parse_signature_algorithmsERNS0_15TLS_Data_ReaderEt:
  488|     61|std::vector<Signature_Scheme> parse_signature_algorithms(TLS_Data_Reader& reader, uint16_t extension_size) {
  489|     61|   uint16_t len = reader.get_uint16_t();
  490|       |
  491|     61|   if(len + 2 != extension_size || len % 2 == 1 || len == 0) {
  ------------------
  |  Branch (491:7): [True: 24, False: 37]
  |  Branch (491:36): [True: 1, False: 36]
  |  Branch (491:52): [True: 1, False: 35]
  ------------------
  492|     23|      throw Decoding_Error("Bad encoding on signature algorithms extension");
  493|     23|   }
  494|       |
  495|     38|   std::vector<Signature_Scheme> schemes;
  496|     38|   schemes.reserve(len / 2);
  497|  1.36k|   while(len) {
  ------------------
  |  Branch (497:10): [True: 1.32k, False: 38]
  ------------------
  498|  1.32k|      schemes.emplace_back(reader.get_uint16_t());
  499|  1.32k|      len -= 2;
  500|  1.32k|   }
  501|       |
  502|     38|   return schemes;
  503|     61|}

_ZN5Botan3TLS26Certificate_Status_RequestC2ERNS0_15TLS_Data_ReaderEtNS0_14Handshake_TypeENS0_15Connection_SideE:
   89|     49|                                                       Connection_Side from) {
   90|       |   // This parser needs to take TLS 1.2 and TLS 1.3 into account. The
   91|       |   // extension's content and structure is dependent on the context it
   92|       |   // was sent in (i.e. the enclosing handshake message). Below is a list
   93|       |   // of handshake messages this can appear in.
   94|       |   //
   95|       |   // TLS 1.2
   96|       |   //  * Client Hello
   97|       |   //  * Server Hello
   98|       |   //
   99|       |   // TLS 1.3
  100|       |   //  * Client Hello
  101|       |   //  * Certificate Request
  102|       |   //  * Certificate (Entry)
  103|       |
  104|       |   // RFC 6066 8.
  105|       |   //    In order to indicate their desire to receive certificate status
  106|       |   //    information, clients MAY include an extension of type "status_request"
  107|       |   //    in the (extended) client hello.
  108|     49|   if(message_type == Handshake_Type::ClientHello) {
  ------------------
  |  Branch (108:7): [True: 0, False: 49]
  ------------------
  109|      0|      m_impl = std::make_unique<Certificate_Status_Request_Internal>(
  110|      0|         RFC6066_Certificate_Status_Request(reader, extension_size));
  111|      0|   }
  112|       |
  113|       |   // RFC 6066 8.
  114|       |   //    If a server returns a "CertificateStatus" message, then the server MUST
  115|       |   //    have included an extension of type "status_request" with empty
  116|       |   //    "extension_data" in the extended server hello.
  117|       |   //
  118|       |   // RFC 8446 4.4.2.1
  119|       |   //    A server MAY request that a client present an OCSP response with its
  120|       |   //    certificate by sending an empty "status_request" extension in its
  121|       |   //    CertificateRequest message.
  122|     49|   else if(message_type == Handshake_Type::ServerHello || message_type == Handshake_Type::CertificateRequest) {
  ------------------
  |  Branch (122:12): [True: 48, False: 1]
  |  Branch (122:59): [True: 0, False: 1]
  ------------------
  123|     48|      m_impl = std::make_unique<Certificate_Status_Request_Internal>(
  124|     48|         RFC6066_Empty_Certificate_Status_Request(extension_size));
  125|     48|   }
  126|       |
  127|       |   // RFC 8446 4.4.2.1
  128|       |   //    In TLS 1.3, the server's OCSP information is carried in an extension
  129|       |   //    in the CertificateEntry [in a Certificate handshake message] [...].
  130|       |   //    Specifically, the body of the "status_request" extension from the
  131|       |   //    server MUST be a CertificateStatus structure as defined in [RFC6066]
  132|       |   //    [...].
  133|       |   //
  134|       |   // RFC 8446 4.4.2.1
  135|       |   //    If the client opts to send an OCSP response, the body of its
  136|       |   //    "status_request" extension MUST be a CertificateStatus structure as
  137|       |   //    defined in [RFC6066].
  138|      1|   else if(message_type == Handshake_Type::Certificate) {
  ------------------
  |  Branch (138:12): [True: 0, False: 1]
  ------------------
  139|      0|      m_impl = std::make_unique<Certificate_Status_Request_Internal>(
  140|      0|         Certificate_Status(reader.get_fixed<uint8_t>(extension_size), from));
  141|      0|   }
  142|       |
  143|       |   // all other contexts are not allowed for this extension
  144|      1|   else {
  145|      1|      throw TLS_Exception(Alert::UnsupportedExtension,
  146|      1|                          "Server sent a Certificate_Status_Request extension in an unsupported context");
  147|      1|   }
  148|     49|}
_ZN5Botan3TLS26Certificate_Status_RequestC2ENSt3__16vectorIhNS2_9allocatorIhEEEENS3_IS6_NS4_IS6_EEEE:
  156|  2.50k|         RFC6066_Certificate_Status_Request(std::move(ocsp_responder_ids), std::move(ocsp_key_ids)))) {}
_ZN5Botan3TLS26Certificate_Status_RequestD2Ev:
  161|  2.53k|Certificate_Status_Request::~Certificate_Status_Request() = default;
_ZNK5Botan3TLS26Certificate_Status_Request9serializeENS0_15Connection_SideE:
  169|  2.50k|std::vector<uint8_t> Certificate_Status_Request::serialize(Connection_Side) const {
  170|  2.50k|   BOTAN_ASSERT_NONNULL(m_impl);
  ------------------
  |  |   87|  2.50k|   do {                                                                                   \
  |  |   88|  2.50k|      if((ptr) == nullptr)                                                                \
  |  |  ------------------
  |  |  |  Branch (88:10): [True: 0, False: 2.50k]
  |  |  ------------------
  |  |   89|  2.50k|         Botan::assertion_failure(#ptr " is not null", "", __func__, __FILE__, __LINE__); \
  |  |   90|  2.50k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (90:12): [Folded - Ignored]
  |  |  ------------------
  ------------------
  171|  2.50k|   return std::visit([](const auto& c) { return c.serialize(); }, m_impl->content);
  172|  2.50k|}
tls_extensions_cert_status_req.cpp:_ZN5Botan3TLS12_GLOBAL__N_140RFC6066_Empty_Certificate_Status_RequestC2Et:
   24|     48|      RFC6066_Empty_Certificate_Status_Request(uint16_t extension_size) {
   25|     48|         if(extension_size != 0) {
  ------------------
  |  Branch (25:13): [True: 11, False: 37]
  ------------------
   26|     11|            throw Decoding_Error("Received an unexpectedly non-empty Certificate_Status_Request");
   27|     11|         }
   28|     48|      }
tls_extensions_cert_status_req.cpp:_ZN5Botan3TLS12_GLOBAL__N_134RFC6066_Certificate_Status_RequestC2ENSt3__16vectorIhNS3_9allocatorIhEEEENS4_IS7_NS5_IS7_EEEE:
   36|  2.50k|            ocsp_names(std::move(names)), ocsp_keys(std::move(keys)) {}
tls_extensions_cert_status_req.cpp:_ZZNK5Botan3TLS26Certificate_Status_Request9serializeENS0_15Connection_SideEENK3$_0clINS0_12_GLOBAL__N_134RFC6066_Certificate_Status_RequestEEEDaRKT_:
  171|  2.50k|   return std::visit([](const auto& c) { return c.serialize(); }, m_impl->content);
tls_extensions_cert_status_req.cpp:_ZNK5Botan3TLS12_GLOBAL__N_134RFC6066_Certificate_Status_Request9serializeEv:
   56|  2.50k|      std::vector<uint8_t> serialize() const {
   57|       |         // Serialization is hard-coded as we don't support advanced features
   58|       |         // of this extension anyway.
   59|  2.50k|         return {
   60|  2.50k|            1,  // status_type = ocsp
   61|  2.50k|            0,
   62|  2.50k|            0,  // empty responder_id_list
   63|  2.50k|            0,
   64|  2.50k|            0,  // no extensions
   65|  2.50k|         };
   66|  2.50k|      }
tls_extensions_cert_status_req.cpp:_ZN5Botan3TLS35Certificate_Status_Request_InternalC2ENSt3__17variantIJNS0_12_GLOBAL__N_140RFC6066_Empty_Certificate_Status_RequestENS4_34RFC6066_Certificate_Status_RequestENS0_18Certificate_StatusEEEE:
   81|  2.53k|      Certificate_Status_Request_Internal(Contents c) : content(std::move(c)) {}

_ZN5Botan3TLS21Handshake_Transitions21confirm_transition_toENS0_14Handshake_TypeE:
  131|  2.03k|void Handshake_Transitions::confirm_transition_to(Handshake_Type msg_type) {
  132|  2.03k|   const uint32_t mask = bitmask_for_handshake_type(msg_type);
  133|       |
  134|  2.03k|   m_hand_received_mask |= mask;
  135|       |
  136|  2.03k|   const bool ok = (m_hand_expecting_mask & mask) != 0;  // overlap?
  137|       |
  138|  2.03k|   if(!ok) {
  ------------------
  |  Branch (138:7): [True: 57, False: 1.97k]
  ------------------
  139|     57|      const uint32_t seen_so_far = m_hand_received_mask & ~mask;
  140|       |
  141|     57|      std::ostringstream msg;
  142|       |
  143|     57|      msg << "Unexpected state transition in handshake got a " << handshake_type_to_string(msg_type);
  144|       |
  145|     57|      if(m_hand_expecting_mask == 0) {
  ------------------
  |  Branch (145:10): [True: 2, False: 55]
  ------------------
  146|      2|         msg << " not expecting messages";
  147|     55|      } else {
  148|     55|         msg << " expected " << handshake_mask_to_string(m_hand_expecting_mask, '|');
  149|     55|      }
  150|       |
  151|     57|      if(seen_so_far != 0) {
  ------------------
  |  Branch (151:10): [True: 0, False: 57]
  ------------------
  152|      0|         msg << " seen " << handshake_mask_to_string(seen_so_far, '+');
  153|      0|      }
  154|       |
  155|     57|      throw Unexpected_Message(msg.str());
  156|     57|   }
  157|       |
  158|       |   /* We don't know what to expect next, so force a call to
  159|       |      set_expected_next; if it doesn't happen, the next transition
  160|       |      check will always fail which is what we want.
  161|       |   */
  162|  1.97k|   m_hand_expecting_mask = 0;
  163|  1.97k|}
_ZN5Botan3TLS21Handshake_Transitions17set_expected_nextENS0_14Handshake_TypeE:
  165|  2.50k|void Handshake_Transitions::set_expected_next(Handshake_Type msg_type) {
  166|  2.50k|   m_hand_expecting_mask |= bitmask_for_handshake_type(msg_type);
  167|  2.50k|}
_ZNK5Botan3TLS21Handshake_Transitions27change_cipher_spec_expectedEv:
  175|  5.39k|bool Handshake_Transitions::change_cipher_spec_expected() const {
  176|  5.39k|   return (bitmask_for_handshake_type(Handshake_Type::HandshakeCCS) & m_hand_expecting_mask) != 0;
  177|  5.39k|}
tls_handshake_transitions.cpp:_ZN5Botan3TLS12_GLOBAL__N_126bitmask_for_handshake_typeENS0_14Handshake_TypeE:
   19|  10.9k|uint32_t bitmask_for_handshake_type(Handshake_Type type) {
   20|  10.9k|   switch(type) {
  ------------------
  |  Branch (20:11): [True: 15, False: 10.9k]
  ------------------
   21|     57|      case Handshake_Type::HelloVerifyRequest:
  ------------------
  |  Branch (21:7): [True: 57, False: 10.8k]
  ------------------
   22|     57|         return (1 << 0);
   23|       |
   24|     74|      case Handshake_Type::HelloRequest:
  ------------------
  |  Branch (24:7): [True: 74, False: 10.8k]
  ------------------
   25|     74|         return (1 << 1);
   26|       |
   27|     57|      case Handshake_Type::ClientHello:
  ------------------
  |  Branch (27:7): [True: 57, False: 10.8k]
  ------------------
   28|     57|         return (1 << 2);
   29|       |
   30|  4.51k|      case Handshake_Type::ServerHello:
  ------------------
  |  Branch (30:7): [True: 4.51k, False: 6.40k]
  ------------------
   31|  4.51k|         return (1 << 3);
   32|       |
   33|     59|      case Handshake_Type::Certificate:
  ------------------
  |  Branch (33:7): [True: 59, False: 10.8k]
  ------------------
   34|     59|         return (1 << 4);
   35|       |
   36|     57|      case Handshake_Type::CertificateUrl:
  ------------------
  |  Branch (36:7): [True: 57, False: 10.8k]
  ------------------
   37|     57|         return (1 << 5);
   38|       |
   39|     57|      case Handshake_Type::CertificateStatus:
  ------------------
  |  Branch (39:7): [True: 57, False: 10.8k]
  ------------------
   40|     57|         return (1 << 6);
   41|       |
   42|     56|      case Handshake_Type::ServerKeyExchange:
  ------------------
  |  Branch (42:7): [True: 56, False: 10.8k]
  ------------------
   43|     56|         return (1 << 7);
   44|       |
   45|     56|      case Handshake_Type::CertificateRequest:
  ------------------
  |  Branch (45:7): [True: 56, False: 10.8k]
  ------------------
   46|     56|         return (1 << 8);
   47|       |
   48|     58|      case Handshake_Type::ServerHelloDone:
  ------------------
  |  Branch (48:7): [True: 58, False: 10.8k]
  ------------------
   49|     58|         return (1 << 9);
   50|       |
   51|     56|      case Handshake_Type::CertificateVerify:
  ------------------
  |  Branch (51:7): [True: 56, False: 10.8k]
  ------------------
   52|     56|         return (1 << 10);
   53|       |
   54|     59|      case Handshake_Type::ClientKeyExchange:
  ------------------
  |  Branch (54:7): [True: 59, False: 10.8k]
  ------------------
   55|     59|         return (1 << 11);
   56|       |
   57|     56|      case Handshake_Type::NewSessionTicket:
  ------------------
  |  Branch (57:7): [True: 56, False: 10.8k]
  ------------------
   58|     56|         return (1 << 12);
   59|       |
   60|  5.45k|      case Handshake_Type::HandshakeCCS:
  ------------------
  |  Branch (60:7): [True: 5.45k, False: 5.46k]
  ------------------
   61|  5.45k|         return (1 << 13);
   62|       |
   63|     56|      case Handshake_Type::Finished:
  ------------------
  |  Branch (63:7): [True: 56, False: 10.8k]
  ------------------
   64|     56|         return (1 << 14);
   65|       |
   66|     57|      case Handshake_Type::EndOfEarlyData:  // RFC 8446
  ------------------
  |  Branch (66:7): [True: 57, False: 10.8k]
  ------------------
   67|     57|         return (1 << 15);
   68|       |
   69|     59|      case Handshake_Type::EncryptedExtensions:  // RFC 8446
  ------------------
  |  Branch (69:7): [True: 59, False: 10.8k]
  ------------------
   70|     59|         return (1 << 16);
   71|       |
   72|     57|      case Handshake_Type::KeyUpdate:  // RFC 8446
  ------------------
  |  Branch (72:7): [True: 57, False: 10.8k]
  ------------------
   73|     57|         return (1 << 17);
   74|       |
   75|      2|      case Handshake_Type::HelloRetryRequest:  // RFC 8446
  ------------------
  |  Branch (75:7): [True: 2, False: 10.9k]
  ------------------
   76|      2|         return (1 << 18);
   77|       |
   78|       |      // allow explicitly disabling new handshakes
   79|      0|      case Handshake_Type::None:
  ------------------
  |  Branch (79:7): [True: 0, False: 10.9k]
  ------------------
   80|      0|         return 0;
   81|  10.9k|   }
   82|       |
   83|     15|   throw TLS_Exception(Alert::UnexpectedMessage,
   84|     15|                       "Unknown TLS handshake message type " + std::to_string(static_cast<size_t>(type)));
   85|  10.9k|}
tls_handshake_transitions.cpp:_ZN5Botan3TLS12_GLOBAL__N_124handshake_mask_to_stringEjc:
   87|     55|std::string handshake_mask_to_string(uint32_t mask, char combiner) {
   88|     55|   const Handshake_Type types[] = {Handshake_Type::HelloVerifyRequest,
   89|     55|                                   Handshake_Type::HelloRequest,
   90|     55|                                   Handshake_Type::ClientHello,
   91|     55|                                   Handshake_Type::ServerHello,
   92|     55|                                   Handshake_Type::Certificate,
   93|     55|                                   Handshake_Type::CertificateUrl,
   94|     55|                                   Handshake_Type::CertificateStatus,
   95|     55|                                   Handshake_Type::ServerKeyExchange,
   96|     55|                                   Handshake_Type::CertificateRequest,
   97|     55|                                   Handshake_Type::ServerHelloDone,
   98|     55|                                   Handshake_Type::CertificateVerify,
   99|     55|                                   Handshake_Type::ClientKeyExchange,
  100|     55|                                   Handshake_Type::NewSessionTicket,
  101|     55|                                   Handshake_Type::HandshakeCCS,
  102|     55|                                   Handshake_Type::Finished,
  103|     55|                                   Handshake_Type::EndOfEarlyData,
  104|     55|                                   Handshake_Type::EncryptedExtensions,
  105|     55|                                   Handshake_Type::KeyUpdate};
  106|       |
  107|     55|   std::ostringstream o;
  108|     55|   bool empty = true;
  109|       |
  110|    990|   for(auto&& t : types) {
  ------------------
  |  Branch (110:17): [True: 990, False: 55]
  ------------------
  111|    990|      if(mask & bitmask_for_handshake_type(t)) {
  ------------------
  |  Branch (111:10): [True: 55, False: 935]
  ------------------
  112|     55|         if(!empty) {
  ------------------
  |  Branch (112:13): [True: 0, False: 55]
  ------------------
  113|      0|            o << combiner;
  114|      0|         }
  115|     55|         o << handshake_type_to_string(t);
  116|     55|         empty = false;
  117|     55|      }
  118|    990|   }
  119|       |
  120|     55|   return o.str();
  121|     55|}

_ZNK5Botan3TLS6Policy25allowed_signature_schemesEv:
   23|  2.50k|std::vector<Signature_Scheme> Policy::allowed_signature_schemes() const {
   24|  2.50k|   std::vector<Signature_Scheme> schemes;
   25|       |
   26|  22.5k|   for(Signature_Scheme scheme : Signature_Scheme::all_available_schemes()) {
  ------------------
  |  Branch (26:32): [True: 22.5k, False: 2.50k]
  ------------------
   27|  22.5k|      const bool sig_allowed = allowed_signature_method(scheme.algorithm_name());
   28|  22.5k|      const bool hash_allowed = allowed_signature_hash(scheme.hash_function_name());
   29|       |
   30|  22.5k|      if(sig_allowed && hash_allowed) {
  ------------------
  |  Branch (30:10): [True: 22.5k, False: 0]
  |  Branch (30:25): [True: 22.5k, False: 0]
  ------------------
   31|  22.5k|         schemes.push_back(scheme);
   32|  22.5k|      }
   33|  22.5k|   }
   34|       |
   35|  2.50k|   return schemes;
   36|  2.50k|}
_ZNK5Botan3TLS6Policy28acceptable_signature_schemesEv:
   38|  2.50k|std::vector<Signature_Scheme> Policy::acceptable_signature_schemes() const { return this->allowed_signature_schemes(); }
_ZNK5Botan3TLS6Policy40acceptable_certificate_signature_schemesEv:
   40|  2.50k|std::optional<std::vector<Signature_Scheme>> Policy::acceptable_certificate_signature_schemes() const {
   41|       |   // the restrictions of ::acceptable_signature_schemes() shall apply
   42|  2.50k|   return std::nullopt;
   43|  2.50k|}
_ZNK5Botan3TLS6Policy24allowed_signature_hashesEv:
   65|  22.5k|std::vector<std::string> Policy::allowed_signature_hashes() const {
   66|  22.5k|   return {
   67|  22.5k|      "SHA-512",
   68|  22.5k|      "SHA-384",
   69|  22.5k|      "SHA-256",
   70|  22.5k|   };
   71|  22.5k|}
_ZNK5Botan3TLS6Policy25allowed_signature_methodsEv:
   97|  22.5k|std::vector<std::string> Policy::allowed_signature_methods() const {
   98|  22.5k|   return {
   99|  22.5k|      "ECDSA", "RSA",
  100|       |      //"IMPLICIT",
  101|  22.5k|   };
  102|  22.5k|}
_ZNK5Botan3TLS6Policy24allowed_signature_methodENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEE:
  104|  22.5k|bool Policy::allowed_signature_method(std::string_view sig_method) const {
  105|  22.5k|   return value_exists(allowed_signature_methods(), sig_method);
  106|  22.5k|}
_ZNK5Botan3TLS6Policy22allowed_signature_hashENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEE:
  108|  22.5k|bool Policy::allowed_signature_hash(std::string_view sig_hash) const {
  109|  22.5k|   return value_exists(allowed_signature_hashes(), sig_hash);
  110|  22.5k|}
_ZNK5Botan3TLS6Policy25use_ecc_point_compressionEv:
  112|  2.50k|bool Policy::use_ecc_point_compression() const { return false; }
_ZNK5Botan3TLS6Policy19key_exchange_groupsEv:
  154|  2.50k|std::vector<Group_Params> Policy::key_exchange_groups() const {
  155|       |   // Default list is ordered by performance
  156|  2.50k|   return {
  157|  2.50k|#if defined(BOTAN_HAS_CURVE_25519)
  158|  2.50k|      Group_Params::X25519,
  159|  2.50k|#endif
  160|       |
  161|  2.50k|         Group_Params::SECP256R1, Group_Params::BRAINPOOL256R1, Group_Params::SECP384R1, Group_Params::BRAINPOOL384R1,
  162|  2.50k|         Group_Params::SECP521R1, Group_Params::BRAINPOOL512R1,
  163|       |
  164|  2.50k|         Group_Params::FFDHE_2048, Group_Params::FFDHE_3072, Group_Params::FFDHE_4096, Group_Params::FFDHE_6144,
  165|  2.50k|         Group_Params::FFDHE_8192,
  166|  2.50k|   };
  167|  2.50k|}
_ZNK5Botan3TLS6Policy40maximum_session_tickets_per_client_helloEv:
  232|  5.00k|size_t Policy::maximum_session_tickets_per_client_hello() const { return 1; }
_ZNK5Botan3TLS6Policy23session_ticket_lifetimeEv:
  234|  5.00k|std::chrono::seconds Policy::session_ticket_lifetime() const { return std::chrono::days(1); }
_ZNK5Botan3TLS6Policy21reuse_session_ticketsEv:
  236|  2.50k|bool Policy::reuse_session_tickets() const { return false; }
_ZNK5Botan3TLS6Policy27acceptable_protocol_versionENS0_16Protocol_VersionE:
  240|  5.00k|bool Policy::acceptable_protocol_version(Protocol_Version version) const {
  241|  5.00k|#if defined(BOTAN_HAS_TLS_13)
  242|  5.00k|   if(version == Protocol_Version::TLS_V13 && allow_tls13()) {
  ------------------
  |  Branch (242:7): [True: 0, False: 5.00k]
  |  Branch (242:7): [True: 0, False: 5.00k]
  |  Branch (242:47): [True: 0, False: 0]
  ------------------
  243|      0|      return true;
  244|      0|   }
  245|  5.00k|#endif
  246|       |
  247|  5.00k|#if defined(BOTAN_HAS_TLS_12)
  248|  5.00k|   if(version == Protocol_Version::TLS_V12 && allow_tls12()) {
  ------------------
  |  Branch (248:7): [True: 5.00k, False: 0]
  |  Branch (248:7): [True: 5.00k, False: 0]
  |  Branch (248:47): [True: 5.00k, False: 0]
  ------------------
  249|  5.00k|      return true;
  250|  5.00k|   }
  251|       |
  252|      0|   if(version == Protocol_Version::DTLS_V12 && allow_dtls12()) {
  ------------------
  |  Branch (252:7): [True: 0, False: 0]
  |  Branch (252:7): [True: 0, False: 0]
  |  Branch (252:48): [True: 0, False: 0]
  ------------------
  253|      0|      return true;
  254|      0|   }
  255|      0|#endif
  256|       |
  257|      0|   return false;
  258|      0|}
_ZNK5Botan3TLS6Policy11allow_tls12Ev:
  290|  10.0k|bool Policy::allow_tls12() const {
  291|  10.0k|#if defined(BOTAN_HAS_TLS_12)
  292|  10.0k|   return true;
  293|       |#else
  294|       |   return false;
  295|       |#endif
  296|  10.0k|}
_ZNK5Botan3TLS6Policy28include_time_in_hello_randomEv:
  314|  2.50k|bool Policy::include_time_in_hello_random() const { return true; }
_ZNK5Botan3TLS6Policy26negotiate_encrypt_then_macEv:
  320|  2.50k|bool Policy::negotiate_encrypt_then_mac() const { return true; }
_ZNK5Botan3TLS6Policy27support_cert_status_messageEv:
  324|  2.50k|bool Policy::support_cert_status_message() const { return true; }
_ZNK5Botan3TLS6Policy17hash_hello_randomEv:
  330|  2.50k|bool Policy::hash_hello_random() const { return true; }

_ZN5Botan3TLS15Session_ManagerC2ERKNSt3__110shared_ptrINS_21RandomNumberGeneratorEEE:
   17|  2.50k|Session_Manager::Session_Manager(const std::shared_ptr<RandomNumberGenerator>& rng) : m_rng(rng) {
   18|  2.50k|   BOTAN_ASSERT_NONNULL(m_rng);
  ------------------
  |  |   87|  2.50k|   do {                                                                                   \
  |  |   88|  2.50k|      if((ptr) == nullptr)                                                                \
  |  |  ------------------
  |  |  |  Branch (88:10): [True: 0, False: 2.50k]
  |  |  ------------------
  |  |   89|  2.50k|         Botan::assertion_failure(#ptr " is not null", "", __func__, __FILE__, __LINE__); \
  |  |   90|  2.50k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (90:12): [Folded - Ignored]
  |  |  ------------------
  ------------------
   19|  2.50k|}
_ZN5Botan3TLS15Session_Manager15find_and_filterERKNS0_18Server_InformationERNS0_9CallbacksERKNS0_6PolicyE:
   84|  2.50k|                                                                  const Policy& policy) {
   85|       |   // A value of '0' means: No policy restrictions. Session ticket lifetimes as
   86|       |   // communicated by the server apply regardless.
   87|  2.50k|   const std::chrono::seconds policy_lifetime =
   88|  2.50k|      (policy.session_ticket_lifetime().count() > 0) ? policy.session_ticket_lifetime() : std::chrono::seconds::max();
  ------------------
  |  Branch (88:7): [True: 2.50k, False: 0]
  ------------------
   89|       |
   90|  2.50k|   const size_t max_sessions_hint = std::max(policy.maximum_session_tickets_per_client_hello(), size_t(1));
   91|  2.50k|   const auto now = callbacks.tls_current_timestamp();
   92|       |
   93|       |   // An arbitrary number of loop iterations to perform before giving up
   94|       |   // to avoid a potential endless loop with a misbehaving session manager.
   95|  2.50k|   constexpr unsigned int max_attempts = 10;
   96|  2.50k|   std::vector<Session_with_Handle> sessions_and_handles;
   97|       |
   98|       |   // Query the session manager implementation for new sessions until at least
   99|       |   // one session passes the filter or no more sessions are found.
  100|  2.50k|   for(unsigned int attempt = 0; attempt < max_attempts && sessions_and_handles.empty(); ++attempt) {
  ------------------
  |  Branch (100:34): [True: 2.50k, False: 0]
  |  Branch (100:60): [True: 2.50k, False: 0]
  ------------------
  101|  2.50k|      sessions_and_handles = find_some(info, max_sessions_hint);
  102|       |
  103|       |      // ... underlying implementation didn't find anything. Early exit.
  104|  2.50k|      if(sessions_and_handles.empty()) {
  ------------------
  |  Branch (104:10): [True: 2.50k, False: 0]
  ------------------
  105|  2.50k|         break;
  106|  2.50k|      }
  107|       |
  108|       |      // TODO: C++20, use std::ranges::remove_if() once XCode and Android NDK caught up.
  109|      0|      sessions_and_handles.erase(
  110|      0|         std::remove_if(sessions_and_handles.begin(),
  111|      0|                        sessions_and_handles.end(),
  112|      0|                        [&](const auto& session) {
  113|      0|                           const auto age =
  114|      0|                              std::chrono::duration_cast<std::chrono::seconds>(now - session.session.start_time());
  115|       |
  116|       |                           // RFC 5077 3.3 -- "Old Session Tickets"
  117|       |                           //    The ticket_lifetime_hint field contains a hint from the
  118|       |                           //    server about how long the ticket should be stored. [...]
  119|       |                           //    A client SHOULD delete the ticket and associated state when
  120|       |                           //    the time expires. It MAY delete the ticket earlier based on
  121|       |                           //    local policy.
  122|       |                           //
  123|       |                           // RFC 5246 F.1.4 -- TLS 1.2
  124|       |                           //    If either party suspects that the session may have been
  125|       |                           //    compromised, or that certificates may have expired or been
  126|       |                           //    revoked, it should force a full handshake.  An upper limit of
  127|       |                           //    24 hours is suggested for session ID lifetimes.
  128|       |                           //
  129|       |                           // RFC 8446 4.2.11.1 -- TLS 1.3
  130|       |                           //    The client's view of the age of a ticket is the time since the
  131|       |                           //    receipt of the NewSessionTicket message.  Clients MUST NOT
  132|       |                           //    attempt to use tickets which have ages greater than the
  133|       |                           //    "ticket_lifetime" value which was provided with the ticket.
  134|       |                           //
  135|       |                           // RFC 8446 4.6.1 -- TLS 1.3
  136|       |                           //    Clients MUST NOT cache tickets for longer than 7 days,
  137|       |                           //    regardless of the ticket_lifetime, and MAY delete tickets
  138|       |                           //    earlier based on local policy.
  139|       |                           //
  140|       |                           // Note: TLS 1.3 tickets with a lifetime longer than 7 days are
  141|       |                           //       rejected during parsing with an "Illegal Parameter" alert.
  142|       |                           //       Other suggestions are left to the application via
  143|       |                           //       Policy::session_ticket_lifetime(). Session lifetimes as
  144|       |                           //       communicated by the server via the "lifetime_hint" are
  145|       |                           //       obeyed regardless of the policy setting.
  146|      0|                           const auto session_lifetime_hint = session.session.lifetime_hint();
  147|      0|                           const bool expired = age > std::min(policy_lifetime, session_lifetime_hint);
  148|       |
  149|      0|                           if(expired) {
  150|      0|                              remove(session.handle);
  151|      0|                           }
  152|       |
  153|      0|                           return expired;
  154|      0|                        }),
  155|      0|         sessions_and_handles.end());
  156|      0|   }
  157|       |
  158|  2.50k|   return sessions_and_handles;
  159|  2.50k|}
_ZN5Botan3TLS15Session_Manager4findERKNS0_18Server_InformationERNS0_9CallbacksERKNS0_6PolicyE:
  163|  2.50k|                                                       const Policy& policy) {
  164|  2.50k|   auto allow_reusing_tickets = policy.reuse_session_tickets();
  165|       |
  166|       |   // Session_Manager::find() must be an atomic getter if ticket reuse is not
  167|       |   // allowed. I.e. each ticket handed to concurrently requesting threads must
  168|       |   // be unique. In that case we must hold a lock while retrieving a ticket.
  169|       |   // Otherwise, no locking is required on this level.
  170|  2.50k|   std::optional<lock_guard_type<recursive_mutex_type>> lk;
  171|  2.50k|   if(!allow_reusing_tickets) {
  ------------------
  |  Branch (171:7): [True: 2.50k, False: 0]
  ------------------
  172|  2.50k|      lk.emplace(mutex());
  173|  2.50k|   }
  174|       |
  175|  2.50k|   auto sessions_and_handles = find_and_filter(info, callbacks, policy);
  176|       |
  177|       |   // std::vector::resize() cannot be used as the vector's members aren't
  178|       |   // default constructible.
  179|  2.50k|   const auto session_limit = policy.maximum_session_tickets_per_client_hello();
  180|  2.50k|   while(session_limit > 0 && sessions_and_handles.size() > session_limit) {
  ------------------
  |  Branch (180:10): [True: 2.50k, False: 0]
  |  Branch (180:31): [True: 0, False: 2.50k]
  ------------------
  181|      0|      sessions_and_handles.pop_back();
  182|      0|   }
  183|       |
  184|       |   // RFC 8446 Appendix C.4
  185|       |   //    Clients SHOULD NOT reuse a ticket for multiple connections. Reuse of
  186|       |   //    a ticket allows passive observers to correlate different connections.
  187|       |   //
  188|       |   // When reuse of session tickets is not allowed, remove all tickets to be
  189|       |   // returned from the implementation's internal storage.
  190|  2.50k|   if(!allow_reusing_tickets) {
  ------------------
  |  Branch (190:7): [True: 2.50k, False: 0]
  ------------------
  191|       |      // The lock must be held here, otherwise we cannot guarantee the
  192|       |      // transactional retrieval of tickets to concurrently requesting clients.
  193|  2.50k|      BOTAN_ASSERT_NOMSG(lk.has_value());
  ------------------
  |  |   60|  2.50k|   do {                                                                     \
  |  |   61|  2.50k|      if(!(expr))                                                           \
  |  |  ------------------
  |  |  |  Branch (61:10): [True: 0, False: 2.50k]
  |  |  ------------------
  |  |   62|  2.50k|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   63|  2.50k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (63:12): [Folded - Ignored]
  |  |  ------------------
  ------------------
  194|  2.50k|      for(const auto& [session, handle] : sessions_and_handles) {
  ------------------
  |  Branch (194:41): [True: 0, False: 2.50k]
  ------------------
  195|      0|         if(!session.version().is_pre_tls_13() || !handle.is_id()) {
  ------------------
  |  Branch (195:13): [True: 0, False: 0]
  |  Branch (195:13): [True: 0, False: 0]
  |  Branch (195:51): [True: 0, False: 0]
  ------------------
  196|      0|            remove(handle);
  197|      0|         }
  198|      0|      }
  199|  2.50k|   }
  200|       |
  201|  2.50k|   return sessions_and_handles;
  202|  2.50k|}

_ZN5Botan3TLS20Session_Manager_NoopC2Ev:
   15|  2.50k|Session_Manager_Noop::Session_Manager_Noop() : Session_Manager(std::make_shared<Null_RNG>()) {}

_ZN5Botan3TLS16Signature_Scheme21all_available_schemesEv:
   21|  2.50k|const std::vector<Signature_Scheme>& Signature_Scheme::all_available_schemes() {
   22|       |   /*
   23|       |   * This is ordered in some approximate order of preference
   24|       |   */
   25|  2.50k|   static const std::vector<Signature_Scheme> all_schemes = {
   26|       |
   27|       |      // EdDSA 25519 is currently not supported as a signature scheme for certificates
   28|       |      // certificate authentication.
   29|       |      // See: https://github.com/randombit/botan/pull/2958#discussion_r851294715
   30|       |      //
   31|       |      // #if defined(BOTAN_HAS_ED25519)
   32|       |      //       EDDSA_25519,
   33|       |      // #endif
   34|       |
   35|  2.50k|      RSA_PSS_SHA384,
   36|  2.50k|      RSA_PSS_SHA256,
   37|  2.50k|      RSA_PSS_SHA512,
   38|       |
   39|  2.50k|      RSA_PKCS1_SHA384,
   40|  2.50k|      RSA_PKCS1_SHA512,
   41|  2.50k|      RSA_PKCS1_SHA256,
   42|       |
   43|  2.50k|      ECDSA_SHA384,
   44|  2.50k|      ECDSA_SHA512,
   45|  2.50k|      ECDSA_SHA256,
   46|  2.50k|   };
   47|       |
   48|  2.50k|   return all_schemes;
   49|  2.50k|}
_ZN5Botan3TLS16Signature_SchemeC2Et:
   53|  1.32k|Signature_Scheme::Signature_Scheme(uint16_t wire_code) : Signature_Scheme(Signature_Scheme::Code(wire_code)) {}
_ZN5Botan3TLS16Signature_SchemeC2ENS1_4CodeE:
   55|  1.33k|Signature_Scheme::Signature_Scheme(Signature_Scheme::Code wire_code) : m_code(wire_code) {}
_ZNK5Botan3TLS16Signature_Scheme18hash_function_nameEv:
  100|  22.5k|std::string Signature_Scheme::hash_function_name() const noexcept {
  101|  22.5k|   switch(m_code) {
  102|      0|      case RSA_PKCS1_SHA1:
  ------------------
  |  Branch (102:7): [True: 0, False: 22.5k]
  ------------------
  103|      0|      case ECDSA_SHA1:
  ------------------
  |  Branch (103:7): [True: 0, False: 22.5k]
  ------------------
  104|      0|         return "SHA-1";
  105|       |
  106|  2.50k|      case ECDSA_SHA256:
  ------------------
  |  Branch (106:7): [True: 2.50k, False: 20.0k]
  ------------------
  107|  5.00k|      case RSA_PKCS1_SHA256:
  ------------------
  |  Branch (107:7): [True: 2.50k, False: 20.0k]
  ------------------
  108|  7.50k|      case RSA_PSS_SHA256:
  ------------------
  |  Branch (108:7): [True: 2.50k, False: 20.0k]
  ------------------
  109|  7.50k|         return "SHA-256";
  110|       |
  111|  2.50k|      case ECDSA_SHA384:
  ------------------
  |  Branch (111:7): [True: 2.50k, False: 20.0k]
  ------------------
  112|  5.00k|      case RSA_PKCS1_SHA384:
  ------------------
  |  Branch (112:7): [True: 2.50k, False: 20.0k]
  ------------------
  113|  7.50k|      case RSA_PSS_SHA384:
  ------------------
  |  Branch (113:7): [True: 2.50k, False: 20.0k]
  ------------------
  114|  7.50k|         return "SHA-384";
  115|       |
  116|  2.50k|      case ECDSA_SHA512:
  ------------------
  |  Branch (116:7): [True: 2.50k, False: 20.0k]
  ------------------
  117|  5.00k|      case RSA_PKCS1_SHA512:
  ------------------
  |  Branch (117:7): [True: 2.50k, False: 20.0k]
  ------------------
  118|  7.50k|      case RSA_PSS_SHA512:
  ------------------
  |  Branch (118:7): [True: 2.50k, False: 20.0k]
  ------------------
  119|  7.50k|         return "SHA-512";
  120|       |
  121|      0|      case EDDSA_25519:
  ------------------
  |  Branch (121:7): [True: 0, False: 22.5k]
  ------------------
  122|      0|      case EDDSA_448:
  ------------------
  |  Branch (122:7): [True: 0, False: 22.5k]
  ------------------
  123|      0|         return "Pure";
  124|       |
  125|      0|      default:
  ------------------
  |  Branch (125:7): [True: 0, False: 22.5k]
  ------------------
  126|      0|         return "Unknown hash function";
  127|  22.5k|   }
  128|  22.5k|}
_ZNK5Botan3TLS16Signature_Scheme14algorithm_nameEv:
  167|  22.5k|std::string Signature_Scheme::algorithm_name() const noexcept {
  168|  22.5k|   switch(m_code) {
  169|      0|      case RSA_PKCS1_SHA1:
  ------------------
  |  Branch (169:7): [True: 0, False: 22.5k]
  ------------------
  170|  2.50k|      case RSA_PKCS1_SHA256:
  ------------------
  |  Branch (170:7): [True: 2.50k, False: 20.0k]
  ------------------
  171|  5.00k|      case RSA_PKCS1_SHA384:
  ------------------
  |  Branch (171:7): [True: 2.50k, False: 20.0k]
  ------------------
  172|  7.50k|      case RSA_PKCS1_SHA512:
  ------------------
  |  Branch (172:7): [True: 2.50k, False: 20.0k]
  ------------------
  173|  10.0k|      case RSA_PSS_SHA256:
  ------------------
  |  Branch (173:7): [True: 2.50k, False: 20.0k]
  ------------------
  174|  12.5k|      case RSA_PSS_SHA384:
  ------------------
  |  Branch (174:7): [True: 2.50k, False: 20.0k]
  ------------------
  175|  15.0k|      case RSA_PSS_SHA512:
  ------------------
  |  Branch (175:7): [True: 2.50k, False: 20.0k]
  ------------------
  176|  15.0k|         return "RSA";
  177|       |
  178|      0|      case ECDSA_SHA1:
  ------------------
  |  Branch (178:7): [True: 0, False: 22.5k]
  ------------------
  179|  2.50k|      case ECDSA_SHA256:
  ------------------
  |  Branch (179:7): [True: 2.50k, False: 20.0k]
  ------------------
  180|  5.00k|      case ECDSA_SHA384:
  ------------------
  |  Branch (180:7): [True: 2.50k, False: 20.0k]
  ------------------
  181|  7.50k|      case ECDSA_SHA512:
  ------------------
  |  Branch (181:7): [True: 2.50k, False: 20.0k]
  ------------------
  182|  7.50k|         return "ECDSA";
  183|       |
  184|      0|      case EDDSA_25519:
  ------------------
  |  Branch (184:7): [True: 0, False: 22.5k]
  ------------------
  185|      0|         return "Ed25519";
  186|       |
  187|      0|      case EDDSA_448:
  ------------------
  |  Branch (187:7): [True: 0, False: 22.5k]
  ------------------
  188|      0|         return "Ed448";
  189|       |
  190|      0|      default:
  ------------------
  |  Branch (190:7): [True: 0, False: 22.5k]
  ------------------
  191|      0|         return "Unknown algorithm";
  192|  22.5k|   }
  193|  22.5k|}

_ZN5Botan3TLS11Ciphersuite22all_known_ciphersuitesEv:
   15|  2.62k|const std::vector<Ciphersuite>& Ciphersuite::all_known_ciphersuites() {
   16|       |   // clang-format off
   17|       |
   18|       |   // Note that this list of ciphersuites is ordered by id!
   19|  2.62k|   static const std::vector<Ciphersuite> g_ciphersuite_list = {
   20|  2.62k|      Ciphersuite(0x000A, "RSA_WITH_3DES_EDE_CBC_SHA", Auth_Method::IMPLICIT, Kex_Algo::STATIC_RSA, "3DES", 24, "SHA-1", 20, KDF_Algo::SHA_1, Nonce_Format::CBC_MODE),
   21|  2.62k|      Ciphersuite(0x0016, "DHE_RSA_WITH_3DES_EDE_CBC_SHA", Auth_Method::RSA, Kex_Algo::DH, "3DES", 24, "SHA-1", 20, KDF_Algo::SHA_1, Nonce_Format::CBC_MODE),
   22|  2.62k|      Ciphersuite(0x002F, "RSA_WITH_AES_128_CBC_SHA", Auth_Method::IMPLICIT, Kex_Algo::STATIC_RSA, "AES-128", 16, "SHA-1", 20, KDF_Algo::SHA_1, Nonce_Format::CBC_MODE),
   23|  2.62k|      Ciphersuite(0x0033, "DHE_RSA_WITH_AES_128_CBC_SHA", Auth_Method::RSA, Kex_Algo::DH, "AES-128", 16, "SHA-1", 20, KDF_Algo::SHA_1, Nonce_Format::CBC_MODE),
   24|  2.62k|      Ciphersuite(0x0035, "RSA_WITH_AES_256_CBC_SHA", Auth_Method::IMPLICIT, Kex_Algo::STATIC_RSA, "AES-256", 32, "SHA-1", 20, KDF_Algo::SHA_1, Nonce_Format::CBC_MODE),
   25|  2.62k|      Ciphersuite(0x0039, "DHE_RSA_WITH_AES_256_CBC_SHA", Auth_Method::RSA, Kex_Algo::DH, "AES-256", 32, "SHA-1", 20, KDF_Algo::SHA_1, Nonce_Format::CBC_MODE),
   26|  2.62k|      Ciphersuite(0x003C, "RSA_WITH_AES_128_CBC_SHA256", Auth_Method::IMPLICIT, Kex_Algo::STATIC_RSA, "AES-128", 16, "SHA-256", 32, KDF_Algo::SHA_256, Nonce_Format::CBC_MODE),
   27|  2.62k|      Ciphersuite(0x003D, "RSA_WITH_AES_256_CBC_SHA256", Auth_Method::IMPLICIT, Kex_Algo::STATIC_RSA, "AES-256", 32, "SHA-256", 32, KDF_Algo::SHA_256, Nonce_Format::CBC_MODE),
   28|  2.62k|      Ciphersuite(0x0067, "DHE_RSA_WITH_AES_128_CBC_SHA256", Auth_Method::RSA, Kex_Algo::DH, "AES-128", 16, "SHA-256", 32, KDF_Algo::SHA_256, Nonce_Format::CBC_MODE),
   29|  2.62k|      Ciphersuite(0x006B, "DHE_RSA_WITH_AES_256_CBC_SHA256", Auth_Method::RSA, Kex_Algo::DH, "AES-256", 32, "SHA-256", 32, KDF_Algo::SHA_256, Nonce_Format::CBC_MODE),
   30|  2.62k|      Ciphersuite(0x008B, "PSK_WITH_3DES_EDE_CBC_SHA", Auth_Method::IMPLICIT, Kex_Algo::PSK, "3DES", 24, "SHA-1", 20, KDF_Algo::SHA_1, Nonce_Format::CBC_MODE),
   31|  2.62k|      Ciphersuite(0x008C, "PSK_WITH_AES_128_CBC_SHA", Auth_Method::IMPLICIT, Kex_Algo::PSK, "AES-128", 16, "SHA-1", 20, KDF_Algo::SHA_1, Nonce_Format::CBC_MODE),
   32|  2.62k|      Ciphersuite(0x008D, "PSK_WITH_AES_256_CBC_SHA", Auth_Method::IMPLICIT, Kex_Algo::PSK, "AES-256", 32, "SHA-1", 20, KDF_Algo::SHA_1, Nonce_Format::CBC_MODE),
   33|  2.62k|      Ciphersuite(0x009C, "RSA_WITH_AES_128_GCM_SHA256", Auth_Method::IMPLICIT, Kex_Algo::STATIC_RSA, "AES-128/GCM", 16, "AEAD", 0, KDF_Algo::SHA_256, Nonce_Format::AEAD_IMPLICIT_4),
   34|  2.62k|      Ciphersuite(0x009D, "RSA_WITH_AES_256_GCM_SHA384", Auth_Method::IMPLICIT, Kex_Algo::STATIC_RSA, "AES-256/GCM", 32, "AEAD", 0, KDF_Algo::SHA_384, Nonce_Format::AEAD_IMPLICIT_4),
   35|  2.62k|      Ciphersuite(0x009E, "DHE_RSA_WITH_AES_128_GCM_SHA256", Auth_Method::RSA, Kex_Algo::DH, "AES-128/GCM", 16, "AEAD", 0, KDF_Algo::SHA_256, Nonce_Format::AEAD_IMPLICIT_4),
   36|  2.62k|      Ciphersuite(0x009F, "DHE_RSA_WITH_AES_256_GCM_SHA384", Auth_Method::RSA, Kex_Algo::DH, "AES-256/GCM", 32, "AEAD", 0, KDF_Algo::SHA_384, Nonce_Format::AEAD_IMPLICIT_4),
   37|  2.62k|      Ciphersuite(0x00A8, "PSK_WITH_AES_128_GCM_SHA256", Auth_Method::IMPLICIT, Kex_Algo::PSK, "AES-128/GCM", 16, "AEAD", 0, KDF_Algo::SHA_256, Nonce_Format::AEAD_IMPLICIT_4),
   38|  2.62k|      Ciphersuite(0x00A9, "PSK_WITH_AES_256_GCM_SHA384", Auth_Method::IMPLICIT, Kex_Algo::PSK, "AES-256/GCM", 32, "AEAD", 0, KDF_Algo::SHA_384, Nonce_Format::AEAD_IMPLICIT_4),
   39|  2.62k|      Ciphersuite(0x00AE, "PSK_WITH_AES_128_CBC_SHA256", Auth_Method::IMPLICIT, Kex_Algo::PSK, "AES-128", 16, "SHA-256", 32, KDF_Algo::SHA_256, Nonce_Format::CBC_MODE),
   40|  2.62k|      Ciphersuite(0x00AF, "PSK_WITH_AES_256_CBC_SHA384", Auth_Method::IMPLICIT, Kex_Algo::PSK, "AES-256", 32, "SHA-384", 48, KDF_Algo::SHA_384, Nonce_Format::CBC_MODE),
   41|  2.62k|      Ciphersuite(0x1301, "AES_128_GCM_SHA256", Auth_Method::UNDEFINED, Kex_Algo::UNDEFINED, "AES-128/GCM", 16, "AEAD", 0, KDF_Algo::SHA_256, Nonce_Format::AEAD_IMPLICIT_4),
   42|  2.62k|      Ciphersuite(0x1302, "AES_256_GCM_SHA384", Auth_Method::UNDEFINED, Kex_Algo::UNDEFINED, "AES-256/GCM", 32, "AEAD", 0, KDF_Algo::SHA_384, Nonce_Format::AEAD_IMPLICIT_4),
   43|  2.62k|      Ciphersuite(0x1303, "CHACHA20_POLY1305_SHA256", Auth_Method::UNDEFINED, Kex_Algo::UNDEFINED, "ChaCha20Poly1305", 32, "AEAD", 0, KDF_Algo::SHA_256, Nonce_Format::AEAD_XOR_12),
   44|  2.62k|      Ciphersuite(0x1304, "AES_128_CCM_SHA256", Auth_Method::UNDEFINED, Kex_Algo::UNDEFINED, "AES-128/CCM", 16, "AEAD", 0, KDF_Algo::SHA_256, Nonce_Format::AEAD_IMPLICIT_4),
   45|  2.62k|      Ciphersuite(0x1305, "AES_128_CCM_8_SHA256", Auth_Method::UNDEFINED, Kex_Algo::UNDEFINED, "AES-128/CCM(8)", 16, "AEAD", 0, KDF_Algo::SHA_256, Nonce_Format::AEAD_IMPLICIT_4),
   46|  2.62k|      Ciphersuite(0xC008, "ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA", Auth_Method::ECDSA, Kex_Algo::ECDH, "3DES", 24, "SHA-1", 20, KDF_Algo::SHA_1, Nonce_Format::CBC_MODE),
   47|  2.62k|      Ciphersuite(0xC009, "ECDHE_ECDSA_WITH_AES_128_CBC_SHA", Auth_Method::ECDSA, Kex_Algo::ECDH, "AES-128", 16, "SHA-1", 20, KDF_Algo::SHA_1, Nonce_Format::CBC_MODE),
   48|  2.62k|      Ciphersuite(0xC00A, "ECDHE_ECDSA_WITH_AES_256_CBC_SHA", Auth_Method::ECDSA, Kex_Algo::ECDH, "AES-256", 32, "SHA-1", 20, KDF_Algo::SHA_1, Nonce_Format::CBC_MODE),
   49|  2.62k|      Ciphersuite(0xC012, "ECDHE_RSA_WITH_3DES_EDE_CBC_SHA", Auth_Method::RSA, Kex_Algo::ECDH, "3DES", 24, "SHA-1", 20, KDF_Algo::SHA_1, Nonce_Format::CBC_MODE),
   50|  2.62k|      Ciphersuite(0xC013, "ECDHE_RSA_WITH_AES_128_CBC_SHA", Auth_Method::RSA, Kex_Algo::ECDH, "AES-128", 16, "SHA-1", 20, KDF_Algo::SHA_1, Nonce_Format::CBC_MODE),
   51|  2.62k|      Ciphersuite(0xC014, "ECDHE_RSA_WITH_AES_256_CBC_SHA", Auth_Method::RSA, Kex_Algo::ECDH, "AES-256", 32, "SHA-1", 20, KDF_Algo::SHA_1, Nonce_Format::CBC_MODE),
   52|  2.62k|      Ciphersuite(0xC023, "ECDHE_ECDSA_WITH_AES_128_CBC_SHA256", Auth_Method::ECDSA, Kex_Algo::ECDH, "AES-128", 16, "SHA-256", 32, KDF_Algo::SHA_256, Nonce_Format::CBC_MODE),
   53|  2.62k|      Ciphersuite(0xC024, "ECDHE_ECDSA_WITH_AES_256_CBC_SHA384", Auth_Method::ECDSA, Kex_Algo::ECDH, "AES-256", 32, "SHA-384", 48, KDF_Algo::SHA_384, Nonce_Format::CBC_MODE),
   54|  2.62k|      Ciphersuite(0xC027, "ECDHE_RSA_WITH_AES_128_CBC_SHA256", Auth_Method::RSA, Kex_Algo::ECDH, "AES-128", 16, "SHA-256", 32, KDF_Algo::SHA_256, Nonce_Format::CBC_MODE),
   55|  2.62k|      Ciphersuite(0xC028, "ECDHE_RSA_WITH_AES_256_CBC_SHA384", Auth_Method::RSA, Kex_Algo::ECDH, "AES-256", 32, "SHA-384", 48, KDF_Algo::SHA_384, Nonce_Format::CBC_MODE),
   56|  2.62k|      Ciphersuite(0xC02B, "ECDHE_ECDSA_WITH_AES_128_GCM_SHA256", Auth_Method::ECDSA, Kex_Algo::ECDH, "AES-128/GCM", 16, "AEAD", 0, KDF_Algo::SHA_256, Nonce_Format::AEAD_IMPLICIT_4),
   57|  2.62k|      Ciphersuite(0xC02C, "ECDHE_ECDSA_WITH_AES_256_GCM_SHA384", Auth_Method::ECDSA, Kex_Algo::ECDH, "AES-256/GCM", 32, "AEAD", 0, KDF_Algo::SHA_384, Nonce_Format::AEAD_IMPLICIT_4),
   58|  2.62k|      Ciphersuite(0xC02F, "ECDHE_RSA_WITH_AES_128_GCM_SHA256", Auth_Method::RSA, Kex_Algo::ECDH, "AES-128/GCM", 16, "AEAD", 0, KDF_Algo::SHA_256, Nonce_Format::AEAD_IMPLICIT_4),
   59|  2.62k|      Ciphersuite(0xC030, "ECDHE_RSA_WITH_AES_256_GCM_SHA384", Auth_Method::RSA, Kex_Algo::ECDH, "AES-256/GCM", 32, "AEAD", 0, KDF_Algo::SHA_384, Nonce_Format::AEAD_IMPLICIT_4),
   60|  2.62k|      Ciphersuite(0xC034, "ECDHE_PSK_WITH_3DES_EDE_CBC_SHA", Auth_Method::IMPLICIT, Kex_Algo::ECDHE_PSK, "3DES", 24, "SHA-1", 20, KDF_Algo::SHA_1, Nonce_Format::CBC_MODE),
   61|  2.62k|      Ciphersuite(0xC035, "ECDHE_PSK_WITH_AES_128_CBC_SHA", Auth_Method::IMPLICIT, Kex_Algo::ECDHE_PSK, "AES-128", 16, "SHA-1", 20, KDF_Algo::SHA_1, Nonce_Format::CBC_MODE),
   62|  2.62k|      Ciphersuite(0xC036, "ECDHE_PSK_WITH_AES_256_CBC_SHA", Auth_Method::IMPLICIT, Kex_Algo::ECDHE_PSK, "AES-256", 32, "SHA-1", 20, KDF_Algo::SHA_1, Nonce_Format::CBC_MODE),
   63|  2.62k|      Ciphersuite(0xC037, "ECDHE_PSK_WITH_AES_128_CBC_SHA256", Auth_Method::IMPLICIT, Kex_Algo::ECDHE_PSK, "AES-128", 16, "SHA-256", 32, KDF_Algo::SHA_256, Nonce_Format::CBC_MODE),
   64|  2.62k|      Ciphersuite(0xC038, "ECDHE_PSK_WITH_AES_256_CBC_SHA384", Auth_Method::IMPLICIT, Kex_Algo::ECDHE_PSK, "AES-256", 32, "SHA-384", 48, KDF_Algo::SHA_384, Nonce_Format::CBC_MODE),
   65|  2.62k|      Ciphersuite(0xC050, "RSA_WITH_ARIA_128_GCM_SHA256", Auth_Method::IMPLICIT, Kex_Algo::STATIC_RSA, "ARIA-128/GCM", 16, "AEAD", 0, KDF_Algo::SHA_256, Nonce_Format::AEAD_IMPLICIT_4),
   66|  2.62k|      Ciphersuite(0xC051, "RSA_WITH_ARIA_256_GCM_SHA384", Auth_Method::IMPLICIT, Kex_Algo::STATIC_RSA, "ARIA-256/GCM", 32, "AEAD", 0, KDF_Algo::SHA_384, Nonce_Format::AEAD_IMPLICIT_4),
   67|  2.62k|      Ciphersuite(0xC052, "DHE_RSA_WITH_ARIA_128_GCM_SHA256", Auth_Method::RSA, Kex_Algo::DH, "ARIA-128/GCM", 16, "AEAD", 0, KDF_Algo::SHA_256, Nonce_Format::AEAD_IMPLICIT_4),
   68|  2.62k|      Ciphersuite(0xC053, "DHE_RSA_WITH_ARIA_256_GCM_SHA384", Auth_Method::RSA, Kex_Algo::DH, "ARIA-256/GCM", 32, "AEAD", 0, KDF_Algo::SHA_384, Nonce_Format::AEAD_IMPLICIT_4),
   69|  2.62k|      Ciphersuite(0xC05C, "ECDHE_ECDSA_WITH_ARIA_128_GCM_SHA256", Auth_Method::ECDSA, Kex_Algo::ECDH, "ARIA-128/GCM", 16, "AEAD", 0, KDF_Algo::SHA_256, Nonce_Format::AEAD_IMPLICIT_4),
   70|  2.62k|      Ciphersuite(0xC05D, "ECDHE_ECDSA_WITH_ARIA_256_GCM_SHA384", Auth_Method::ECDSA, Kex_Algo::ECDH, "ARIA-256/GCM", 32, "AEAD", 0, KDF_Algo::SHA_384, Nonce_Format::AEAD_IMPLICIT_4),
   71|  2.62k|      Ciphersuite(0xC060, "ECDHE_RSA_WITH_ARIA_128_GCM_SHA256", Auth_Method::RSA, Kex_Algo::ECDH, "ARIA-128/GCM", 16, "AEAD", 0, KDF_Algo::SHA_256, Nonce_Format::AEAD_IMPLICIT_4),
   72|  2.62k|      Ciphersuite(0xC061, "ECDHE_RSA_WITH_ARIA_256_GCM_SHA384", Auth_Method::RSA, Kex_Algo::ECDH, "ARIA-256/GCM", 32, "AEAD", 0, KDF_Algo::SHA_384, Nonce_Format::AEAD_IMPLICIT_4),
   73|  2.62k|      Ciphersuite(0xC06A, "PSK_WITH_ARIA_128_GCM_SHA256", Auth_Method::IMPLICIT, Kex_Algo::PSK, "ARIA-128/GCM", 16, "AEAD", 0, KDF_Algo::SHA_256, Nonce_Format::AEAD_IMPLICIT_4),
   74|  2.62k|      Ciphersuite(0xC06B, "PSK_WITH_ARIA_256_GCM_SHA384", Auth_Method::IMPLICIT, Kex_Algo::PSK, "ARIA-256/GCM", 32, "AEAD", 0, KDF_Algo::SHA_384, Nonce_Format::AEAD_IMPLICIT_4),
   75|  2.62k|      Ciphersuite(0xC07A, "RSA_WITH_CAMELLIA_128_GCM_SHA256", Auth_Method::IMPLICIT, Kex_Algo::STATIC_RSA, "Camellia-128/GCM", 16, "AEAD", 0, KDF_Algo::SHA_256, Nonce_Format::AEAD_IMPLICIT_4),
   76|  2.62k|      Ciphersuite(0xC07B, "RSA_WITH_CAMELLIA_256_GCM_SHA384", Auth_Method::IMPLICIT, Kex_Algo::STATIC_RSA, "Camellia-256/GCM", 32, "AEAD", 0, KDF_Algo::SHA_384, Nonce_Format::AEAD_IMPLICIT_4),
   77|  2.62k|      Ciphersuite(0xC07C, "DHE_RSA_WITH_CAMELLIA_128_GCM_SHA256", Auth_Method::RSA, Kex_Algo::DH, "Camellia-128/GCM", 16, "AEAD", 0, KDF_Algo::SHA_256, Nonce_Format::AEAD_IMPLICIT_4),
   78|  2.62k|      Ciphersuite(0xC07D, "DHE_RSA_WITH_CAMELLIA_256_GCM_SHA384", Auth_Method::RSA, Kex_Algo::DH, "Camellia-256/GCM", 32, "AEAD", 0, KDF_Algo::SHA_384, Nonce_Format::AEAD_IMPLICIT_4),
   79|  2.62k|      Ciphersuite(0xC086, "ECDHE_ECDSA_WITH_CAMELLIA_128_GCM_SHA256", Auth_Method::ECDSA, Kex_Algo::ECDH, "Camellia-128/GCM", 16, "AEAD", 0, KDF_Algo::SHA_256, Nonce_Format::AEAD_IMPLICIT_4),
   80|  2.62k|      Ciphersuite(0xC087, "ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384", Auth_Method::ECDSA, Kex_Algo::ECDH, "Camellia-256/GCM", 32, "AEAD", 0, KDF_Algo::SHA_384, Nonce_Format::AEAD_IMPLICIT_4),
   81|  2.62k|      Ciphersuite(0xC08A, "ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256", Auth_Method::RSA, Kex_Algo::ECDH, "Camellia-128/GCM", 16, "AEAD", 0, KDF_Algo::SHA_256, Nonce_Format::AEAD_IMPLICIT_4),
   82|  2.62k|      Ciphersuite(0xC08B, "ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384", Auth_Method::RSA, Kex_Algo::ECDH, "Camellia-256/GCM", 32, "AEAD", 0, KDF_Algo::SHA_384, Nonce_Format::AEAD_IMPLICIT_4),
   83|  2.62k|      Ciphersuite(0xC08E, "PSK_WITH_CAMELLIA_128_GCM_SHA256", Auth_Method::IMPLICIT, Kex_Algo::PSK, "Camellia-128/GCM", 16, "AEAD", 0, KDF_Algo::SHA_256, Nonce_Format::AEAD_IMPLICIT_4),
   84|  2.62k|      Ciphersuite(0xC08F, "PSK_WITH_CAMELLIA_256_GCM_SHA384", Auth_Method::IMPLICIT, Kex_Algo::PSK, "Camellia-256/GCM", 32, "AEAD", 0, KDF_Algo::SHA_384, Nonce_Format::AEAD_IMPLICIT_4),
   85|  2.62k|      Ciphersuite(0xC09C, "RSA_WITH_AES_128_CCM", Auth_Method::IMPLICIT, Kex_Algo::STATIC_RSA, "AES-128/CCM", 16, "AEAD", 0, KDF_Algo::SHA_256, Nonce_Format::AEAD_IMPLICIT_4),
   86|  2.62k|      Ciphersuite(0xC09D, "RSA_WITH_AES_256_CCM", Auth_Method::IMPLICIT, Kex_Algo::STATIC_RSA, "AES-256/CCM", 32, "AEAD", 0, KDF_Algo::SHA_256, Nonce_Format::AEAD_IMPLICIT_4),
   87|  2.62k|      Ciphersuite(0xC09E, "DHE_RSA_WITH_AES_128_CCM", Auth_Method::RSA, Kex_Algo::DH, "AES-128/CCM", 16, "AEAD", 0, KDF_Algo::SHA_256, Nonce_Format::AEAD_IMPLICIT_4),
   88|  2.62k|      Ciphersuite(0xC09F, "DHE_RSA_WITH_AES_256_CCM", Auth_Method::RSA, Kex_Algo::DH, "AES-256/CCM", 32, "AEAD", 0, KDF_Algo::SHA_256, Nonce_Format::AEAD_IMPLICIT_4),
   89|  2.62k|      Ciphersuite(0xC0A0, "RSA_WITH_AES_128_CCM_8", Auth_Method::IMPLICIT, Kex_Algo::STATIC_RSA, "AES-128/CCM(8)", 16, "AEAD", 0, KDF_Algo::SHA_256, Nonce_Format::AEAD_IMPLICIT_4),
   90|  2.62k|      Ciphersuite(0xC0A1, "RSA_WITH_AES_256_CCM_8", Auth_Method::IMPLICIT, Kex_Algo::STATIC_RSA, "AES-256/CCM(8)", 32, "AEAD", 0, KDF_Algo::SHA_256, Nonce_Format::AEAD_IMPLICIT_4),
   91|  2.62k|      Ciphersuite(0xC0A2, "DHE_RSA_WITH_AES_128_CCM_8", Auth_Method::RSA, Kex_Algo::DH, "AES-128/CCM(8)", 16, "AEAD", 0, KDF_Algo::SHA_256, Nonce_Format::AEAD_IMPLICIT_4),
   92|  2.62k|      Ciphersuite(0xC0A3, "DHE_RSA_WITH_AES_256_CCM_8", Auth_Method::RSA, Kex_Algo::DH, "AES-256/CCM(8)", 32, "AEAD", 0, KDF_Algo::SHA_256, Nonce_Format::AEAD_IMPLICIT_4),
   93|  2.62k|      Ciphersuite(0xC0A4, "PSK_WITH_AES_128_CCM", Auth_Method::IMPLICIT, Kex_Algo::PSK, "AES-128/CCM", 16, "AEAD", 0, KDF_Algo::SHA_256, Nonce_Format::AEAD_IMPLICIT_4),
   94|  2.62k|      Ciphersuite(0xC0A5, "PSK_WITH_AES_256_CCM", Auth_Method::IMPLICIT, Kex_Algo::PSK, "AES-256/CCM", 32, "AEAD", 0, KDF_Algo::SHA_256, Nonce_Format::AEAD_IMPLICIT_4),
   95|  2.62k|      Ciphersuite(0xC0A8, "PSK_WITH_AES_128_CCM_8", Auth_Method::IMPLICIT, Kex_Algo::PSK, "AES-128/CCM(8)", 16, "AEAD", 0, KDF_Algo::SHA_256, Nonce_Format::AEAD_IMPLICIT_4),
   96|  2.62k|      Ciphersuite(0xC0A9, "PSK_WITH_AES_256_CCM_8", Auth_Method::IMPLICIT, Kex_Algo::PSK, "AES-256/CCM(8)", 32, "AEAD", 0, KDF_Algo::SHA_256, Nonce_Format::AEAD_IMPLICIT_4),
   97|  2.62k|      Ciphersuite(0xC0AC, "ECDHE_ECDSA_WITH_AES_128_CCM", Auth_Method::ECDSA, Kex_Algo::ECDH, "AES-128/CCM", 16, "AEAD", 0, KDF_Algo::SHA_256, Nonce_Format::AEAD_IMPLICIT_4),
   98|  2.62k|      Ciphersuite(0xC0AD, "ECDHE_ECDSA_WITH_AES_256_CCM", Auth_Method::ECDSA, Kex_Algo::ECDH, "AES-256/CCM", 32, "AEAD", 0, KDF_Algo::SHA_256, Nonce_Format::AEAD_IMPLICIT_4),
   99|  2.62k|      Ciphersuite(0xC0AE, "ECDHE_ECDSA_WITH_AES_128_CCM_8", Auth_Method::ECDSA, Kex_Algo::ECDH, "AES-128/CCM(8)", 16, "AEAD", 0, KDF_Algo::SHA_256, Nonce_Format::AEAD_IMPLICIT_4),
  100|  2.62k|      Ciphersuite(0xC0AF, "ECDHE_ECDSA_WITH_AES_256_CCM_8", Auth_Method::ECDSA, Kex_Algo::ECDH, "AES-256/CCM(8)", 32, "AEAD", 0, KDF_Algo::SHA_256, Nonce_Format::AEAD_IMPLICIT_4),
  101|  2.62k|      Ciphersuite(0xCCA8, "ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256", Auth_Method::RSA, Kex_Algo::ECDH, "ChaCha20Poly1305", 32, "AEAD", 0, KDF_Algo::SHA_256, Nonce_Format::AEAD_XOR_12),
  102|  2.62k|      Ciphersuite(0xCCA9, "ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256", Auth_Method::ECDSA, Kex_Algo::ECDH, "ChaCha20Poly1305", 32, "AEAD", 0, KDF_Algo::SHA_256, Nonce_Format::AEAD_XOR_12),
  103|  2.62k|      Ciphersuite(0xCCAA, "DHE_RSA_WITH_CHACHA20_POLY1305_SHA256", Auth_Method::RSA, Kex_Algo::DH, "ChaCha20Poly1305", 32, "AEAD", 0, KDF_Algo::SHA_256, Nonce_Format::AEAD_XOR_12),
  104|  2.62k|      Ciphersuite(0xCCAB, "PSK_WITH_CHACHA20_POLY1305_SHA256", Auth_Method::IMPLICIT, Kex_Algo::PSK, "ChaCha20Poly1305", 32, "AEAD", 0, KDF_Algo::SHA_256, Nonce_Format::AEAD_XOR_12),
  105|  2.62k|      Ciphersuite(0xCCAC, "ECDHE_PSK_WITH_CHACHA20_POLY1305_SHA256", Auth_Method::IMPLICIT, Kex_Algo::ECDHE_PSK, "ChaCha20Poly1305", 32, "AEAD", 0, KDF_Algo::SHA_256, Nonce_Format::AEAD_XOR_12),
  106|  2.62k|      Ciphersuite(0xD001, "ECDHE_PSK_WITH_AES_128_GCM_SHA256", Auth_Method::IMPLICIT, Kex_Algo::ECDHE_PSK, "AES-128/GCM", 16, "AEAD", 0, KDF_Algo::SHA_256, Nonce_Format::AEAD_IMPLICIT_4),
  107|  2.62k|      Ciphersuite(0xD002, "ECDHE_PSK_WITH_AES_256_GCM_SHA384", Auth_Method::IMPLICIT, Kex_Algo::ECDHE_PSK, "AES-256/GCM", 32, "AEAD", 0, KDF_Algo::SHA_384, Nonce_Format::AEAD_IMPLICIT_4),
  108|  2.62k|      Ciphersuite(0xD003, "ECDHE_PSK_WITH_AES_128_CCM_8_SHA256", Auth_Method::IMPLICIT, Kex_Algo::ECDHE_PSK, "AES-128/CCM(8)", 16, "AEAD", 0, KDF_Algo::SHA_256, Nonce_Format::AEAD_IMPLICIT_4),
  109|  2.62k|      Ciphersuite(0xD005, "ECDHE_PSK_WITH_AES_128_CCM_SHA256", Auth_Method::IMPLICIT, Kex_Algo::ECDHE_PSK, "AES-128/CCM", 16, "AEAD", 0, KDF_Algo::SHA_256, Nonce_Format::AEAD_IMPLICIT_4),
  110|  2.62k|      Ciphersuite(0xFFC3, "ECDHE_RSA_WITH_AES_256_OCB_SHA256", Auth_Method::RSA, Kex_Algo::ECDH, "AES-256/OCB(12)", 32, "AEAD", 0, KDF_Algo::SHA_256, Nonce_Format::AEAD_XOR_12),
  111|  2.62k|      Ciphersuite(0xFFC5, "ECDHE_ECDSA_WITH_AES_256_OCB_SHA256", Auth_Method::ECDSA, Kex_Algo::ECDH, "AES-256/OCB(12)", 32, "AEAD", 0, KDF_Algo::SHA_256, Nonce_Format::AEAD_XOR_12),
  112|  2.62k|      Ciphersuite(0xFFC7, "PSK_WITH_AES_256_OCB_SHA256", Auth_Method::IMPLICIT, Kex_Algo::PSK, "AES-256/OCB(12)", 32, "AEAD", 0, KDF_Algo::SHA_256, Nonce_Format::AEAD_XOR_12),
  113|  2.62k|      Ciphersuite(0xFFCB, "ECDHE_PSK_WITH_AES_256_OCB_SHA256", Auth_Method::IMPLICIT, Kex_Algo::ECDHE_PSK, "AES-256/OCB(12)", 32, "AEAD", 0, KDF_Algo::SHA_256, Nonce_Format::AEAD_XOR_12),
  114|  2.62k|      };
  115|       |
  116|       |   // clang-format on
  117|       |
  118|  2.62k|   return g_ciphersuite_list;
  119|  2.62k|}

_ZNK5Botan3TLS16Protocol_Version20is_datagram_protocolEv:
   36|  41.5k|bool Protocol_Version::is_datagram_protocol() const { return major_version() > 250; }
_ZNK5Botan3TLS16Protocol_Version13is_pre_tls_13Ev:
   38|    267|bool Protocol_Version::is_pre_tls_13() const {
   39|    267|   return (!is_datagram_protocol() && *this <= Protocol_Version::TLS_V12) ||
  ------------------
  |  Branch (39:12): [True: 199, False: 68]
  |  Branch (39:39): [True: 78, False: 121]
  ------------------
   40|    267|          (is_datagram_protocol() && *this <= Protocol_Version::DTLS_V12);
  ------------------
  |  Branch (40:12): [True: 68, False: 121]
  |  Branch (40:38): [True: 51, False: 17]
  ------------------
   41|    267|}
_ZNK5Botan3TLS16Protocol_VersiongtERKS1_:
   48|  2.75k|bool Protocol_Version::operator>(const Protocol_Version& other) const {
   49|  2.75k|   if(this->is_datagram_protocol() != other.is_datagram_protocol()) {
  ------------------
  |  Branch (49:7): [True: 0, False: 2.75k]
  ------------------
   50|      0|      throw TLS_Exception(Alert::ProtocolVersion, "Version comparing " + to_string() + " with " + other.to_string());
   51|      0|   }
   52|       |
   53|  2.75k|   if(this->is_datagram_protocol()) {
  ------------------
  |  Branch (53:7): [True: 64, False: 2.69k]
  ------------------
   54|     64|      return m_version < other.m_version;  // goes backwards
   55|     64|   }
   56|       |
   57|  2.69k|   return m_version > other.m_version;
   58|  2.75k|}
_ZNK5Botan3TLS16Protocol_Version5validEv:
   60|    129|bool Protocol_Version::valid() const {
   61|    129|   const uint8_t maj = major_version();
   62|    129|   const uint8_t min = minor_version();
   63|       |
   64|    129|   if(maj == 3 && min <= 4) {
  ------------------
  |  Branch (64:7): [True: 18, False: 111]
  |  Branch (64:19): [True: 18, False: 0]
  ------------------
   65|       |      // 3.0: SSLv3
   66|       |      // 3.1: TLS 1.0
   67|       |      // 3.2: TLS 1.1
   68|       |      // 3.3: TLS 1.2
   69|       |      // 3.4: TLS 1.3
   70|     18|      return true;
   71|     18|   }
   72|       |
   73|    111|   if(maj == 254 && (min == 253 || min == 255)) {
  ------------------
  |  Branch (73:7): [True: 21, False: 90]
  |  Branch (73:22): [True: 4, False: 17]
  |  Branch (73:36): [True: 11, False: 6]
  ------------------
   74|       |      // 254.253: DTLS 1.2
   75|       |      // 254.255: DTLS 1.0
   76|     15|      return true;
   77|     15|   }
   78|       |
   79|     96|   return false;
   80|    111|}

_ZN5Botan17assertion_failureEPKcS1_S1_S1_i:
   29|     14|void assertion_failure(const char* expr_str, const char* assertion_made, const char* func, const char* file, int line) {
   30|     14|   std::ostringstream format;
   31|       |
   32|     14|   format << "False assertion ";
   33|       |
   34|     14|   if(assertion_made && assertion_made[0] != 0) {
  ------------------
  |  Branch (34:7): [True: 14, False: 0]
  |  Branch (34:25): [True: 14, False: 0]
  ------------------
   35|     14|      format << "'" << assertion_made << "' (expression " << expr_str << ") ";
   36|     14|   } else {
   37|      0|      format << expr_str << " ";
   38|      0|   }
   39|       |
   40|     14|   if(func) {
  ------------------
  |  Branch (40:7): [True: 14, False: 0]
  ------------------
   41|     14|      format << "in " << func << " ";
   42|     14|   }
   43|       |
   44|     14|   format << "@" << file << ":" << line;
   45|       |
   46|       |#if defined(BOTAN_TERMINATE_ON_ASSERTS)
   47|       |   std::cerr << format.str() << '\n';
   48|       |   std::abort();
   49|       |#else
   50|     14|   throw Internal_Error(format.str());
   51|     14|#endif
   52|     14|}

_ZN5Botan12ucs2_to_utf8EPKhm:
   54|    330|std::string ucs2_to_utf8(const uint8_t ucs2[], size_t len) {
   55|    330|   if(len % 2 != 0) {
  ------------------
  |  Branch (55:7): [True: 5, False: 325]
  ------------------
   56|      5|      throw Decoding_Error("Invalid length for UCS-2 string");
   57|      5|   }
   58|       |
   59|    325|   const size_t chars = len / 2;
   60|       |
   61|    325|   std::string s;
   62|  3.23k|   for(size_t i = 0; i != chars; ++i) {
  ------------------
  |  Branch (62:22): [True: 2.91k, False: 325]
  ------------------
   63|  2.91k|      const uint32_t c = load_be<uint16_t>(ucs2, i);
   64|  2.91k|      append_utf8_for(s, c);
   65|  2.91k|   }
   66|       |
   67|    325|   return s;
   68|    330|}
_ZN5Botan12ucs4_to_utf8EPKhm:
   70|    120|std::string ucs4_to_utf8(const uint8_t ucs4[], size_t len) {
   71|    120|   if(len % 4 != 0) {
  ------------------
  |  Branch (71:7): [True: 2, False: 118]
  ------------------
   72|      2|      throw Decoding_Error("Invalid length for UCS-4 string");
   73|      2|   }
   74|       |
   75|    118|   const size_t chars = len / 4;
   76|       |
   77|    118|   std::string s;
   78|    359|   for(size_t i = 0; i != chars; ++i) {
  ------------------
  |  Branch (78:22): [True: 241, False: 118]
  ------------------
   79|    241|      const uint32_t c = load_be<uint32_t>(ucs4, i);
   80|    241|      append_utf8_for(s, c);
   81|    241|   }
   82|       |
   83|    118|   return s;
   84|    120|}
_ZN5Botan14latin1_to_utf8EPKhm:
   89|    297|std::string latin1_to_utf8(const uint8_t chars[], size_t len) {
   90|    297|   std::string s;
   91|  7.19k|   for(size_t i = 0; i != len; ++i) {
  ------------------
  |  Branch (91:22): [True: 6.90k, False: 297]
  ------------------
   92|  6.90k|      const uint32_t c = static_cast<uint8_t>(chars[i]);
   93|  6.90k|      append_utf8_for(s, c);
   94|  6.90k|   }
   95|    297|   return s;
   96|    297|}
charset.cpp:_ZN5Botan12_GLOBAL__N_115append_utf8_forERNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEj:
   18|  10.0k|void append_utf8_for(std::string& s, uint32_t c) {
   19|  10.0k|   if(c >= 0xD800 && c < 0xE000) {
  ------------------
  |  Branch (19:7): [True: 671, False: 9.38k]
  |  Branch (19:22): [True: 20, False: 651]
  ------------------
   20|     20|      throw Decoding_Error("Invalid Unicode character");
   21|     20|   }
   22|       |
   23|  10.0k|   if(c <= 0x7F) {
  ------------------
  |  Branch (23:7): [True: 6.13k, False: 3.90k]
  ------------------
   24|  6.13k|      const uint8_t b0 = static_cast<uint8_t>(c);
   25|  6.13k|      s.push_back(static_cast<char>(b0));
   26|  6.13k|   } else if(c <= 0x7FF) {
  ------------------
  |  Branch (26:14): [True: 1.91k, False: 1.99k]
  ------------------
   27|  1.91k|      const uint8_t b0 = 0xC0 | static_cast<uint8_t>(c >> 6);
   28|  1.91k|      const uint8_t b1 = 0x80 | static_cast<uint8_t>(c & 0x3F);
   29|  1.91k|      s.push_back(static_cast<char>(b0));
   30|  1.91k|      s.push_back(static_cast<char>(b1));
   31|  1.99k|   } else if(c <= 0xFFFF) {
  ------------------
  |  Branch (31:14): [True: 1.84k, False: 151]
  ------------------
   32|  1.84k|      const uint8_t b0 = 0xE0 | static_cast<uint8_t>(c >> 12);
   33|  1.84k|      const uint8_t b1 = 0x80 | static_cast<uint8_t>((c >> 6) & 0x3F);
   34|  1.84k|      const uint8_t b2 = 0x80 | static_cast<uint8_t>(c & 0x3F);
   35|  1.84k|      s.push_back(static_cast<char>(b0));
   36|  1.84k|      s.push_back(static_cast<char>(b1));
   37|  1.84k|      s.push_back(static_cast<char>(b2));
   38|  1.84k|   } else if(c <= 0x10FFFF) {
  ------------------
  |  Branch (38:14): [True: 94, False: 57]
  ------------------
   39|     94|      const uint8_t b0 = 0xF0 | static_cast<uint8_t>(c >> 18);
   40|     94|      const uint8_t b1 = 0x80 | static_cast<uint8_t>((c >> 12) & 0x3F);
   41|     94|      const uint8_t b2 = 0x80 | static_cast<uint8_t>((c >> 6) & 0x3F);
   42|     94|      const uint8_t b3 = 0x80 | static_cast<uint8_t>(c & 0x3F);
   43|     94|      s.push_back(static_cast<char>(b0));
   44|     94|      s.push_back(static_cast<char>(b1));
   45|     94|      s.push_back(static_cast<char>(b2));
   46|     94|      s.push_back(static_cast<char>(b3));
   47|     94|   } else {
   48|     57|      throw Decoding_Error("Invalid Unicode character");
   49|     57|   }
   50|  10.0k|}

_ZN5Botan5CPUID11has_simd_32Ev:
   18|    158|bool CPUID::has_simd_32() {
   19|    158|#if defined(BOTAN_TARGET_SUPPORTS_SSE2)
   20|    158|   return CPUID::has_sse2();
   21|       |#elif defined(BOTAN_TARGET_SUPPORTS_ALTIVEC)
   22|       |   return CPUID::has_altivec();
   23|       |#elif defined(BOTAN_TARGET_SUPPORTS_NEON)
   24|       |   return CPUID::has_neon();
   25|       |#else
   26|       |   return true;
   27|       |#endif
   28|    158|}
_ZN5Botan5CPUID10CPUID_DataC2Ev:
  120|      1|CPUID::CPUID_Data::CPUID_Data() {
  121|      1|   m_processor_features = 0;
  122|       |
  123|      1|#if defined(BOTAN_TARGET_CPU_IS_PPC_FAMILY) || defined(BOTAN_TARGET_CPU_IS_ARM_FAMILY) || \
  124|      1|   defined(BOTAN_TARGET_CPU_IS_X86_FAMILY)
  125|       |
  126|      1|   m_processor_features = detect_cpu_features();
  127|       |
  128|      1|#endif
  129|       |
  130|      1|   m_processor_features |= CPUID::CPUID_INITIALIZED_BIT;
  131|       |
  132|      1|   if(runtime_check_if_big_endian()) {
  ------------------
  |  Branch (132:7): [True: 0, False: 1]
  ------------------
  133|      0|      m_processor_features |= CPUID::CPUID_IS_BIG_ENDIAN_BIT;
  134|      0|   }
  135|       |
  136|      1|   std::string clear_cpuid_env;
  137|      1|   if(OS::read_env_variable(clear_cpuid_env, "BOTAN_CLEAR_CPUID")) {
  ------------------
  |  Branch (137:7): [True: 0, False: 1]
  ------------------
  138|      0|      for(const auto& cpuid : split_on(clear_cpuid_env, ',')) {
  ------------------
  |  Branch (138:29): [True: 0, False: 0]
  ------------------
  139|      0|         for(auto& bit : CPUID::bit_from_string(cpuid)) {
  ------------------
  |  Branch (139:24): [True: 0, False: 0]
  ------------------
  140|      0|            const uint32_t cleared = ~static_cast<uint32_t>(bit);
  141|      0|            m_processor_features &= cleared;
  142|      0|         }
  143|      0|      }
  144|      0|   }
  145|      1|}
cpuid.cpp:_ZN5Botan12_GLOBAL__N_127runtime_check_if_big_endianEv:
   93|      1|bool runtime_check_if_big_endian() {
   94|       |   // Check runtime endian
   95|      1|   const uint32_t endian32 = 0x01234567;
   96|      1|   const uint8_t* e8 = reinterpret_cast<const uint8_t*>(&endian32);
   97|       |
   98|      1|   bool is_big_endian = false;
   99|       |
  100|      1|   if(e8[0] == 0x01 && e8[1] == 0x23 && e8[2] == 0x45 && e8[3] == 0x67) {
  ------------------
  |  Branch (100:7): [True: 0, False: 1]
  |  Branch (100:24): [True: 0, False: 0]
  |  Branch (100:41): [True: 0, False: 0]
  |  Branch (100:58): [True: 0, False: 0]
  ------------------
  101|      0|      is_big_endian = true;
  102|      1|   } else if(e8[0] == 0x67 && e8[1] == 0x45 && e8[2] == 0x23 && e8[3] == 0x01) {
  ------------------
  |  Branch (102:14): [True: 1, False: 0]
  |  Branch (102:31): [True: 1, False: 0]
  |  Branch (102:48): [True: 1, False: 0]
  |  Branch (102:65): [True: 1, False: 0]
  ------------------
  103|      1|      is_big_endian = false;
  104|      1|   } else {
  105|      0|      throw Internal_Error("Unexpected endian at runtime, neither big nor little");
  106|      0|   }
  107|       |
  108|       |   // If we were compiled with a known endian, verify it matches at runtime
  109|      1|#if defined(BOTAN_TARGET_CPU_IS_LITTLE_ENDIAN)
  110|      1|   BOTAN_ASSERT(!is_big_endian, "Build and runtime endian match");
  ------------------
  |  |   51|      1|   do {                                                                                 \
  |  |   52|      1|      if(!(expr))                                                                       \
  |  |  ------------------
  |  |  |  Branch (52:10): [True: 0, False: 1]
  |  |  ------------------
  |  |   53|      1|         Botan::assertion_failure(#expr, assertion_made, __func__, __FILE__, __LINE__); \
  |  |   54|      1|   } while(0)
  |  |  ------------------
  |  |  |  Branch (54:12): [Folded - Ignored]
  |  |  ------------------
  ------------------
  111|       |#elif defined(BOTAN_TARGET_CPU_IS_BIG_ENDIAN)
  112|       |   BOTAN_ASSERT(is_big_endian, "Build and runtime endian match");
  113|       |#endif
  114|       |
  115|      1|   return is_big_endian;
  116|      1|}

_ZN5Botan5CPUID10CPUID_Data19detect_cpu_featuresEv:
   69|      1|uint32_t CPUID::CPUID_Data::detect_cpu_features() {
   70|      1|   uint32_t features_detected = 0;
   71|      1|   uint32_t cpuid[4] = {0};
   72|      1|   bool has_os_ymm_support = false;
   73|      1|   bool has_os_zmm_support = false;
   74|       |
   75|       |   // CPUID 0: vendor identification, max sublevel
   76|      1|   invoke_cpuid(0, cpuid);
   77|       |
   78|      1|   const uint32_t max_supported_sublevel = cpuid[0];
   79|       |
   80|      1|   if(max_supported_sublevel >= 1) {
  ------------------
  |  Branch (80:7): [True: 1, False: 0]
  ------------------
   81|       |      // CPUID 1: feature bits
   82|      1|      invoke_cpuid(1, cpuid);
   83|      1|      const uint64_t flags0 = (static_cast<uint64_t>(cpuid[2]) << 32) | cpuid[3];
   84|       |
   85|      1|      enum x86_CPUID_1_bits : uint64_t {
   86|      1|         RDTSC = (1ULL << 4),
   87|      1|         SSE2 = (1ULL << 26),
   88|      1|         CLMUL = (1ULL << 33),
   89|      1|         SSSE3 = (1ULL << 41),
   90|      1|         AESNI = (1ULL << 57),
   91|      1|         OSXSAVE = (1ULL << 59),
   92|      1|         AVX = (1ULL << 60),
   93|      1|         RDRAND = (1ULL << 62)
   94|      1|      };
   95|       |
   96|      1|      if(flags0 & x86_CPUID_1_bits::RDTSC) {
  ------------------
  |  Branch (96:10): [True: 1, False: 0]
  ------------------
   97|      1|         features_detected |= CPUID::CPUID_RDTSC_BIT;
   98|      1|      }
   99|      1|      if(flags0 & x86_CPUID_1_bits::SSE2) {
  ------------------
  |  Branch (99:10): [True: 1, False: 0]
  ------------------
  100|      1|         features_detected |= CPUID::CPUID_SSE2_BIT;
  101|      1|      }
  102|      1|      if(flags0 & x86_CPUID_1_bits::CLMUL) {
  ------------------
  |  Branch (102:10): [True: 1, False: 0]
  ------------------
  103|      1|         features_detected |= CPUID::CPUID_CLMUL_BIT;
  104|      1|      }
  105|      1|      if(flags0 & x86_CPUID_1_bits::SSSE3) {
  ------------------
  |  Branch (105:10): [True: 1, False: 0]
  ------------------
  106|      1|         features_detected |= CPUID::CPUID_SSSE3_BIT;
  107|      1|      }
  108|      1|      if(flags0 & x86_CPUID_1_bits::AESNI) {
  ------------------
  |  Branch (108:10): [True: 1, False: 0]
  ------------------
  109|      1|         features_detected |= CPUID::CPUID_AESNI_BIT;
  110|      1|      }
  111|      1|      if(flags0 & x86_CPUID_1_bits::RDRAND) {
  ------------------
  |  Branch (111:10): [True: 1, False: 0]
  ------------------
  112|      1|         features_detected |= CPUID::CPUID_RDRAND_BIT;
  113|      1|      }
  114|       |
  115|      1|      if((flags0 & x86_CPUID_1_bits::AVX) && (flags0 & x86_CPUID_1_bits::OSXSAVE)) {
  ------------------
  |  Branch (115:10): [True: 1, False: 0]
  |  Branch (115:46): [True: 1, False: 0]
  ------------------
  116|      1|         const uint64_t xcr_flags = xgetbv();
  117|      1|         if((xcr_flags & 0x6) == 0x6) {
  ------------------
  |  Branch (117:13): [True: 1, False: 0]
  ------------------
  118|      1|            has_os_ymm_support = true;
  119|      1|            has_os_zmm_support = (xcr_flags & 0xE0) == 0xE0;
  120|      1|         }
  121|      1|      }
  122|      1|   }
  123|       |
  124|      1|   if(max_supported_sublevel >= 7) {
  ------------------
  |  Branch (124:7): [True: 1, False: 0]
  ------------------
  125|      1|      clear_mem(cpuid, 4);
  126|      1|      invoke_cpuid_sublevel(7, 0, cpuid);
  127|       |
  128|      1|      enum x86_CPUID_7_bits : uint64_t {
  129|      1|         BMI1 = (1ULL << 3),
  130|      1|         AVX2 = (1ULL << 5),
  131|      1|         BMI2 = (1ULL << 8),
  132|      1|         AVX512_F = (1ULL << 16),
  133|      1|         AVX512_DQ = (1ULL << 17),
  134|      1|         RDSEED = (1ULL << 18),
  135|      1|         ADX = (1ULL << 19),
  136|      1|         AVX512_IFMA = (1ULL << 21),
  137|      1|         SHA = (1ULL << 29),
  138|      1|         AVX512_BW = (1ULL << 30),
  139|      1|         AVX512_VL = (1ULL << 31),
  140|      1|         AVX512_VBMI = (1ULL << 33),
  141|      1|         AVX512_VBMI2 = (1ULL << 38),
  142|      1|         AVX512_VAES = (1ULL << 41),
  143|      1|         AVX512_VCLMUL = (1ULL << 42),
  144|      1|         AVX512_VBITALG = (1ULL << 44),
  145|      1|      };
  146|       |
  147|      1|      const uint64_t flags7 = (static_cast<uint64_t>(cpuid[2]) << 32) | cpuid[1];
  148|       |
  149|      1|      if((flags7 & x86_CPUID_7_bits::AVX2) && has_os_ymm_support) {
  ------------------
  |  Branch (149:10): [True: 1, False: 0]
  |  Branch (149:47): [True: 1, False: 0]
  ------------------
  150|      1|         features_detected |= CPUID::CPUID_AVX2_BIT;
  151|      1|      }
  152|      1|      if(flags7 & x86_CPUID_7_bits::RDSEED) {
  ------------------
  |  Branch (152:10): [True: 1, False: 0]
  ------------------
  153|      1|         features_detected |= CPUID::CPUID_RDSEED_BIT;
  154|      1|      }
  155|      1|      if(flags7 & x86_CPUID_7_bits::ADX) {
  ------------------
  |  Branch (155:10): [True: 1, False: 0]
  ------------------
  156|      1|         features_detected |= CPUID::CPUID_ADX_BIT;
  157|      1|      }
  158|      1|      if(flags7 & x86_CPUID_7_bits::SHA) {
  ------------------
  |  Branch (158:10): [True: 0, False: 1]
  ------------------
  159|      0|         features_detected |= CPUID::CPUID_SHA_BIT;
  160|      0|      }
  161|       |
  162|       |      /*
  163|       |      We only set the BMI bit if both BMI1 and BMI2 are supported, since
  164|       |      typically we want to use both extensions in the same code.
  165|       |      */
  166|      1|      if((flags7 & x86_CPUID_7_bits::BMI1) && (flags7 & x86_CPUID_7_bits::BMI2)) {
  ------------------
  |  Branch (166:10): [True: 1, False: 0]
  |  Branch (166:47): [True: 1, False: 0]
  ------------------
  167|      1|         features_detected |= CPUID::CPUID_BMI_BIT;
  168|      1|      }
  169|       |
  170|      1|      if((flags7 & x86_CPUID_7_bits::AVX512_F) && has_os_zmm_support) {
  ------------------
  |  Branch (170:10): [True: 0, False: 1]
  |  Branch (170:51): [True: 0, False: 0]
  ------------------
  171|      0|         const uint64_t AVX512_PROFILE_FLAGS = x86_CPUID_7_bits::AVX512_F | x86_CPUID_7_bits::AVX512_DQ |
  172|      0|                                               x86_CPUID_7_bits::AVX512_IFMA | x86_CPUID_7_bits::AVX512_BW |
  173|      0|                                               x86_CPUID_7_bits::AVX512_VL | x86_CPUID_7_bits::AVX512_VBMI |
  174|      0|                                               x86_CPUID_7_bits::AVX512_VBMI2 | x86_CPUID_7_bits::AVX512_VBITALG;
  175|       |
  176|       |         /*
  177|       |         We only enable AVX512 support if all of the above flags are available
  178|       |
  179|       |         This is more than we strictly need for most uses, however it also has
  180|       |         the effect of preventing execution of AVX512 codepaths on cores that
  181|       |         have serious downclocking problems when AVX512 code executes,
  182|       |         especially Intel Skylake.
  183|       |
  184|       |         VBMI2/VBITALG are the key flags here as they restrict us to Intel Ice
  185|       |         Lake/Rocket Lake, or AMD Zen4, all of which do not have penalties for
  186|       |         executing AVX512.
  187|       |
  188|       |         There is nothing stopping some future processor from supporting the
  189|       |         above flags and having AVX512 penalties, but maybe you should not have
  190|       |         bought such a processor.
  191|       |         */
  192|      0|         if((flags7 & AVX512_PROFILE_FLAGS) == AVX512_PROFILE_FLAGS) {
  ------------------
  |  Branch (192:13): [True: 0, False: 0]
  ------------------
  193|      0|            features_detected |= CPUID::CPUID_AVX512_BIT;
  194|       |
  195|      0|            if(flags7 & x86_CPUID_7_bits::AVX512_VAES) {
  ------------------
  |  Branch (195:16): [True: 0, False: 0]
  ------------------
  196|      0|               features_detected |= CPUID::CPUID_AVX512_AES_BIT;
  197|      0|            }
  198|      0|            if(flags7 & x86_CPUID_7_bits::AVX512_VCLMUL) {
  ------------------
  |  Branch (198:16): [True: 0, False: 0]
  ------------------
  199|      0|               features_detected |= CPUID::CPUID_AVX512_CLMUL_BIT;
  200|      0|            }
  201|      0|         }
  202|      0|      }
  203|      1|   }
  204|       |
  205|       |   /*
  206|       |   * If we don't have access to CPUID, we can still safely assume that
  207|       |   * any x86-64 processor has SSE2 and RDTSC
  208|       |   */
  209|      1|   #if defined(BOTAN_TARGET_ARCH_IS_X86_64)
  210|      1|   if(features_detected == 0) {
  ------------------
  |  Branch (210:7): [True: 0, False: 1]
  ------------------
  211|      0|      features_detected |= CPUID::CPUID_SSE2_BIT;
  212|      0|      features_detected |= CPUID::CPUID_RDTSC_BIT;
  213|      0|   }
  214|      1|   #endif
  215|       |
  216|      1|   return features_detected;
  217|      1|}
cpuid_x86.cpp:_ZN5Botan12_GLOBAL__N_112invoke_cpuidEjPj:
   33|      2|void invoke_cpuid(uint32_t type, uint32_t out[4]) {
   34|       |   #if defined(BOTAN_BUILD_COMPILER_IS_MSVC) || defined(BOTAN_BUILD_COMPILER_IS_INTEL)
   35|       |   __cpuid((int*)out, type);
   36|       |
   37|       |   #elif defined(BOTAN_BUILD_COMPILER_IS_GCC) || defined(BOTAN_BUILD_COMPILER_IS_CLANG)
   38|      2|   __get_cpuid(type, out, out + 1, out + 2, out + 3);
   39|       |
   40|       |   #elif defined(BOTAN_USE_GCC_INLINE_ASM)
   41|       |   asm("cpuid\n\t" : "=a"(out[0]), "=b"(out[1]), "=c"(out[2]), "=d"(out[3]) : "0"(type));
   42|       |
   43|       |   #else
   44|       |      #warning "No way of calling x86 cpuid instruction for this compiler"
   45|       |   clear_mem(out, 4);
   46|       |   #endif
   47|      2|}
cpuid_x86.cpp:_ZN5Botan12_GLOBAL__N_16xgetbvEv:
   49|      1|BOTAN_FUNC_ISA("xsave") uint64_t xgetbv() { return _xgetbv(0); }
cpuid_x86.cpp:_ZN5Botan12_GLOBAL__N_121invoke_cpuid_sublevelEjjPj:
   51|      1|void invoke_cpuid_sublevel(uint32_t type, uint32_t level, uint32_t out[4]) {
   52|       |   #if defined(BOTAN_BUILD_COMPILER_IS_MSVC)
   53|       |   __cpuidex((int*)out, type, level);
   54|       |
   55|       |   #elif defined(BOTAN_BUILD_COMPILER_IS_GCC) || defined(BOTAN_BUILD_COMPILER_IS_CLANG)
   56|      1|   __cpuid_count(type, level, out[0], out[1], out[2], out[3]);
   57|       |
   58|       |   #elif defined(BOTAN_USE_GCC_INLINE_ASM)
   59|       |   asm("cpuid\n\t" : "=a"(out[0]), "=b"(out[1]), "=c"(out[2]), "=d"(out[3]) : "0"(type), "2"(level));
   60|       |
   61|       |   #else
   62|       |      #warning "No way of calling x86 cpuid instruction for this compiler"
   63|       |   clear_mem(out, 4);
   64|       |   #endif
   65|      1|}

_ZN5Botan10DataSource9read_byteERh:
   25|   154k|size_t DataSource::read_byte(uint8_t& out) { return read(&out, 1); }
_ZN5Botan10DataSource12discard_nextEm:
   35|  26.6k|size_t DataSource::discard_next(size_t n) {
   36|  26.6k|   uint8_t buf[64] = {0};
   37|  26.6k|   size_t discarded = 0;
   38|       |
   39|  50.8k|   while(n) {
  ------------------
  |  Branch (39:10): [True: 24.4k, False: 26.4k]
  ------------------
   40|  24.4k|      const size_t got = this->read(buf, std::min(n, sizeof(buf)));
   41|  24.4k|      discarded += got;
   42|  24.4k|      n -= got;
   43|       |
   44|  24.4k|      if(got == 0) {
  ------------------
  |  Branch (44:10): [True: 151, False: 24.2k]
  ------------------
   45|    151|         break;
   46|    151|      }
   47|  24.4k|   }
   48|       |
   49|  26.6k|   return discarded;
   50|  26.6k|}
_ZN5Botan17DataSource_Memory4readEPhm:
   55|   104k|size_t DataSource_Memory::read(uint8_t out[], size_t length) {
   56|   104k|   const size_t got = std::min<size_t>(m_source.size() - m_offset, length);
   57|   104k|   copy_mem(out, m_source.data() + m_offset, got);
   58|   104k|   m_offset += got;
   59|   104k|   return got;
   60|   104k|}
_ZN5Botan17DataSource_Memory15check_availableEm:
   62|  5.85k|bool DataSource_Memory::check_available(size_t n) { return (n <= (m_source.size() - m_offset)); }
_ZNK5Botan17DataSource_Memory4peekEPhmm:
   67|  16.7k|size_t DataSource_Memory::peek(uint8_t out[], size_t length, size_t peek_offset) const {
   68|  16.7k|   const size_t bytes_left = m_source.size() - m_offset;
   69|  16.7k|   if(peek_offset >= bytes_left) {
  ------------------
  |  Branch (69:7): [True: 8.66k, False: 8.11k]
  ------------------
   70|  8.66k|      return 0;
   71|  8.66k|   }
   72|       |
   73|  8.11k|   const size_t got = std::min(bytes_left - peek_offset, length);
   74|  8.11k|   copy_mem(out, &m_source[m_offset + peek_offset], got);
   75|  8.11k|   return got;
   76|  16.7k|}
_ZNK5Botan17DataSource_Memory11end_of_dataEv:
   81|  2.94k|bool DataSource_Memory::end_of_data() const { return (m_offset == m_source.size()); }

_ZN5Botan9ExceptionC2ENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
   71|  2.20k|Exception::Exception(std::string_view msg) : m_msg(msg) {}
_ZN5Botan9ExceptionC2EPKcNSt3__117basic_string_viewIcNS3_11char_traitsIcEEEE:
   75|     14|Exception::Exception(const char* prefix, std::string_view msg) : m_msg(fmt("{} {}", prefix, msg)) {}
_ZN5Botan14Internal_ErrorC2ENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
   99|     14|Internal_Error::Internal_Error(std::string_view err) : Exception("Internal error:", err) {}
_ZN5Botan14Decoding_ErrorC2ENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
  125|  1.65k|Decoding_Error::Decoding_Error(std::string_view name) : Exception(name) {}

_ZN5Botan15allocate_memoryEmm:
   20|  48.2k|BOTAN_MALLOC_FN void* allocate_memory(size_t elems, size_t elem_size) {
   21|  48.2k|   if(elems == 0 || elem_size == 0) {
  ------------------
  |  Branch (21:7): [True: 0, False: 48.2k]
  |  Branch (21:21): [True: 0, False: 48.2k]
  ------------------
   22|      0|      return nullptr;
   23|      0|   }
   24|       |
   25|       |   // Some calloc implementations do not check for overflow (?!?)
   26|       |
   27|  48.2k|   if(!BOTAN_CHECKED_MUL(elems, elem_size).has_value()) {
  ------------------
  |  |   73|  48.2k|#define BOTAN_CHECKED_MUL(x, y) checked_mul(x, y)
  ------------------
  |  Branch (27:7): [True: 0, False: 48.2k]
  ------------------
   28|      0|      throw std::bad_alloc();
   29|      0|   }
   30|       |
   31|       |#if defined(BOTAN_HAS_LOCKING_ALLOCATOR)
   32|       |   if(void* p = mlock_allocator::instance().allocate(elems, elem_size)) {
   33|       |      return p;
   34|       |   }
   35|       |#endif
   36|       |
   37|       |#if defined(BOTAN_TARGET_OS_HAS_ALLOC_CONCEAL)
   38|       |   void* ptr = ::calloc_conceal(elems, elem_size);
   39|       |#else
   40|  48.2k|   void* ptr = std::calloc(elems, elem_size);  // NOLINT(*-no-malloc)
   41|  48.2k|#endif
   42|  48.2k|   if(!ptr) {
  ------------------
  |  Branch (42:7): [True: 0, False: 48.2k]
  ------------------
   43|      0|      [[unlikely]] throw std::bad_alloc();
   44|      0|   }
   45|  48.2k|   return ptr;
   46|  48.2k|}
_ZN5Botan17deallocate_memoryEPvmm:
   48|  48.2k|void deallocate_memory(void* p, size_t elems, size_t elem_size) {
   49|  48.2k|   if(p == nullptr) {
  ------------------
  |  Branch (49:7): [True: 0, False: 48.2k]
  ------------------
   50|      0|      [[unlikely]] return;
   51|      0|   }
   52|       |
   53|  48.2k|   secure_scrub_memory(p, elems * elem_size);
   54|       |
   55|       |#if defined(BOTAN_HAS_LOCKING_ALLOCATOR)
   56|       |   if(mlock_allocator::instance().deallocate(p, elems, elem_size)) {
   57|       |      return;
   58|       |   }
   59|       |#endif
   60|       |
   61|  48.2k|   std::free(p);  // NOLINT(*-no-malloc)
   62|  48.2k|}
_ZN5Botan13ct_compare_u8EPKhS1_m:
   70|  1.93k|uint8_t ct_compare_u8(const uint8_t x[], const uint8_t y[], size_t len) {
   71|  1.93k|   volatile uint8_t difference = 0;
   72|       |
   73|  63.8k|   for(size_t i = 0; i != len; ++i) {
  ------------------
  |  Branch (73:22): [True: 61.9k, False: 1.93k]
  ------------------
   74|  61.9k|      difference = difference | (x[i] ^ y[i]);
   75|  61.9k|   }
   76|       |
   77|  1.93k|   return CT::Mask<uint8_t>::is_zero(difference).value();
   78|  1.93k|}

_ZN5Botan19secure_scrub_memoryEPvm:
   78|  48.2k|void secure_scrub_memory(void* ptr, size_t n) {
   79|       |#if defined(BOTAN_TARGET_OS_HAS_RTLSECUREZEROMEMORY)
   80|       |   ::RtlSecureZeroMemory(ptr, n);
   81|       |
   82|       |#elif defined(BOTAN_TARGET_OS_HAS_EXPLICIT_BZERO)
   83|  48.2k|   ::explicit_bzero(ptr, n);
   84|       |
   85|       |#elif defined(BOTAN_TARGET_OS_HAS_EXPLICIT_MEMSET)
   86|       |   (void)::explicit_memset(ptr, 0, n);
   87|       |
   88|       |#elif defined(BOTAN_USE_VOLATILE_MEMSET_FOR_ZERO) && (BOTAN_USE_VOLATILE_MEMSET_FOR_ZERO == 1)
   89|       |   /*
   90|       |   Call memset through a static volatile pointer, which the compiler
   91|       |   should not elide. This construct should be safe in conforming
   92|       |   compilers, but who knows. I did confirm that on x86-64 GCC 6.1 and
   93|       |   Clang 3.8 both create code that saves the memset address in the
   94|       |   data segment and unconditionally loads and jumps to that address.
   95|       |   */
   96|       |   static void* (*const volatile memset_ptr)(void*, int, size_t) = std::memset;
   97|       |   (memset_ptr)(ptr, 0, n);
   98|       |#else
   99|       |
  100|       |   volatile uint8_t* p = reinterpret_cast<volatile uint8_t*>(ptr);
  101|       |
  102|       |   for(size_t i = 0; i != n; ++i)
  103|       |      p[i] = 0;
  104|       |#endif
  105|  48.2k|}
_ZN5Botan2OS14get_process_idEv:
  107|  2.50k|uint32_t OS::get_process_id() {
  108|  2.50k|#if defined(BOTAN_TARGET_OS_HAS_POSIX1)
  109|  2.50k|   return ::getpid();
  110|       |#elif defined(BOTAN_TARGET_OS_HAS_WIN32)
  111|       |   return ::GetCurrentProcessId();
  112|       |#elif defined(BOTAN_TARGET_OS_IS_LLVM) || defined(BOTAN_TARGET_OS_IS_NONE)
  113|       |   return 0;  // truly no meaningful value
  114|       |#else
  115|       |   #error "Missing get_process_id"
  116|       |#endif
  117|  2.50k|}
_ZN5Botan2OS10get_auxvalEm:
  119|      1|unsigned long OS::get_auxval(unsigned long id) {
  120|      1|#if defined(BOTAN_TARGET_OS_HAS_GETAUXVAL)
  121|      1|   return ::getauxval(id);
  122|       |#elif defined(BOTAN_TARGET_OS_IS_ANDROID) && defined(BOTAN_TARGET_ARCH_IS_ARM32)
  123|       |
  124|       |   if(id == 0)
  125|       |      return 0;
  126|       |
  127|       |   char** p = environ;
  128|       |
  129|       |   while(*p++ != nullptr)
  130|       |      ;
  131|       |
  132|       |   Elf32_auxv_t* e = reinterpret_cast<Elf32_auxv_t*>(p);
  133|       |
  134|       |   while(e != nullptr) {
  135|       |      if(e->a_type == id)
  136|       |         return e->a_un.a_val;
  137|       |      e++;
  138|       |   }
  139|       |
  140|       |   return 0;
  141|       |#elif defined(BOTAN_TARGET_OS_HAS_ELF_AUX_INFO)
  142|       |   unsigned long auxinfo = 0;
  143|       |   ::elf_aux_info(static_cast<int>(id), &auxinfo, sizeof(auxinfo));
  144|       |   return auxinfo;
  145|       |#elif defined(BOTAN_TARGET_OS_HAS_AUXINFO)
  146|       |   for(const AuxInfo* auxinfo = static_cast<AuxInfo*>(::_dlauxinfo()); auxinfo != AT_NULL; ++auxinfo) {
  147|       |      if(id == auxinfo->a_type)
  148|       |         return auxinfo->a_v;
  149|       |   }
  150|       |
  151|       |   return 0;
  152|       |#else
  153|       |   BOTAN_UNUSED(id);
  154|       |   return 0;
  155|       |#endif
  156|      1|}
_ZN5Botan2OS27running_in_privileged_stateEv:
  158|      1|bool OS::running_in_privileged_state() {
  159|      1|#if defined(AT_SECURE)
  160|      1|   return OS::get_auxval(AT_SECURE) != 0;
  161|       |#elif defined(BOTAN_TARGET_OS_HAS_POSIX1)
  162|       |   return (::getuid() != ::geteuid()) || (::getgid() != ::getegid());
  163|       |#else
  164|       |   return false;
  165|       |#endif
  166|      1|}
_ZN5Botan2OS17read_env_variableERNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS1_17basic_string_viewIcS4_EE:
  400|      1|bool OS::read_env_variable(std::string& value_out, std::string_view name_view) {
  401|      1|   value_out = "";
  402|       |
  403|      1|   if(running_in_privileged_state()) {
  ------------------
  |  Branch (403:7): [True: 0, False: 1]
  ------------------
  404|      0|      return false;
  405|      0|   }
  406|       |
  407|       |#if defined(BOTAN_TARGET_OS_HAS_WIN32) && defined(BOTAN_BUILD_COMPILER_IS_MSVC)
  408|       |   const std::string name(name_view);
  409|       |   char val[128] = {0};
  410|       |   size_t req_size = 0;
  411|       |   if(getenv_s(&req_size, val, sizeof(val), name.c_str()) == 0) {
  412|       |      value_out = std::string(val, req_size);
  413|       |      return true;
  414|       |   }
  415|       |#else
  416|      1|   const std::string name(name_view);
  417|      1|   if(const char* val = std::getenv(name.c_str())) {
  ------------------
  |  Branch (417:19): [True: 0, False: 1]
  ------------------
  418|      0|      value_out = val;
  419|      0|      return true;
  420|      0|   }
  421|      1|#endif
  422|       |
  423|      1|   return false;
  424|      1|}

_ZN5Botan9to_u32bitENSt3__117basic_string_viewIcNS0_11char_traitsIcEEEE:
   32|      1|uint32_t to_u32bit(std::string_view str_view) {
   33|      1|   const std::string str(str_view);
   34|       |
   35|       |   // std::stoul is not strict enough. Ensure that str is digit only [0-9]*
   36|      2|   for(const char chr : str) {
  ------------------
  |  Branch (36:23): [True: 2, False: 1]
  ------------------
   37|      2|      if(chr < '0' || chr > '9') {
  ------------------
  |  Branch (37:10): [True: 0, False: 2]
  |  Branch (37:23): [True: 0, False: 2]
  ------------------
   38|      0|         throw Invalid_Argument("to_u32bit invalid decimal string '" + str + "'");
   39|      0|      }
   40|      2|   }
   41|       |
   42|      1|   const unsigned long int x = std::stoul(str);
   43|       |
   44|      1|   if constexpr(sizeof(unsigned long int) > 4) {
  ------------------
  |  Branch (44:17): [Folded - Ignored]
  ------------------
   45|       |      // x might be uint64
   46|      1|      if(x > std::numeric_limits<uint32_t>::max()) {
  ------------------
  |  Branch (46:10): [True: 0, False: 1]
  ------------------
   47|      0|         throw Invalid_Argument("Integer value of " + str + " exceeds 32 bit range");
   48|      0|      }
   49|      1|   }
   50|       |
   51|      1|   return static_cast<uint32_t>(x);
   52|      1|}
_ZN5Botan8split_onENSt3__117basic_string_viewIcNS0_11char_traitsIcEEEEc:
  111|     58|std::vector<std::string> split_on(std::string_view str, char delim) {
  112|     58|   std::vector<std::string> elems;
  113|     58|   if(str.empty()) {
  ------------------
  |  Branch (113:7): [True: 0, False: 58]
  ------------------
  114|      0|      return elems;
  115|      0|   }
  116|       |
  117|     58|   std::string substr;
  118|    802|   for(auto i = str.begin(); i != str.end(); ++i) {
  ------------------
  |  Branch (118:30): [True: 744, False: 58]
  ------------------
  119|    744|      if(*i == delim) {
  ------------------
  |  Branch (119:10): [True: 58, False: 686]
  ------------------
  120|     58|         if(!substr.empty()) {
  ------------------
  |  Branch (120:13): [True: 58, False: 0]
  ------------------
  121|     58|            elems.push_back(substr);
  122|     58|         }
  123|     58|         substr.clear();
  124|    686|      } else {
  125|    686|         substr += *i;
  126|    686|      }
  127|    744|   }
  128|       |
  129|     58|   if(substr.empty()) {
  ------------------
  |  Branch (129:7): [True: 0, False: 58]
  ------------------
  130|      0|      throw Invalid_Argument(fmt("Unable to split string '{}", str));
  131|      0|   }
  132|     58|   elems.push_back(substr);
  133|       |
  134|     58|   return elems;
  135|     58|}

_ZN5Botan9SCAN_NameC2ENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
   58|      2|SCAN_Name::SCAN_Name(std::string_view algo_spec) : m_orig_algo_spec(algo_spec), m_alg_name(), m_args(), m_mode_info() {
   59|      2|   if(algo_spec.empty()) {
  ------------------
  |  Branch (59:7): [True: 0, False: 2]
  ------------------
   60|      0|      throw Invalid_Argument("Expected algorithm name, got empty string");
   61|      0|   }
   62|       |
   63|      2|   std::vector<std::pair<size_t, std::string>> name;
   64|      2|   size_t level = 0;
   65|      2|   std::pair<size_t, std::string> accum = std::make_pair(level, "");
   66|       |
   67|      2|   const std::string decoding_error = "Bad SCAN name '" + m_orig_algo_spec + "': ";
   68|       |
   69|     23|   for(char c : algo_spec) {
  ------------------
  |  Branch (69:15): [True: 23, False: 2]
  ------------------
   70|     23|      if(c == '/' || c == ',' || c == '(' || c == ')') {
  ------------------
  |  Branch (70:10): [True: 0, False: 23]
  |  Branch (70:22): [True: 0, False: 23]
  |  Branch (70:34): [True: 2, False: 21]
  |  Branch (70:46): [True: 2, False: 19]
  ------------------
   71|      4|         if(c == '(') {
  ------------------
  |  Branch (71:13): [True: 2, False: 2]
  ------------------
   72|      2|            ++level;
   73|      2|         } else if(c == ')') {
  ------------------
  |  Branch (73:20): [True: 2, False: 0]
  ------------------
   74|      2|            if(level == 0) {
  ------------------
  |  Branch (74:16): [True: 0, False: 2]
  ------------------
   75|      0|               throw Decoding_Error(decoding_error + "Mismatched parens");
   76|      0|            }
   77|      2|            --level;
   78|      2|         }
   79|       |
   80|      4|         if(c == '/' && level > 0) {
  ------------------
  |  Branch (80:13): [True: 0, False: 4]
  |  Branch (80:25): [True: 0, False: 0]
  ------------------
   81|      0|            accum.second.push_back(c);
   82|      4|         } else {
   83|      4|            if(!accum.second.empty()) {
  ------------------
  |  Branch (83:16): [True: 4, False: 0]
  ------------------
   84|      4|               name.push_back(accum);
   85|      4|            }
   86|      4|            accum = std::make_pair(level, "");
   87|      4|         }
   88|     19|      } else {
   89|     19|         accum.second.push_back(c);
   90|     19|      }
   91|     23|   }
   92|       |
   93|      2|   if(!accum.second.empty()) {
  ------------------
  |  Branch (93:7): [True: 0, False: 2]
  ------------------
   94|      0|      name.push_back(accum);
   95|      0|   }
   96|       |
   97|      2|   if(level != 0) {
  ------------------
  |  Branch (97:7): [True: 0, False: 2]
  ------------------
   98|      0|      throw Decoding_Error(decoding_error + "Missing close paren");
   99|      0|   }
  100|       |
  101|      2|   if(name.empty()) {
  ------------------
  |  Branch (101:7): [True: 0, False: 2]
  ------------------
  102|      0|      throw Decoding_Error(decoding_error + "Empty name");
  103|      0|   }
  104|       |
  105|      2|   m_alg_name = name[0].second;
  106|       |
  107|      2|   bool in_modes = false;
  108|       |
  109|      4|   for(size_t i = 1; i != name.size(); ++i) {
  ------------------
  |  Branch (109:22): [True: 2, False: 2]
  ------------------
  110|      2|      if(name[i].first == 0) {
  ------------------
  |  Branch (110:10): [True: 0, False: 2]
  ------------------
  111|      0|         m_mode_info.push_back(make_arg(name, i));
  112|      0|         in_modes = true;
  113|      2|      } else if(name[i].first == 1 && !in_modes) {
  ------------------
  |  Branch (113:17): [True: 2, False: 0]
  |  Branch (113:39): [True: 2, False: 0]
  ------------------
  114|      2|         m_args.push_back(make_arg(name, i));
  115|      2|      }
  116|      2|   }
  117|      2|}
_ZNK5Botan9SCAN_Name3argEm:
  119|      1|std::string SCAN_Name::arg(size_t i) const {
  120|      1|   if(i >= arg_count()) {
  ------------------
  |  Branch (120:7): [True: 0, False: 1]
  ------------------
  121|      0|      throw Invalid_Argument("SCAN_Name::arg " + std::to_string(i) + " out of range for '" + to_string() + "'");
  122|      0|   }
  123|      1|   return m_args[i];
  124|      1|}
_ZNK5Botan9SCAN_Name14arg_as_integerEmm:
  133|      1|size_t SCAN_Name::arg_as_integer(size_t i, size_t def_value) const {
  134|      1|   if(i >= arg_count()) {
  ------------------
  |  Branch (134:7): [True: 0, False: 1]
  ------------------
  135|      0|      return def_value;
  136|      0|   }
  137|      1|   return to_u32bit(m_args[i]);
  138|      1|}
scan_name.cpp:_ZN5Botan12_GLOBAL__N_18make_argERKNSt3__16vectorINS1_4pairImNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEEENS7_ISA_EEEEm:
   17|      2|std::string make_arg(const std::vector<std::pair<size_t, std::string>>& name, size_t start) {
   18|      2|   std::string output = name[start].second;
   19|      2|   size_t level = name[start].first;
   20|       |
   21|      2|   size_t paren_depth = 0;
   22|       |
   23|      2|   for(size_t i = start + 1; i != name.size(); ++i) {
  ------------------
  |  Branch (23:30): [True: 0, False: 2]
  ------------------
   24|      0|      if(name[i].first <= name[start].first) {
  ------------------
  |  Branch (24:10): [True: 0, False: 0]
  ------------------
   25|      0|         break;
   26|      0|      }
   27|       |
   28|      0|      if(name[i].first > level) {
  ------------------
  |  Branch (28:10): [True: 0, False: 0]
  ------------------
   29|      0|         output += "(" + name[i].second;
   30|      0|         ++paren_depth;
   31|      0|      } else if(name[i].first < level) {
  ------------------
  |  Branch (31:17): [True: 0, False: 0]
  ------------------
   32|      0|         for(size_t j = name[i].first; j < level; j++) {
  ------------------
  |  Branch (32:40): [True: 0, False: 0]
  ------------------
   33|      0|            output += ")";
   34|      0|            --paren_depth;
   35|      0|         }
   36|      0|         output += "," + name[i].second;
   37|      0|      } else {
   38|      0|         if(output[output.size() - 1] != '(') {
  ------------------
  |  Branch (38:13): [True: 0, False: 0]
  ------------------
   39|      0|            output += ",";
   40|      0|         }
   41|      0|         output += name[i].second;
   42|      0|      }
   43|       |
   44|      0|      level = name[i].first;
   45|      0|   }
   46|       |
   47|      2|   for(size_t i = 0; i != paren_depth; ++i) {
  ------------------
  |  Branch (47:22): [True: 0, False: 2]
  ------------------
   48|      0|      output += ")";
   49|      0|   }
   50|       |
   51|      2|   return output;
   52|      2|}

_ZN5Botan7X509_DN13add_attributeERKNS_3OIDERKNS_11ASN1_StringE:
   96|  1.14k|void X509_DN::add_attribute(const OID& oid, const ASN1_String& str) {
   97|  1.14k|   if(str.empty()) {
  ------------------
  |  Branch (97:7): [True: 930, False: 213]
  ------------------
   98|    930|      return;
   99|    930|   }
  100|       |
  101|    213|   m_rdn.push_back(std::make_pair(oid, str));
  102|    213|   m_dn_bits.clear();
  103|    213|}
_ZN5Botan7X509_DN11decode_fromERNS_11BER_DecoderE:
  341|  1.84k|void X509_DN::decode_from(BER_Decoder& source) {
  342|  1.84k|   std::vector<uint8_t> bits;
  343|       |
  344|  1.84k|   source.start_sequence().raw_bytes(bits).end_cons();
  345|       |
  346|  1.84k|   BER_Decoder sequence(bits);
  347|       |
  348|  1.84k|   m_rdn.clear();
  349|       |
  350|  3.74k|   while(sequence.more_items()) {
  ------------------
  |  Branch (350:10): [True: 1.89k, False: 1.84k]
  ------------------
  351|  1.89k|      BER_Decoder rdn = sequence.start_set();
  352|       |
  353|  3.48k|      while(rdn.more_items()) {
  ------------------
  |  Branch (353:13): [True: 1.58k, False: 1.89k]
  ------------------
  354|  1.58k|         OID oid;
  355|  1.58k|         ASN1_String str;
  356|       |
  357|  1.58k|         rdn.start_sequence()
  358|  1.58k|            .decode(oid)
  359|  1.58k|            .decode(str)  // TODO support Any
  360|  1.58k|            .end_cons();
  361|       |
  362|  1.58k|         add_attribute(oid, str);
  363|  1.58k|      }
  364|  1.89k|   }
  365|       |
  366|       |   // Have to assign last as add_attribute zaps m_dn_bits
  367|  1.84k|   m_dn_bits = bits;
  368|  1.84k|}

