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

_ZN5Botan17ct_expand_top_bitITkNSt3__117unsigned_integralEmEET_S2_:
   28|  4.65M|BOTAN_FORCE_INLINE constexpr T ct_expand_top_bit(T a) {
   29|  4.65M|   const T top = CT::value_barrier<T>(a >> (sizeof(T) * 8 - 1));
   30|  4.65M|   return static_cast<T>(0) - top;
   31|  4.65M|}
_ZN5Botan10ct_is_zeroITkNSt3__117unsigned_integralEmEET_S2_:
   37|  3.78M|BOTAN_FORCE_INLINE constexpr T ct_is_zero(T x) {
   38|  3.78M|   return ct_expand_top_bit<T>(~x & (x - 1));
   39|  3.78M|}
_ZN5Botan6chooseITkNSt3__117unsigned_integralEmEET_S2_S2_S2_:
  216|  3.30M|BOTAN_FORCE_INLINE constexpr T choose(T mask, T a, T b) {
  217|       |   //return (mask & a) | (~mask & b);
  218|  3.30M|   return (b ^ (mask & (a ^ b)));
  219|  3.30M|}
_ZN5Botan13is_power_of_2ITkNSt3__117unsigned_integralEmEEbT_:
   62|  53.0k|BOTAN_FORCE_INLINE constexpr bool is_power_of_2(T arg) {
   63|  53.0k|   return (arg != 0) && (arg != 1) && ((arg & static_cast<T>(arg - 1)) == 0);
  ------------------
  |  Branch (63:11): [True: 53.0k, False: 0]
  |  Branch (63:25): [True: 53.0k, False: 0]
  |  Branch (63:39): [True: 23.4k, False: 29.5k]
  ------------------
   64|  53.0k|}
_ZN5Botan8high_bitITkNSt3__117unsigned_integralEmEEmT_:
   73|  19.1k|BOTAN_FORCE_INLINE constexpr size_t high_bit(T n) {
   74|  19.1k|   size_t hb = 0;
   75|       |
   76|   134k|   for(size_t s = 8 * sizeof(T) / 2; s > 0; s /= 2) {
  ------------------
  |  Branch (76:38): [True: 115k, False: 19.1k]
  ------------------
   77|       |      // Equivalent to: ((n >> s) == 0) ? 0 : s;
   78|   115k|      const size_t z = s - ct_if_is_zero_ret<T>(n >> s, s);
   79|   115k|      hb += z;
   80|   115k|      n >>= z;
   81|   115k|   }
   82|       |
   83|  19.1k|   hb += n;
   84|       |
   85|  19.1k|   return hb;
   86|  19.1k|}
_ZN5Botan17ct_if_is_zero_retITkNSt3__117unsigned_integralEmEEmT_m:
   45|  2.72M|BOTAN_FORCE_INLINE constexpr size_t ct_if_is_zero_ret(T x, size_t s) {
   46|       |   /*
   47|       |   Similar to `return ct_is_zero(x) & s` but has to account for possibility that
   48|       |   sizeof(T) is smaller than sizeof(size_t) which would lead to incomplete masking
   49|       |   */
   50|  2.72M|   const T a = ~x & (x - 1);
   51|  2.72M|   const size_t a_top = static_cast<size_t>(CT::value_barrier<T>(a >> (sizeof(T) * 8 - 1)));
   52|  2.72M|   const size_t mask = static_cast<size_t>(0) - a_top;
   53|  2.72M|   return mask & s;
   54|  2.72M|}
_ZN5Botan10ct_is_zeroITkNSt3__117unsigned_integralEhEET_S2_:
   37|  15.2k|BOTAN_FORCE_INLINE constexpr T ct_is_zero(T x) {
   38|  15.2k|   return ct_expand_top_bit<T>(~x & (x - 1));
   39|  15.2k|}
_ZN5Botan17ct_expand_top_bitITkNSt3__117unsigned_integralEhEET_S2_:
   28|  15.2k|BOTAN_FORCE_INLINE constexpr T ct_expand_top_bit(T a) {
   29|  15.2k|   const T top = CT::value_barrier<T>(a >> (sizeof(T) * 8 - 1));
   30|  15.2k|   return static_cast<T>(0) - top;
   31|  15.2k|}
_ZN5Botan6chooseITkNSt3__117unsigned_integralEhEET_S2_S2_S2_:
  216|  15.2k|BOTAN_FORCE_INLINE constexpr T choose(T mask, T a, T b) {
  217|       |   //return (mask & a) | (~mask & b);
  218|  15.2k|   return (b ^ (mask & (a ^ b)));
  219|  15.2k|}
_ZN5Botan3ctzITkNSt3__117unsigned_integralEmEEmT_:
  115|   372k|BOTAN_FORCE_INLINE constexpr size_t ctz(T n) {
  116|       |   /*
  117|       |   * If n == 0 then this function will compute 8*sizeof(T)-1, so
  118|       |   * initialize lb to 1 if n == 0 to produce the expected result.
  119|       |   */
  120|   372k|   size_t lb = ct_if_is_zero_ret<T>(n, 1);
  121|       |
  122|  2.60M|   for(size_t s = 8 * sizeof(T) / 2; s > 0; s /= 2) {
  ------------------
  |  Branch (122:38): [True: 2.23M, False: 372k]
  ------------------
  123|  2.23M|      const T range = (static_cast<T>(1) << s) - 1;
  124|       |      // Equivalent to: ((n & range) == 0) ? s : 0;
  125|  2.23M|      const size_t z = ct_if_is_zero_ret<T>(n & range, s);
  126|  2.23M|      lb += z;
  127|  2.23M|      n >>= z;
  128|  2.23M|   }
  129|       |
  130|   372k|   return lb;
  131|   372k|}

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

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

_ZN5Botan5CPUID3hasENS_10CPUFeatureE:
   94|     29|      static bool has(CPUID::Feature feat) { return state().has_bit(feat.as_u32()); }
_ZN5Botan5CPUID6is_setEjNS_10CPUFeatureE:
  127|      4|      static inline bool is_set(uint32_t allowed, CPUID::Feature bit) {
  128|      4|         const uint32_t feat_bit = bit.as_u32();
  129|      4|         return ((allowed & feat_bit) == feat_bit);
  130|      4|      }
_ZNK5Botan5CPUID10CPUID_Data7has_bitEj:
  144|     29|            bool has_bit(uint32_t bit) const { return (m_processor_features & bit) == bit; }
_ZN5Botan5CPUID5stateEv:
  156|     29|      static CPUID_Data& state() {
  157|     29|         static CPUID::CPUID_Data g_cpuid;
  158|     29|         return g_cpuid;
  159|     29|      }
cpuid_x86.cpp:_ZN5Botan5CPUID6if_setIZNS0_10CPUID_Data19detect_cpu_featuresEjE16x86_CPUID_1_bitsEEjmT_NS_10CPUFeatureEj:
  117|      6|      static inline uint32_t if_set(uint64_t cpuid, T flag, CPUID::Feature bit, uint32_t allowed) {
  118|      6|         const uint64_t flag64 = static_cast<uint64_t>(flag);
  119|      6|         if((cpuid & flag64) == flag64) {
  ------------------
  |  Branch (119:13): [True: 6, False: 0]
  ------------------
  120|      6|            return (bit.as_u32() & allowed);
  121|      6|         } else {
  122|      0|            return 0;
  123|      0|         }
  124|      6|      }
cpuid_x86.cpp:_ZN5Botan5CPUID6if_setIZNS0_10CPUID_Data19detect_cpu_featuresEjE16x86_CPUID_7_bitsEEjmT_NS_10CPUFeatureEj:
  117|      8|      static inline uint32_t if_set(uint64_t cpuid, T flag, CPUID::Feature bit, uint32_t allowed) {
  118|      8|         const uint64_t flag64 = static_cast<uint64_t>(flag);
  119|      8|         if((cpuid & flag64) == flag64) {
  ------------------
  |  Branch (119:13): [True: 5, False: 3]
  ------------------
  120|      5|            return (bit.as_u32() & allowed);
  121|      5|         } else {
  122|      3|            return 0;
  123|      3|         }
  124|      8|      }
cpuid_x86.cpp:_ZN5Botan5CPUID6if_setIZNS0_10CPUID_Data19detect_cpu_featuresEjE18x86_CPUID_7_1_bitsEEjmT_NS_10CPUFeatureEj:
  117|      3|      static inline uint32_t if_set(uint64_t cpuid, T flag, CPUID::Feature bit, uint32_t allowed) {
  118|      3|         const uint64_t flag64 = static_cast<uint64_t>(flag);
  119|      3|         if((cpuid & flag64) == flag64) {
  ------------------
  |  Branch (119:13): [True: 0, False: 3]
  ------------------
  120|      0|            return (bit.as_u32() & allowed);
  121|      3|         } else {
  122|      3|            return 0;
  123|      3|         }
  124|      3|      }

_ZN5Botan10CPUFeatureC2ENS0_3BitE:
   51|     50|      CPUFeature(Bit b) : m_bit(b) {}  // NOLINT(*-explicit-conversions)
_ZNK5Botan10CPUFeature6as_u32Ev:
   53|     44|      uint32_t as_u32() const { return static_cast<uint32_t>(m_bit); }

_ZN5Botan2CT6Choice9from_maskEm:
  303|  17.9k|      constexpr static Choice from_mask(underlying_type v) { return Choice(v); }
_ZNK5Botan2CT6ChoicentEv:
  309|  17.4k|      constexpr Choice operator!() const { return Choice(~value()); }
_ZNK5Botan2CT6ChoiceaaERKS1_:
  311|  17.4k|      constexpr Choice operator&&(const Choice& other) const { return Choice(value() & other.value()); }
_ZNK5Botan2CT6Choice7as_boolEv:
  329|  17.4k|      constexpr bool as_bool() const { return m_value != 0; }
_ZNK5Botan2CT6Choice5valueEv:
  332|  52.2k|      constexpr underlying_type value() const { return value_barrier(m_value); }
_ZN5Botan2CT6ChoiceC2Em:
  341|  69.6k|      constexpr explicit Choice(underlying_type v) : m_value(CT::value_barrier<underlying_type>(v)) {}
_ZN5Botan2CT4MaskImE7is_zeroEm:
  437|  1.93M|      static constexpr Mask<T> is_zero(T x) { return Mask<T>(ct_is_zero<T>(value_barrier<T>(x))); }
_ZNK5Botan2CT4MaskImE5valueEv:
  630|  5.96M|      constexpr T value() const { return value_barrier<T>(m_mask); }
_ZNK5Botan2CT4MaskImEcoEv:
  533|  1.19M|      constexpr Mask<T> operator~() const { return Mask<T>(~value()); }
_ZN5Botan2CT4MaskImE6expandEm:
  392|  1.10M|      static constexpr Mask<T> expand(T v) { return ~Mask<T>::is_zero(value_barrier<T>(v)); }
_ZNK5Botan2CT4MaskImE6selectEmm:
  548|  1.06M|      constexpr T select(T x, T y) const { return choose(value(), x, y); }
_ZN5Botan2CT4MaskImE8is_equalEmm:
  442|   772k|      static constexpr Mask<T> is_equal(T x, T y) {
  443|   772k|         const T diff = value_barrier(x) ^ value_barrier(y);
  444|   772k|         return Mask<T>::is_zero(diff);
  445|   772k|      }
_ZN5Botan2CT4MaskImE5is_ltEmm:
  450|   804k|      static constexpr Mask<T> is_lt(T x, T y) {
  451|   804k|         T u = x ^ ((x ^ y) | ((x - y) ^ x));
  452|   804k|         return Mask<T>::expand_top_bit(u);
  453|   804k|      }
_ZN5Botan2CT4MaskImE14expand_top_bitEm:
  415|   869k|      static constexpr Mask<T> expand_top_bit(T v) { return Mask<T>(ct_expand_top_bit<T>(v)); }
_ZN5Botan2CT4MaskImEC2Em:
  637|  4.58M|      constexpr explicit Mask(T m) : m_mask(m) {}
_ZN5Botan2CT8unpoisonITkNSt3__18integralEmEEvRKT_:
  112|   416k|constexpr void unpoison(const T& p) {
  113|   416k|   unpoison(&p, 1);
  114|   416k|}
_ZN5Botan2CT8unpoisonImEEvPKT_m:
   67|   694k|constexpr inline void unpoison(const T* p, size_t n) {
   68|       |#if defined(BOTAN_HAS_VALGRIND)
   69|       |   if(!std::is_constant_evaluated()) {
   70|       |      VALGRIND_MAKE_MEM_DEFINED(p, n * sizeof(T));
   71|       |   }
   72|       |#endif
   73|       |
   74|   694k|   BOTAN_UNUSED(p, n);
  ------------------
  |  |  144|   694k|#define BOTAN_UNUSED Botan::ignore_params
  ------------------
   75|   694k|}
_ZN5Botan2CT20conditional_copy_memImEENS0_4MaskIT_EES3_PS3_PKS3_S7_m:
  738|  14.1k|constexpr inline Mask<T> conditional_copy_mem(T cnd, T* dest, const T* if_set, const T* if_unset, size_t elems) {
  739|  14.1k|   const auto mask = CT::Mask<T>::expand(cnd);
  740|  14.1k|   return CT::conditional_copy_mem(mask, dest, if_set, if_unset, elems);
  741|  14.1k|}
_ZN5Botan2CT20conditional_copy_memImEENS0_4MaskIT_EES4_PS3_PKS3_S7_m:
  732|  14.1k|constexpr inline Mask<T> conditional_copy_mem(Mask<T> mask, T* dest, const T* if_set, const T* if_unset, size_t elems) {
  733|  14.1k|   mask.select_n(dest, if_set, if_unset, elems);
  734|  14.1k|   return mask;
  735|  14.1k|}
_ZNK5Botan2CT4MaskImE8select_nEPmPKmS5_m:
  565|   540k|      constexpr void select_n(T output[], const T x[], const T y[], size_t len) const {
  566|   540k|         const T mask = value();
  567|  2.77M|         for(size_t i = 0; i != len; ++i) {
  ------------------
  |  Branch (567:28): [True: 2.23M, False: 540k]
  ------------------
  568|  2.23M|            output[i] = choose(mask, x[i], y[i]);
  569|  2.23M|         }
  570|   540k|      }
_ZNK5Botan2CT4MaskImE13if_set_returnEm:
  538|  1.21M|      constexpr T if_set_return(T x) const { return value() & x; }
_ZNK5Botan2CT4MaskImE7as_boolEv:
  614|  54.4k|      constexpr bool as_bool() const { return unpoisoned_value() != 0; }
_ZNK5Botan2CT4MaskImE16unpoisoned_valueEv:
  598|  72.4k|      constexpr T unpoisoned_value() const {
  599|  72.4k|         T r = value();
  600|  72.4k|         CT::unpoison(r);
  601|  72.4k|         return r;
  602|  72.4k|      }
_ZNK5Botan2CT4MaskImE11select_maskES2_S2_:
  559|   475k|      Mask<T> select_mask(Mask<T> x, Mask<T> y) const { return Mask<T>(select(x.value(), y.value())); }
_ZN5Botan2CT4MaskImEoRES2_:
  510|   374k|      Mask<T>& operator|=(Mask<T> o) {
  511|   374k|         m_mask |= o.value();
  512|   374k|         return (*this);
  513|   374k|      }
_ZN5Botan2CT4MaskImEaNES2_:
  494|  47.2k|      Mask<T>& operator&=(Mask<T> o) {
  495|  47.2k|         m_mask &= o.value();
  496|  47.2k|         return (*this);
  497|  47.2k|      }
_ZN5Botan2CT4MaskImE11expand_boolEb:
  397|    510|      static constexpr Mask<T> expand_bool(bool v) { return Mask<T>::expand(static_cast<T>(v)); }
_ZN5Botan2CT4MaskIhE11expand_boolEb:
  397|  15.2k|      static constexpr Mask<T> expand_bool(bool v) { return Mask<T>::expand(static_cast<T>(v)); }
_ZN5Botan2CT4MaskIhE6expandEh:
  392|  15.2k|      static constexpr Mask<T> expand(T v) { return ~Mask<T>::is_zero(value_barrier<T>(v)); }
_ZN5Botan2CT4MaskIhE7is_zeroEh:
  437|  15.2k|      static constexpr Mask<T> is_zero(T x) { return Mask<T>(ct_is_zero<T>(value_barrier<T>(x))); }
_ZN5Botan2CT4MaskIhEC2Eh:
  637|  30.5k|      constexpr explicit Mask(T m) : m_mask(m) {}
_ZNK5Botan2CT4MaskIhEcoEv:
  533|  15.2k|      constexpr Mask<T> operator~() const { return Mask<T>(~value()); }
_ZNK5Botan2CT4MaskIhE5valueEv:
  630|  30.5k|      constexpr T value() const { return value_barrier<T>(m_mask); }
_ZNK5Botan2CT4MaskIhE6selectEhh:
  548|  15.2k|      constexpr T select(T x, T y) const { return choose(value(), x, y); }
_ZNK5Botan2CT4MaskImE9as_choiceEv:
  619|  17.9k|      constexpr CT::Choice as_choice() const {
  620|  17.9k|         if constexpr(sizeof(T) >= sizeof(Choice::underlying_type)) {
  621|  17.9k|            return CT::Choice::from_mask(static_cast<Choice::underlying_type>(unpoisoned_value()));
  622|       |         } else {
  623|       |            return CT::Choice::from_int(unpoisoned_value());
  624|       |         }
  625|  17.9k|      }
_ZN5Botan2CT6poisonImEEvPKT_m:
   56|  14.8k|constexpr inline void poison(const T* p, size_t n) {
   57|       |#if defined(BOTAN_HAS_VALGRIND)
   58|       |   if(!std::is_constant_evaluated()) {
   59|       |      VALGRIND_MAKE_MEM_UNDEFINED(p, n * sizeof(T));
   60|       |   }
   61|       |#endif
   62|       |
   63|  14.8k|   BOTAN_UNUSED(p, n);
  ------------------
  |  |  144|  14.8k|#define BOTAN_UNUSED Botan::ignore_params
  ------------------
   64|  14.8k|}
_ZN5Botan2CT4MaskImE6is_gteEmm:
  468|  90.1k|      static constexpr Mask<T> is_gte(T x, T y) { return ~Mask<T>::is_lt(x, y); }
_ZN5Botan2CTorENS0_4MaskImEES2_:
  528|  65.5k|      friend Mask<T> operator|(Mask<T> x, Mask<T> y) { return Mask<T>(x.value() | y.value()); }
_ZN5Botan2CT6Choice8from_intIjQaasr3stdE17unsigned_integralIT_Entsr3stdE7same_asIbS3_EEES1_S3_:
  268|  16.9k|      constexpr static Choice from_int(T v) {
  269|  16.9k|         if constexpr(sizeof(T) <= sizeof(underlying_type)) {
  270|  16.9k|            return !Choice(ct_is_zero<underlying_type>(v));
  271|       |         } else {
  272|       |            // Mask of T that is either |0| or |1|
  273|       |            const T v_is_0 = ct_is_zero<T>(value_barrier<T>(v));
  274|       |
  275|       |            // We want the mask to be set if v != 0 so we must check that
  276|       |            // v_is_0 is itself zero.
  277|       |            //
  278|       |            // Also sizeof(T) may not equal sizeof(underlying_type) so we must
  279|       |            // use ct_is_zero<underlying_type>. It's ok to either truncate or
  280|       |            // zero extend v_is_0 to 32 bits since we know it is |0| or |1|
  281|       |            // so even just the low bit is sufficient.
  282|       |            return Choice(ct_is_zero<underlying_type>(static_cast<underlying_type>(v_is_0)));
  283|       |         }
  284|  16.9k|      }
_ZN5Botan2CT6poisonITkNS_6ranges14spanable_rangeENSt3__14spanIKmLm18446744073709551615EEEQaasr3stdE23is_trivially_copyable_vINS3_11conditionalIXsr21__is_primary_templateINS3_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS3_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS3_26indirectly_readable_traitsISE_EESF_E4type10value_typeEEnt17custom_poisonableISB_EEEvRKSB_:
  121|  14.1k|constexpr void poison(const R& r) {
  122|  14.1k|   const std::span s{r};
  123|  14.1k|   poison(s.data(), s.size());
  124|  14.1k|}
_ZN5Botan2CT8unpoisonITkNS_6ranges14spanable_rangeENSt3__16vectorImNS_16secure_allocatorImEEEEQaasr3stdE23is_trivially_copyable_vINS3_11conditionalIXsr21__is_primary_templateINS3_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS3_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS3_26indirectly_readable_traitsISF_EESG_E4type10value_typeEEnt19custom_unpoisonableISC_EEEvRKSC_:
  128|  44.9k|constexpr void unpoison(const R& r) {
  129|  44.9k|   const std::span s{r};
  130|  44.9k|   unpoison(s.data(), s.size());
  131|  44.9k|}
_ZN5Botan2CT8unpoisonITkNS_6ranges14spanable_rangeENSt3__14spanIKmLm18446744073709551615EEEQaasr3stdE23is_trivially_copyable_vINS3_11conditionalIXsr21__is_primary_templateINS3_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS3_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS3_26indirectly_readable_traitsISE_EESF_E4type10value_typeEEnt19custom_unpoisonableISB_EEEvRKSB_:
  128|  14.1k|constexpr void unpoison(const R& r) {
  129|  14.1k|   const std::span s{r};
  130|  14.1k|   unpoison(s.data(), s.size());
  131|  14.1k|}
_ZN5Botan2CT4MaskImE3setEv:
  382|     96|      static constexpr Mask<T> set() { return Mask<T>(static_cast<T>(~0)); }
_ZN5Botan2CT6poisonITkNS_6ranges14spanable_rangeENSt3__16vectorImNS_16secure_allocatorImEEEEQaasr3stdE23is_trivially_copyable_vINS3_11conditionalIXsr21__is_primary_templateINS3_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS3_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS3_26indirectly_readable_traitsISF_EESG_E4type10value_typeEEnt17custom_poisonableISC_EEEvRKSC_:
  121|    688|constexpr void poison(const R& r) {
  122|    688|   const std::span s{r};
  123|    688|   poison(s.data(), s.size());
  124|    688|}
_ZN5Botan2CT22conditional_assign_memImEENS0_4MaskIT_EES3_PS3_PKS3_m:
  749|   484k|constexpr inline Mask<T> conditional_assign_mem(T cnd, T* dest, const T* src, size_t elems) {
  750|   484k|   const auto mask = CT::Mask<T>::expand(cnd);
  751|   484k|   mask.select_n(dest, src, dest, elems);
  752|   484k|   return mask;
  753|   484k|}
_ZN5Botan2CT4MaskImE7clearedEv:
  387|  47.7k|      static constexpr Mask<T> cleared() { return Mask<T>(0); }
_ZNK5Botan2CT4MaskImE17if_not_set_returnEm:
  543|   372k|      constexpr T if_not_set_return(T x) const { return ~value() & x; }
_ZN5Botan2CT16driveby_unpoisonITkNS0_12unpoisonableEmEEDcOT_Qsr3stdE21is_rvalue_reference_vIDtfp_EE:
  245|     43|{
  246|     43|   unpoison(v);
  247|     43|   return std::forward<T>(v);
  248|     43|}
_ZN5Botan2CT12poison_rangeITkNSt3__16ranges5rangeENS2_6vectorINS_14Montgomery_IntENS2_9allocatorIS5_EEEEQ10poisonableINS2_11conditionalIXsr21__is_primary_templateINS2_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS3_5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS2_26indirectly_readable_traitsISF_EESG_E4type10value_typeEEEEvRKSC_:
  181|     43|constexpr void poison_range(const R& r) {
  182|    688|   for(const auto& v : r) {
  ------------------
  |  Branch (182:22): [True: 688, False: 43]
  ------------------
  183|    688|      poison(v);
  184|    688|   }
  185|     43|}
_ZN5Botan2CT6poisonITkNS0_17custom_poisonableENS_14Montgomery_IntEEEvRKT_:
  138|    688|constexpr void poison(const T& x) {
  139|    688|   x._const_time_poison();
  140|    688|}
_ZN5Botan2CT8unpoisonITkNS0_19custom_unpoisonableENS_14Montgomery_IntEEEvRKT_:
  143|  2.59k|constexpr void unpoison(const T& x) {
  144|  2.59k|   x._const_time_unpoison();
  145|  2.59k|}

_ZN5Botan3fmtIJPKcS2_S2_EEENSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEENS3_17basic_string_viewIcS6_EEDpRKT_:
   53|      1|std::string fmt(std::string_view format, const T&... args) {
   54|      1|   std::ostringstream oss;
   55|      1|   oss.imbue(std::locale::classic());
   56|      1|   fmt_detail::do_fmt(oss, format, args...);
   57|      1|   return oss.str();
   58|      1|}
_ZN5Botan10fmt_detail6do_fmtIPKcJS3_S3_EEEvRNSt3__119basic_ostringstreamIcNS4_11char_traitsIcEENS4_9allocatorIcEEEENS4_17basic_string_viewIcS7_EERKT_DpRKT0_:
   25|      1|void do_fmt(std::ostringstream& oss, std::string_view format, const T& val, const Ts&... rest) {
   26|      1|   size_t i = 0;
   27|       |
   28|      1|   while(i < format.size()) {
  ------------------
  |  Branch (28:10): [True: 1, False: 0]
  ------------------
   29|      1|      if(format[i] == '{' && (format.size() > (i + 1)) && format.at(i + 1) == '}') {
  ------------------
  |  Branch (29:10): [True: 1, False: 0]
  |  Branch (29:30): [True: 1, False: 0]
  |  Branch (29:59): [True: 1, False: 0]
  ------------------
   30|      1|         oss << val;
   31|      1|         return do_fmt(oss, format.substr(i + 2), rest...);
   32|      1|      } else {
   33|      0|         oss << format[i];
   34|      0|      }
   35|       |
   36|      0|      i += 1;
   37|      0|   }
   38|      1|}
_ZN5Botan10fmt_detail6do_fmtIPKcJS3_EEEvRNSt3__119basic_ostringstreamIcNS4_11char_traitsIcEENS4_9allocatorIcEEEENS4_17basic_string_viewIcS7_EERKT_DpRKT0_:
   25|      1|void do_fmt(std::ostringstream& oss, std::string_view format, const T& val, const Ts&... rest) {
   26|      1|   size_t i = 0;
   27|       |
   28|      5|   while(i < format.size()) {
  ------------------
  |  Branch (28:10): [True: 5, False: 0]
  ------------------
   29|      5|      if(format[i] == '{' && (format.size() > (i + 1)) && format.at(i + 1) == '}') {
  ------------------
  |  Branch (29:10): [True: 1, False: 4]
  |  Branch (29:30): [True: 1, False: 0]
  |  Branch (29:59): [True: 1, False: 0]
  ------------------
   30|      1|         oss << val;
   31|      1|         return do_fmt(oss, format.substr(i + 2), rest...);
   32|      4|      } else {
   33|      4|         oss << format[i];
   34|      4|      }
   35|       |
   36|      4|      i += 1;
   37|      4|   }
   38|      1|}
_ZN5Botan10fmt_detail6do_fmtIPKcJEEEvRNSt3__119basic_ostringstreamIcNS4_11char_traitsIcEENS4_9allocatorIcEEEENS4_17basic_string_viewIcS7_EERKT_DpRKT0_:
   25|      1|void do_fmt(std::ostringstream& oss, std::string_view format, const T& val, const Ts&... rest) {
   26|      1|   size_t i = 0;
   27|       |
   28|      2|   while(i < format.size()) {
  ------------------
  |  Branch (28:10): [True: 2, False: 0]
  ------------------
   29|      2|      if(format[i] == '{' && (format.size() > (i + 1)) && format.at(i + 1) == '}') {
  ------------------
  |  Branch (29:10): [True: 1, False: 1]
  |  Branch (29:30): [True: 1, False: 0]
  |  Branch (29:59): [True: 1, False: 0]
  ------------------
   30|      1|         oss << val;
   31|      1|         return do_fmt(oss, format.substr(i + 2), rest...);
   32|      1|      } else {
   33|      1|         oss << format[i];
   34|      1|      }
   35|       |
   36|      1|      i += 1;
   37|      1|   }
   38|      1|}
_ZN5Botan10fmt_detail6do_fmtERNSt3__119basic_ostringstreamIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS1_17basic_string_viewIcS4_EE:
   20|      1|inline void do_fmt(std::ostringstream& oss, std::string_view format) {
   21|      1|   oss << format;
   22|      1|}

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

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

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

_ZN5Botan14zeroize_bufferITkNSt3__117unsigned_integralEmEEvPT_m:
   37|  1.15M|inline void zeroize_buffer(T buf[], size_t n) {
   38|  1.15M|   if(n > 0) {
  ------------------
  |  Branch (38:7): [True: 1.05M, False: 99.3k]
  ------------------
   39|  1.05M|      std::memset(buf, 0, sizeof(T) * n);
   40|  1.05M|   }
   41|  1.15M|}
_ZN5Botan21unchecked_copy_memoryITkNSt3__117unsigned_integralEmEEvPT_PKS2_m:
   44|   131k|inline void unchecked_copy_memory(T* out, const T* in, size_t n) {
   45|   131k|   if(in != nullptr && out != nullptr && n > 0) {
  ------------------
  |  Branch (45:7): [True: 131k, False: 0]
  |  Branch (45:24): [True: 131k, False: 0]
  |  Branch (45:42): [True: 131k, False: 0]
  ------------------
   46|   131k|      std::memmove(out, in, sizeof(T) * n);
   47|   131k|   }
   48|   131k|}
_ZN5Botan14zeroize_bufferITkNSt3__117unsigned_integralEhEEvPT_m:
   37|     11|inline void zeroize_buffer(T buf[], size_t n) {
   38|     11|   if(n > 0) {
  ------------------
  |  Branch (38:7): [True: 11, False: 0]
  ------------------
   39|     11|      std::memset(buf, 0, sizeof(T) * n);
   40|     11|   }
   41|     11|}

_ZNK5Botan17Montgomery_Params1pEv:
   41|   491k|      const BigInt& p() const { return m_data->p(); }
_ZNK5Botan17Montgomery_Params2R1Ev:
   43|  2.59k|      const BigInt& R1() const { return m_data->r1(); }
_ZNK5Botan17Montgomery_Params2R2Ev:
   45|  2.59k|      const BigInt& R2() const { return m_data->r2(); }
_ZNK5Botan17Montgomery_Params6p_dashEv:
   49|   484k|      word p_dash() const { return m_data->p_dash(); }
_ZNK5Botan17Montgomery_Params7p_wordsEv:
   51|   254k|      size_t p_words() const { return m_data->p_size(); }
_ZNK5Botan17Montgomery_Params4Data1pEv:
   76|   491k|            const BigInt& p() const { return m_p; }
_ZNK5Botan17Montgomery_Params4Data2r1Ev:
   78|  2.59k|            const BigInt& r1() const { return m_r1; }
_ZNK5Botan17Montgomery_Params4Data2r2Ev:
   80|  2.59k|            const BigInt& r2() const { return m_r2; }
_ZNK5Botan17Montgomery_Params4Data6p_dashEv:
   84|   484k|            word p_dash() const { return m_p_dash; }
_ZNK5Botan17Montgomery_Params4Data6p_sizeEv:
   86|   254k|            size_t p_size() const { return m_p_words; }
_ZNK5Botan14Montgomery_Int4reprEv:
  143|  44.0k|      const secure_vector<word>& repr() const { return m_v; }
_ZNK5Botan14Montgomery_Int18_const_time_poisonEv:
  159|    688|      void _const_time_poison() const { CT::poison(m_v); }
_ZNK5Botan14Montgomery_Int20_const_time_unpoisonEv:
  161|  2.59k|      void _const_time_unpoison() const { CT::unpoison(m_v); }
_ZNK5Botan14Montgomery_Int7_paramsEv:
  163|  2.59k|      const Montgomery_Params& _params() const { return m_params; }

_ZN5Botan17monty_exp_vartimeERKNS_17Montgomery_ParamsERKNS_6BigIntES5_:
   54|  2.54k|inline Montgomery_Int monty_exp_vartime(const Montgomery_Params& params_p, const BigInt& g, const BigInt& k) {
   55|  2.54k|   auto precomputed = monty_precompute(params_p, g, 4, false);
   56|  2.54k|   return monty_execute_vartime(*precomputed, k);
   57|  2.54k|}

_ZN5Botan8word_addITkNS_8WordTypeEmEET_S1_S1_PS1_:
  231|  18.7k|inline constexpr auto word_add(W x, W y, W* carry) -> W {
  232|  18.7k|#if BOTAN_COMPILER_HAS_BUILTIN(__builtin_addc)
  233|  18.7k|   if(!std::is_constant_evaluated()) {
  ------------------
  |  Branch (233:7): [True: 18.7k, Folded]
  ------------------
  234|       |      if constexpr(std::same_as<W, unsigned int>) {
  235|       |         return __builtin_addc(x, y, *carry & 1, carry);
  236|  18.7k|      } else if constexpr(std::same_as<W, unsigned long>) {
  237|  18.7k|         return __builtin_addcl(x, y, *carry & 1, carry);
  238|       |      } else if constexpr(std::same_as<W, unsigned long long>) {
  239|       |         return __builtin_addcll(x, y, *carry & 1, carry);
  240|       |      }
  241|  18.7k|   }
  242|      0|#endif
  243|       |
  244|       |   if constexpr(WordInfo<W>::dword_is_native && use_dword_for_word_add) {
  245|       |      /*
  246|       |      TODO(Botan4) this is largely a performance hack for GCCs that don't
  247|       |      support __builtin_addc, if we increase the minimum supported version of
  248|       |      GCC to GCC 14 then we can remove this and not worry about it
  249|       |      */
  250|       |      const W cb = *carry & 1;
  251|       |      const auto s = typename WordInfo<W>::dword(x) + y + cb;
  252|       |      *carry = static_cast<W>(s >> WordInfo<W>::bits);
  253|       |      return static_cast<W>(s);
  254|  18.7k|   } else {
  255|  18.7k|      const W cb = *carry & 1;
  256|  18.7k|      W z = x + y;
  257|  18.7k|      W c1 = (z < x);
  258|  18.7k|      z += cb;
  259|  18.7k|      *carry = c1 | (z < cb);
  260|  18.7k|      return z;
  261|  18.7k|   }
  262|  18.7k|}
_ZN5Botan10word8_sub2ITkNS_8WordTypeEmEET_PS1_PKS1_S1_:
  345|  1.49k|inline constexpr auto word8_sub2(W x[8], const W y[8], W carry) -> W {
  346|  1.49k|#if defined(BOTAN_MP_USE_X86_64_ASM)
  347|  1.49k|   if(std::same_as<W, uint64_t> && !std::is_constant_evaluated()) {
  ------------------
  |  Branch (347:7): [True: 0, Folded]
  |  Branch (347:36): [True: 0, Folded]
  ------------------
  348|  1.49k|      asm volatile(ADD_OR_SUBTRACT(DO_8_TIMES(ADDSUB2_OP, "sbbq"))
  349|  1.49k|                   : [carry] "=r"(carry)
  350|  1.49k|                   : [x] "r"(x), [y] "r"(y), "0"(carry)
  351|  1.49k|                   : "cc", "memory");
  352|  1.49k|      return carry;
  353|  1.49k|   }
  354|      0|#endif
  355|       |
  356|      0|   x[0] = word_sub(x[0], y[0], &carry);
  357|      0|   x[1] = word_sub(x[1], y[1], &carry);
  358|      0|   x[2] = word_sub(x[2], y[2], &carry);
  359|      0|   x[3] = word_sub(x[3], y[3], &carry);
  360|      0|   x[4] = word_sub(x[4], y[4], &carry);
  361|      0|   x[5] = word_sub(x[5], y[5], &carry);
  362|      0|   x[6] = word_sub(x[6], y[6], &carry);
  363|      0|   x[7] = word_sub(x[7], y[7], &carry);
  364|      0|   return carry;
  365|  1.49k|}
_ZN5Botan8word_subITkNS_8WordTypeEmEET_S1_S1_PS1_:
  320|  2.47M|inline constexpr auto word_sub(W x, W y, W* carry) -> W {
  321|  2.47M|#if BOTAN_COMPILER_HAS_BUILTIN(__builtin_subc)
  322|  2.47M|   if(!std::is_constant_evaluated()) {
  ------------------
  |  Branch (322:7): [True: 2.47M, Folded]
  ------------------
  323|       |      if constexpr(std::same_as<W, unsigned int>) {
  324|       |         return __builtin_subc(x, y, *carry & 1, carry);
  325|  2.47M|      } else if constexpr(std::same_as<W, unsigned long>) {
  326|  2.47M|         return __builtin_subcl(x, y, *carry & 1, carry);
  327|       |      } else if constexpr(std::same_as<W, unsigned long long>) {
  328|       |         return __builtin_subcll(x, y, *carry & 1, carry);
  329|       |      }
  330|  2.47M|   }
  331|      0|#endif
  332|       |
  333|      0|   const W cb = *carry & 1;
  334|  2.47M|   W t0 = x - y;
  335|  2.47M|   W c1 = (t0 > x);
  336|  2.47M|   W z = t0 - cb;
  337|  2.47M|   *carry = c1 | (z > t0);
  338|  2.47M|   return z;
  339|  2.47M|}
_ZN5Botan10word8_sub3ITkNS_8WordTypeEmEET_PS1_PKS1_S4_S1_:
  371|    747|inline constexpr auto word8_sub3(W z[8], const W x[8], const W y[8], W carry) -> W {
  372|    747|#if defined(BOTAN_MP_USE_X86_64_ASM)
  373|    747|   if(std::same_as<W, uint64_t> && !std::is_constant_evaluated()) {
  ------------------
  |  Branch (373:7): [True: 0, Folded]
  |  Branch (373:36): [True: 0, Folded]
  ------------------
  374|    747|      asm volatile(ADD_OR_SUBTRACT(DO_8_TIMES(ADDSUB3_OP, "sbbq"))
  375|    747|                   : [carry] "=r"(carry)
  376|    747|                   : [x] "r"(x), [y] "r"(y), [z] "r"(z), "0"(carry)
  377|    747|                   : "cc", "memory");
  378|    747|      return carry;
  379|    747|   }
  380|      0|#endif
  381|       |
  382|      0|   z[0] = word_sub(x[0], y[0], &carry);
  383|      0|   z[1] = word_sub(x[1], y[1], &carry);
  384|      0|   z[2] = word_sub(x[2], y[2], &carry);
  385|      0|   z[3] = word_sub(x[3], y[3], &carry);
  386|      0|   z[4] = word_sub(x[4], y[4], &carry);
  387|      0|   z[5] = word_sub(x[5], y[5], &carry);
  388|      0|   z[6] = word_sub(x[6], y[6], &carry);
  389|      0|   z[7] = word_sub(x[7], y[7], &carry);
  390|      0|   return carry;
  391|    747|}
_ZN5Botan10word_madd2ITkNS_8WordTypeEmEET_S1_S1_PS1_:
   90|   125k|inline constexpr auto word_madd2(W a, W b, W* c) -> W {
   91|   125k|#if defined(BOTAN_MP_USE_X86_64_ASM)
   92|   125k|   if(std::same_as<W, uint64_t> && !std::is_constant_evaluated()) {
  ------------------
  |  Branch (92:7): [True: 0, Folded]
  |  Branch (92:36): [True: 0, Folded]
  ------------------
   93|   125k|      asm(R"(
   94|   125k|         mulq %[b]
   95|   125k|         addq %[c],%[a]
   96|   125k|         adcq $0,%[carry]
   97|   125k|         )"
   98|   125k|          : [a] "=a"(a), [b] "=rm"(b), [carry] "=&d"(*c)
   99|   125k|          : "0"(a), "1"(b), [c] "g"(*c)
  100|   125k|          : "cc");
  101|       |
  102|   125k|      return a;
  103|   125k|   }
  104|       |#elif defined(BOTAN_MP_USE_AARCH64_ASM)
  105|       |   if(std::same_as<W, uint64_t> && !std::is_constant_evaluated()) {
  106|       |      W lo = 0;
  107|       |      W hi = 0;
  108|       |      asm(R"(
  109|       |         mul  %[lo], %[a], %[b]
  110|       |         umulh %[hi], %[a], %[b]
  111|       |         adds %[lo], %[lo], %[c]
  112|       |         adc  %[hi], %[hi], xzr
  113|       |         )"
  114|       |          : [lo] "=&r"(lo), [hi] "=&r"(hi)
  115|       |          : [a] "r"(a), [b] "r"(b), [c] "r"(*c)
  116|       |          : "cc");
  117|       |
  118|       |      *c = hi;
  119|       |      return lo;
  120|       |   }
  121|       |#endif
  122|       |
  123|      0|   typedef typename WordInfo<W>::dword dword;
  124|      0|   const dword s = dword(a) * b + *c;
  125|      0|   *c = static_cast<W>(s >> WordInfo<W>::bits);
  126|      0|   return static_cast<W>(s);
  127|   125k|}
_ZN5Botan5word3ImEC2Ev:
  458|  1.00M|      constexpr word3() : m_w(0) {}
_ZN5Botan5word3ImE3mulEmm:
  460|  12.0M|      inline constexpr void mul(W x, W y) { m_w += static_cast<W3>(x) * y; }
_ZN5Botan5word3ImE7extractEv:
  466|  6.70M|      inline constexpr W extract() {
  467|  6.70M|         W r = static_cast<W>(m_w);
  468|  6.70M|         m_w >>= WordInfo<W>::bits;
  469|  6.70M|         return r;
  470|  6.70M|      }
_ZN5Botan5word3ImE6mul_x2Emm:
  462|  2.29M|      inline constexpr void mul_x2(W x, W y) { m_w += static_cast<W3>(x) * y * 2; }
_ZN5Botan5word3ImE3addEm:
  464|  3.87M|      inline constexpr void add(W x) { m_w += x; }
_ZN5Botan5word3ImE10monty_stepEmm:
  472|  1.93M|      inline constexpr W monty_step(W p0, W p_dash) {
  473|  1.93M|         const W w0 = static_cast<W>(m_w);
  474|  1.93M|         const W r = w0 * p_dash;
  475|  1.93M|         mul(r, p0);
  476|  1.93M|         m_w >>= WordInfo<W>::bits;
  477|  1.93M|         return r;
  478|  1.93M|      }

_ZN5Botan17bigint_monty_redcEPmPKmS2_mmS0_m:
  924|   484k|   word r[], const word z[], const word p[], size_t p_size, word p_dash, word ws[], size_t ws_size) {
  925|   484k|   const size_t z_size = 2 * p_size;
  926|       |
  927|   484k|   BOTAN_ARG_CHECK(ws_size >= p_size, "Montgomery reduction workspace too small");
  ------------------
  |  |   35|   484k|   do {                                                          \
  |  |   36|   484k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */              \
  |  |   37|   484k|      if(!(expr)) {                                              \
  |  |  ------------------
  |  |  |  Branch (37:10): [True: 0, False: 484k]
  |  |  ------------------
  |  |   38|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */     \
  |  |   39|      0|         Botan::throw_invalid_argument(msg, __func__, __FILE__); \
  |  |   40|      0|      }                                                          \
  |  |   41|   484k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 484k]
  |  |  ------------------
  ------------------
  928|       |
  929|   484k|   if(p_size == 4) {
  ------------------
  |  Branch (929:7): [True: 484k, False: 0]
  ------------------
  930|   484k|      bigint_monty_redc_4(r, z, p, p_dash, ws);
  931|   484k|   } else if(p_size == 6) {
  ------------------
  |  Branch (931:14): [True: 0, False: 0]
  ------------------
  932|      0|      bigint_monty_redc_6(r, z, p, p_dash, ws);
  933|      0|   } else if(p_size == 8) {
  ------------------
  |  Branch (933:14): [True: 0, False: 0]
  ------------------
  934|      0|      bigint_monty_redc_8(r, z, p, p_dash, ws);
  935|      0|   } else if(p_size == 12) {
  ------------------
  |  Branch (935:14): [True: 0, False: 0]
  ------------------
  936|      0|      bigint_monty_redc_12(r, z, p, p_dash, ws);
  937|      0|   } else if(p_size == 16) {
  ------------------
  |  Branch (937:14): [True: 0, False: 0]
  ------------------
  938|      0|      bigint_monty_redc_16(r, z, p, p_dash, ws);
  939|      0|   } else if(p_size == 24) {
  ------------------
  |  Branch (939:14): [True: 0, False: 0]
  ------------------
  940|      0|      bigint_monty_redc_24(r, z, p, p_dash, ws);
  941|      0|   } else if(p_size == 32) {
  ------------------
  |  Branch (941:14): [True: 0, False: 0]
  ------------------
  942|      0|      bigint_monty_redc_32(r, z, p, p_dash, ws);
  943|      0|   } else {
  944|      0|      bigint_monty_redc_generic(r, z, z_size, p, p_size, p_dash, ws);
  945|      0|   }
  946|   484k|}
_ZN5Botan25bigint_monty_redc_inplaceEPmPKmmmS0_m:
  948|   484k|inline void bigint_monty_redc_inplace(word z[], const word p[], size_t p_size, word p_dash, word ws[], size_t ws_size) {
  949|   484k|   bigint_monty_redc(z, z, p, p_size, p_dash, ws, ws_size);
  950|   484k|   zeroize_buffer(z + p_size, p_size);
  951|   484k|}
_ZN5Botan11bigint_add2ITkNS_8WordTypeEmEET_PS1_mPKS1_m:
   94|    101|inline constexpr auto bigint_add2(W x[], size_t x_size, const W y[], size_t y_size) -> W {
   95|    101|   W carry = 0;
   96|       |
   97|    101|   BOTAN_ASSERT(x_size >= y_size, "Expected sizes");
  ------------------
  |  |   64|    101|   do {                                                                                 \
  |  |   65|    101|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                                     \
  |  |   66|    101|      if(!(expr)) {                                                                     \
  |  |  ------------------
  |  |  |  Branch (66:10): [True: 0, False: 101]
  |  |  ------------------
  |  |   67|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                            \
  |  |   68|      0|         Botan::assertion_failure(#expr, assertion_made, __func__, __FILE__, __LINE__); \
  |  |   69|      0|      }                                                                                 \
  |  |   70|    101|   } while(0)
  |  |  ------------------
  |  |  |  Branch (70:12): [Folded, False: 101]
  |  |  ------------------
  ------------------
   98|       |
   99|    101|   const size_t blocks = y_size - (y_size % 8);
  100|       |
  101|    101|   for(size_t i = 0; i != blocks; i += 8) {
  ------------------
  |  Branch (101:22): [True: 0, False: 101]
  ------------------
  102|      0|      carry = word8_add2(x + i, y + i, carry);
  103|      0|   }
  104|       |
  105|    202|   for(size_t i = blocks; i != y_size; ++i) {
  ------------------
  |  Branch (105:27): [True: 101, False: 101]
  ------------------
  106|    101|      x[i] = word_add(x[i], y[i], &carry);
  107|    101|   }
  108|       |
  109|    707|   for(size_t i = y_size; i != x_size; ++i) {
  ------------------
  |  Branch (109:27): [True: 606, False: 101]
  ------------------
  110|    606|      x[i] = word_add(x[i], static_cast<W>(0), &carry);
  111|    606|   }
  112|       |
  113|    101|   return carry;
  114|    101|}
_ZN5Botan10bigint_cmpITkNS_8WordTypeEmEEiPKT_mS3_m:
  439|   107k|inline constexpr int32_t bigint_cmp(const W x[], size_t x_size, const W y[], size_t y_size) {
  440|   107k|   static_assert(sizeof(W) >= sizeof(uint32_t), "Size assumption");
  441|       |
  442|   107k|   const W LT = static_cast<W>(-1);
  443|   107k|   const W EQ = 0;
  444|   107k|   const W GT = 1;
  445|       |
  446|   107k|   const size_t common_elems = std::min(x_size, y_size);
  447|       |
  448|   107k|   W result = EQ;  // until found otherwise
  449|       |
  450|   345k|   for(size_t i = 0; i != common_elems; i++) {
  ------------------
  |  Branch (450:22): [True: 238k, False: 107k]
  ------------------
  451|   238k|      const auto is_eq = CT::Mask<W>::is_equal(x[i], y[i]);
  452|   238k|      const auto is_lt = CT::Mask<W>::is_lt(x[i], y[i]);
  453|       |
  454|   238k|      result = is_eq.select(result, is_lt.select(LT, GT));
  455|   238k|   }
  456|       |
  457|   107k|   if(x_size < y_size) {
  ------------------
  |  Branch (457:7): [True: 71, False: 107k]
  ------------------
  458|     71|      W mask = 0;
  459|    147|      for(size_t i = x_size; i != y_size; i++) {
  ------------------
  |  Branch (459:30): [True: 76, False: 71]
  ------------------
  460|     76|         mask |= y[i];
  461|     76|      }
  462|       |
  463|       |      // If any bits were set in high part of y, then x < y
  464|     71|      result = CT::Mask<W>::is_zero(mask).select(result, LT);
  465|   107k|   } else if(y_size < x_size) {
  ------------------
  |  Branch (465:14): [True: 3.95k, False: 103k]
  ------------------
  466|  3.95k|      W mask = 0;
  467|  11.7k|      for(size_t i = y_size; i != x_size; i++) {
  ------------------
  |  Branch (467:30): [True: 7.77k, False: 3.95k]
  ------------------
  468|  7.77k|         mask |= x[i];
  469|  7.77k|      }
  470|       |
  471|       |      // If any bits were set in high part of x, then x > y
  472|  3.95k|      result = CT::Mask<W>::is_zero(mask).select(result, GT);
  473|  3.95k|   }
  474|       |
  475|   107k|   CT::unpoison(result);
  476|   107k|   BOTAN_DEBUG_ASSERT(result == LT || result == GT || result == EQ);
  ------------------
  |  |  130|   107k|      do { /* NOLINT(*-avoid-do-while) */ \
  |  |  131|   107k|      } while(0)
  |  |  ------------------
  |  |  |  Branch (131:15): [Folded, False: 107k]
  |  |  ------------------
  ------------------
  477|   107k|   return static_cast<int32_t>(result);
  478|   107k|}
_ZN5Botan11bigint_sub2ITkNS_8WordTypeEmEET_PS1_mPKS1_m:
  148|  33.1k|inline constexpr auto bigint_sub2(W x[], size_t x_size, const W y[], size_t y_size) -> W {
  149|  33.1k|   W borrow = 0;
  150|       |
  151|  33.1k|   BOTAN_ASSERT(x_size >= y_size, "Expected sizes");
  ------------------
  |  |   64|  33.1k|   do {                                                                                 \
  |  |   65|  33.1k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                                     \
  |  |   66|  33.1k|      if(!(expr)) {                                                                     \
  |  |  ------------------
  |  |  |  Branch (66:10): [True: 0, False: 33.1k]
  |  |  ------------------
  |  |   67|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                            \
  |  |   68|      0|         Botan::assertion_failure(#expr, assertion_made, __func__, __FILE__, __LINE__); \
  |  |   69|      0|      }                                                                                 \
  |  |   70|  33.1k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (70:12): [Folded, False: 33.1k]
  |  |  ------------------
  ------------------
  152|       |
  153|  33.1k|   const size_t blocks = y_size - (y_size % 8);
  154|       |
  155|  34.6k|   for(size_t i = 0; i != blocks; i += 8) {
  ------------------
  |  Branch (155:22): [True: 1.49k, False: 33.1k]
  ------------------
  156|  1.49k|      borrow = word8_sub2(x + i, y + i, borrow);
  157|  1.49k|   }
  158|       |
  159|   180k|   for(size_t i = blocks; i != y_size; ++i) {
  ------------------
  |  Branch (159:27): [True: 147k, False: 33.1k]
  ------------------
  160|   147k|      x[i] = word_sub(x[i], y[i], &borrow);
  161|   147k|   }
  162|       |
  163|  37.6k|   for(size_t i = y_size; i != x_size; ++i) {
  ------------------
  |  Branch (163:27): [True: 4.51k, False: 33.1k]
  ------------------
  164|  4.51k|      x[i] = word_sub(x[i], static_cast<W>(0), &borrow);
  165|  4.51k|   }
  166|       |
  167|  33.1k|   return borrow;
  168|  33.1k|}
_ZN5Botan15bigint_sub2_revITkNS_8WordTypeEmEEvPT_PKS1_m:
  174|     16|inline constexpr void bigint_sub2_rev(W x[], const W y[], size_t y_size) {
  175|     16|   W borrow = 0;
  176|       |
  177|     79|   for(size_t i = 0; i != y_size; ++i) {
  ------------------
  |  Branch (177:22): [True: 63, False: 16]
  ------------------
  178|     63|      x[i] = word_sub(y[i], x[i], &borrow);
  179|     63|   }
  180|       |
  181|     16|   BOTAN_ASSERT(borrow == 0, "y must be greater than x");
  ------------------
  |  |   64|     16|   do {                                                                                 \
  |  |   65|     16|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                                     \
  |  |   66|     16|      if(!(expr)) {                                                                     \
  |  |  ------------------
  |  |  |  Branch (66:10): [True: 0, False: 16]
  |  |  ------------------
  |  |   67|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                            \
  |  |   68|      0|         Botan::assertion_failure(#expr, assertion_made, __func__, __FILE__, __LINE__); \
  |  |   69|      0|      }                                                                                 \
  |  |   70|     16|   } while(0)
  |  |  ------------------
  |  |  |  Branch (70:12): [Folded, False: 16]
  |  |  ------------------
  ------------------
  182|     16|}
_ZN5Botan11bigint_sub3ITkNS_8WordTypeEmEET_PS1_PKS1_mS4_m:
  192|  50.2k|inline constexpr auto bigint_sub3(W z[], const W x[], size_t x_size, const W y[], size_t y_size) -> W {
  193|  50.2k|   W borrow = 0;
  194|       |
  195|  50.2k|   BOTAN_ASSERT(x_size >= y_size, "Expected sizes");
  ------------------
  |  |   64|  50.2k|   do {                                                                                 \
  |  |   65|  50.2k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                                     \
  |  |   66|  50.2k|      if(!(expr)) {                                                                     \
  |  |  ------------------
  |  |  |  Branch (66:10): [True: 0, False: 50.2k]
  |  |  ------------------
  |  |   67|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                            \
  |  |   68|      0|         Botan::assertion_failure(#expr, assertion_made, __func__, __FILE__, __LINE__); \
  |  |   69|      0|      }                                                                                 \
  |  |   70|  50.2k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (70:12): [Folded, False: 50.2k]
  |  |  ------------------
  ------------------
  196|       |
  197|  50.2k|   const size_t blocks = y_size - (y_size % 8);
  198|       |
  199|  51.0k|   for(size_t i = 0; i != blocks; i += 8) {
  ------------------
  |  Branch (199:22): [True: 747, False: 50.2k]
  ------------------
  200|    747|      borrow = word8_sub3(z + i, x + i, y + i, borrow);
  201|    747|   }
  202|       |
  203|   232k|   for(size_t i = blocks; i != y_size; ++i) {
  ------------------
  |  Branch (203:27): [True: 182k, False: 50.2k]
  ------------------
  204|   182k|      z[i] = word_sub(x[i], y[i], &borrow);
  205|   182k|   }
  206|       |
  207|   113k|   for(size_t i = y_size; i != x_size; ++i) {
  ------------------
  |  Branch (207:27): [True: 63.5k, False: 50.2k]
  ------------------
  208|  63.5k|      z[i] = word_sub(x[i], static_cast<W>(0), &borrow);
  209|  63.5k|   }
  210|       |
  211|  50.2k|   return borrow;
  212|  50.2k|}
_ZN5Botan11bigint_add3ITkNS_8WordTypeEmEET_PS1_PKS1_mS4_m:
  120|  1.51k|inline constexpr auto bigint_add3(W z[], const W x[], size_t x_size, const W y[], size_t y_size) -> W {
  121|  1.51k|   if(x_size < y_size) {
  ------------------
  |  Branch (121:7): [True: 46, False: 1.46k]
  ------------------
  122|     46|      return bigint_add3(z, y, y_size, x, x_size);
  123|     46|   }
  124|       |
  125|  1.46k|   W carry = 0;
  126|       |
  127|  1.46k|   const size_t blocks = y_size - (y_size % 8);
  128|       |
  129|  1.46k|   for(size_t i = 0; i != blocks; i += 8) {
  ------------------
  |  Branch (129:22): [True: 0, False: 1.46k]
  ------------------
  130|      0|      carry = word8_add3(z + i, x + i, y + i, carry);
  131|      0|   }
  132|       |
  133|  5.16k|   for(size_t i = blocks; i != y_size; ++i) {
  ------------------
  |  Branch (133:27): [True: 3.70k, False: 1.46k]
  ------------------
  134|  3.70k|      z[i] = word_add(x[i], y[i], &carry);
  135|  3.70k|   }
  136|       |
  137|  3.57k|   for(size_t i = y_size; i != x_size; ++i) {
  ------------------
  |  Branch (137:27): [True: 2.11k, False: 1.46k]
  ------------------
  138|  2.11k|      z[i] = word_add(x[i], static_cast<W>(0), &carry);
  139|  2.11k|   }
  140|       |
  141|  1.46k|   return carry;
  142|  1.51k|}
_ZN5Botan14bigint_linmul3ITkNS_8WordTypeEmEEvPT_PKS1_mS1_:
  416|  17.5k|inline constexpr void bigint_linmul3(W z[], const W x[], size_t x_size, W y) {
  417|  17.5k|   const size_t blocks = x_size - (x_size % 8);
  418|       |
  419|  17.5k|   W carry = 0;
  420|       |
  421|  17.5k|   for(size_t i = 0; i != blocks; i += 8) {
  ------------------
  |  Branch (421:22): [True: 0, False: 17.5k]
  ------------------
  422|      0|      carry = word8_linmul3(z + i, x + i, y, carry);
  423|      0|   }
  424|       |
  425|  69.2k|   for(size_t i = blocks; i != x_size; ++i) {
  ------------------
  |  Branch (425:27): [True: 51.6k, False: 17.5k]
  ------------------
  426|  51.6k|      z[i] = word_madd2(x[i], y, &carry);
  427|  51.6k|   }
  428|       |
  429|  17.5k|   z[x_size] = carry;
  430|  17.5k|}
_ZN5Botan14divide_precompImEC2Em:
  574|  45.0k|      explicit constexpr divide_precomp(W divisor) : m_divisor(divisor) {
  575|  45.0k|         BOTAN_ARG_CHECK(m_divisor != 0, "Division by zero");
  ------------------
  |  |   35|  45.0k|   do {                                                          \
  |  |   36|  45.0k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */              \
  |  |   37|  45.0k|      if(!(expr)) {                                              \
  |  |  ------------------
  |  |  |  Branch (37:10): [True: 0, False: 45.0k]
  |  |  ------------------
  |  |   38|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */     \
  |  |   39|      0|         Botan::throw_invalid_argument(msg, __func__, __FILE__); \
  |  |   40|      0|      }                                                          \
  |  |   41|  45.0k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 45.0k]
  |  |  ------------------
  ------------------
  576|  45.0k|      }
_ZNK5Botan14divide_precompImE16vartime_mod_2to1Emm:
  644|  33.7k|      inline constexpr W vartime_mod_2to1(W n1, W n0) const {
  645|  33.7k|         BOTAN_ASSERT_NOMSG(n1 < m_divisor);
  ------------------
  |  |   77|  33.7k|   do {                                                                     \
  |  |   78|  33.7k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   79|  33.7k|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (79:10): [True: 0, False: 33.7k]
  |  |  ------------------
  |  |   80|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   81|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   82|      0|      }                                                                     \
  |  |   83|  33.7k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (83:12): [Folded, False: 33.7k]
  |  |  ------------------
  ------------------
  646|  33.7k|         W q = this->vartime_div_2to1(n1, n0);
  647|  33.7k|         W carry = 0;
  648|  33.7k|         q = word_madd2(q, m_divisor, &carry);
  649|  33.7k|         return (n0 - q);
  650|  33.7k|      }
_ZNK5Botan14divide_precompImE16vartime_div_2to1Emm:
  581|  52.0k|      inline constexpr W vartime_div_2to1(W n1, W n0) const {
  582|  52.0k|         BOTAN_ASSERT_NOMSG(n1 < m_divisor);
  ------------------
  |  |   77|  52.0k|   do {                                                                     \
  |  |   78|  52.0k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   79|  52.0k|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (79:10): [True: 0, False: 52.0k]
  |  |  ------------------
  |  |   80|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   81|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   82|      0|      }                                                                     \
  |  |   83|  52.0k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (83:12): [Folded, False: 52.0k]
  |  |  ------------------
  ------------------
  583|       |
  584|  52.0k|         if(m_divisor == WordInfo<W>::max) {
  ------------------
  |  Branch (584:13): [True: 488, False: 51.5k]
  ------------------
  585|    488|            return vartime_div_2to1_max_d(n1, n0);
  586|    488|         }
  587|       |
  588|  51.5k|         if(m_divisor == WordInfo<W>::top_bit) {
  ------------------
  |  Branch (588:13): [True: 6, False: 51.5k]
  ------------------
  589|       |            // Simply a shift by N-1 bits
  590|      6|            return (n1 << 1) | (n0 >> (WordInfo<W>::bits - 1));
  591|      6|         }
  592|       |
  593|  51.5k|         if(!std::is_constant_evaluated()) {
  ------------------
  |  Branch (593:13): [True: 51.5k, Folded]
  ------------------
  594|  51.5k|#if defined(BOTAN_MP_USE_X86_64_ASM)
  595|  51.5k|            if constexpr(std::same_as<W, uint64_t>) {
  596|  51.5k|               W quotient = 0;
  597|  51.5k|               W remainder = 0;
  598|       |               // NOLINTNEXTLINE(*-no-assembler)
  599|  51.5k|               asm("divq %[v]" : "=a"(quotient), "=d"(remainder) : [v] "r"(m_divisor), "a"(n0), "d"(n1) : "cc");
  600|  51.5k|               return quotient;
  601|  51.5k|            }
  602|      0|#endif
  603|       |
  604|      0|#if !defined(BOTAN_BUILD_COMPILER_IS_CLANGCL)
  605|       |
  606|       |            /* clang-cl has a bug where on encountering a 128/64 division it emits
  607|       |            * a call to __udivti3() but then fails to link the relevant builtin into
  608|       |            * the binary, causing a link failure. Work around this by simply omitting
  609|       |            * such code for clang-cl
  610|       |            *
  611|       |            * See https://github.com/llvm/llvm-project/issues/25679
  612|       |            */
  613|  51.5k|            if constexpr(WordInfo<W>::dword_is_native) {
  614|  51.5k|               typename WordInfo<W>::dword n = n1;
  615|  51.5k|               n <<= WordInfo<W>::bits;
  616|  51.5k|               n |= n0;
  617|  51.5k|               return static_cast<W>(n / m_divisor);
  618|  51.5k|            }
  619|  51.5k|#endif
  620|  51.5k|         }
  621|       |
  622|      0|         W high = n1;
  623|  51.5k|         W quotient = 0;
  624|       |
  625|  51.5k|         for(size_t i = 0; i != WordInfo<W>::bits; ++i) {
  ------------------
  |  Branch (625:28): [True: 0, False: 51.5k]
  ------------------
  626|      0|            const W high_top_bit = high >> (WordInfo<W>::bits - 1);
  627|       |
  628|      0|            high <<= 1;
  629|      0|            high |= (n0 >> (WordInfo<W>::bits - 1 - i)) & 1;
  630|      0|            quotient <<= 1;
  631|       |
  632|      0|            if(high_top_bit || high >= m_divisor) {
  ------------------
  |  Branch (632:16): [True: 0, False: 0]
  |  Branch (632:32): [True: 0, False: 0]
  ------------------
  633|      0|               high -= m_divisor;
  634|      0|               quotient |= 1;
  635|      0|            }
  636|      0|         }
  637|       |
  638|  51.5k|         return quotient;
  639|  51.5k|      }
_ZN5Botan14divide_precompImE22vartime_div_2to1_max_dEmm:
  657|    488|      static inline constexpr W vartime_div_2to1_max_d(W n1, W n0) {
  658|       |         /*
  659|       |         Use k to refer to WordInfo<W>::bits
  660|       |
  661|       |         We are dividing n = (n1 * 2^k) + n0 by 2^k - 1
  662|       |
  663|       |         Recall that 2^k = 1 (mod 2^k - 1)
  664|       |
  665|       |         Rewrite n = n1*2^k + n0 as n1*(2^k - 1) + n1 + n0
  666|       |
  667|       |         The result of dividing n by (2^k - 1) will be equal to
  668|       |         (n1*(2^k-1) + n1 + n0) / (2^k-1) =
  669|       |         n1 + ((n1 + n0) / (2^k-1)
  670|       |
  671|       |         Use c to refer to ((n1 + n0) / (2^k-1))
  672|       |
  673|       |         If (n1 + n0) < (2^k - 1) then c is 0
  674|       |         If (n1 + n0) >= (2^k - 1) then c is 1
  675|       |
  676|       |         Since n1 < 2^k - 1 [*] and n0 <= 2^k - 1 it is impossible for (n1 + n0) / (2^k -1)
  677|       |         to be greater than 1.
  678|       |
  679|       |         [*] We require n1 be strictly less than the divisor to ensure that the
  680|       |         output fits in a single word; this is checked at the start of vartime_div_2to1.
  681|       |         */
  682|       |
  683|    488|         const W s = n0 + n1;
  684|       |         // did n0 + n1 overflow? or does (n0 + n1) == 2^k - 1? if either, c == 1
  685|    488|         if(s < n0 || s == WordInfo<W>::max) {
  ------------------
  |  Branch (685:13): [True: 108, False: 380]
  |  Branch (685:23): [True: 1, False: 379]
  ------------------
  686|    109|            n1 += 1;
  687|    109|         }
  688|       |
  689|    488|         return n1;
  690|    488|      }
_ZN5Botan11bigint_shl1ITkNS_8WordTypeEmEEvPT_mmm:
  309|  33.0k|inline constexpr void bigint_shl1(W x[], size_t x_size, size_t x_words, size_t shift) {
  310|  33.0k|   const size_t word_shift = shift / WordInfo<W>::bits;
  311|  33.0k|   const size_t bit_shift = shift % WordInfo<W>::bits;
  312|       |
  313|  33.0k|   BOTAN_ASSERT_NOMSG(word_shift <= x_size);
  ------------------
  |  |   77|  33.0k|   do {                                                                     \
  |  |   78|  33.0k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   79|  33.0k|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (79:10): [True: 0, False: 33.0k]
  |  |  ------------------
  |  |   80|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   81|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   82|      0|      }                                                                     \
  |  |   83|  33.0k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (83:12): [Folded, False: 33.0k]
  |  |  ------------------
  ------------------
  314|  33.0k|   BOTAN_ASSERT_NOMSG(x_words <= x_size - word_shift);
  ------------------
  |  |   77|  33.0k|   do {                                                                     \
  |  |   78|  33.0k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   79|  33.0k|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (79:10): [True: 0, False: 33.0k]
  |  |  ------------------
  |  |   80|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   81|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   82|      0|      }                                                                     \
  |  |   83|  33.0k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (83:12): [Folded, False: 33.0k]
  |  |  ------------------
  ------------------
  315|       |
  316|  33.0k|   unchecked_copy_memory(x + word_shift, x, x_words);
  317|  33.0k|   zeroize_buffer(x, word_shift);
  318|       |
  319|  33.0k|   const auto carry_mask = CT::Mask<W>::expand(bit_shift);
  320|  33.0k|   const W carry_shift = carry_mask.if_set_return(WordInfo<W>::bits - bit_shift);
  321|       |
  322|  33.0k|   W carry = 0;
  323|   161k|   for(size_t i = word_shift; i != x_size; ++i) {
  ------------------
  |  Branch (323:31): [True: 128k, False: 33.0k]
  ------------------
  324|   128k|      const W w = x[i];
  325|   128k|      x[i] = (w << bit_shift) | carry;
  326|   128k|      carry = carry_mask.if_set_return(w >> carry_shift);
  327|   128k|   }
  328|  33.0k|}
_ZN5Botan11bigint_shr1ITkNS_8WordTypeEmEEvPT_mm:
  331|  81.4k|inline constexpr void bigint_shr1(W x[], size_t x_size, size_t shift) {
  332|  81.4k|   const size_t word_shift = shift / WordInfo<W>::bits;
  333|  81.4k|   const size_t bit_shift = shift % WordInfo<W>::bits;
  334|       |
  335|  81.4k|   const size_t top = x_size >= word_shift ? (x_size - word_shift) : 0;
  ------------------
  |  Branch (335:23): [True: 81.4k, False: 0]
  ------------------
  336|       |
  337|  81.4k|   if(top > 0) {
  ------------------
  |  Branch (337:7): [True: 81.4k, False: 0]
  ------------------
  338|  81.4k|      unchecked_copy_memory(x, x + word_shift, top);
  339|  81.4k|   }
  340|  81.4k|   zeroize_buffer(x + top, std::min(word_shift, x_size));
  341|       |
  342|  81.4k|   const auto carry_mask = CT::Mask<W>::expand(bit_shift);
  343|  81.4k|   const W carry_shift = carry_mask.if_set_return(WordInfo<W>::bits - bit_shift);
  344|       |
  345|  81.4k|   W carry = 0;
  346|       |
  347|   730k|   for(size_t i = 0; i != top; ++i) {
  ------------------
  |  Branch (347:22): [True: 649k, False: 81.4k]
  ------------------
  348|   649k|      const W w = x[top - i - 1];
  349|   649k|      x[top - i - 1] = (w >> bit_shift) | carry;
  350|   649k|      carry = carry_mask.if_set_return(w << carry_shift);
  351|   649k|   }
  352|  81.4k|}
_ZN5Botan11bigint_shl2ITkNS_8WordTypeEmEEvPT_mPKS1_mm:
  355|  16.1k|inline constexpr void bigint_shl2(W y[], size_t y_size, const W x[], size_t x_size, size_t shift) {
  356|  16.1k|   const size_t word_shift = shift / WordInfo<W>::bits;
  357|  16.1k|   const size_t bit_shift = shift % WordInfo<W>::bits;
  358|       |
  359|  16.1k|   BOTAN_ASSERT_NOMSG(word_shift <= y_size);
  ------------------
  |  |   77|  16.1k|   do {                                                                     \
  |  |   78|  16.1k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   79|  16.1k|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (79:10): [True: 0, False: 16.1k]
  |  |  ------------------
  |  |   80|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   81|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   82|      0|      }                                                                     \
  |  |   83|  16.1k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (83:12): [Folded, False: 16.1k]
  |  |  ------------------
  ------------------
  360|  16.1k|   BOTAN_ASSERT_NOMSG(x_size < y_size - word_shift);
  ------------------
  |  |   77|  16.1k|   do {                                                                     \
  |  |   78|  16.1k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   79|  16.1k|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (79:10): [True: 0, False: 16.1k]
  |  |  ------------------
  |  |   80|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   81|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   82|      0|      }                                                                     \
  |  |   83|  16.1k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (83:12): [Folded, False: 16.1k]
  |  |  ------------------
  ------------------
  361|       |
  362|  16.1k|   unchecked_copy_memory(y + word_shift, x, x_size);
  363|  16.1k|   zeroize_buffer(y, word_shift);
  364|  16.1k|   zeroize_buffer(y + word_shift + x_size, y_size - word_shift - x_size);
  365|       |
  366|  16.1k|   const auto carry_mask = CT::Mask<W>::expand(bit_shift);
  367|  16.1k|   const W carry_shift = carry_mask.if_set_return(WordInfo<W>::bits - bit_shift);
  368|       |
  369|  16.1k|   W carry = 0;
  370|  71.6k|   for(size_t i = word_shift; i != x_size + word_shift + 1; ++i) {
  ------------------
  |  Branch (370:31): [True: 55.5k, False: 16.1k]
  ------------------
  371|  55.5k|      const W w = y[i];
  372|  55.5k|      y[i] = (w << bit_shift) | carry;
  373|  55.5k|      carry = carry_mask.if_set_return(w >> carry_shift);
  374|  55.5k|   }
  375|  16.1k|}
_ZN5Botan11bigint_shr2ITkNS_8WordTypeEmEEvPT_mPKS1_mm:
  378|    789|inline constexpr void bigint_shr2(W y[], size_t y_size, const W x[], size_t x_size, size_t shift) {
  379|    789|   const size_t word_shift = shift / WordInfo<W>::bits;
  380|    789|   const size_t bit_shift = shift % WordInfo<W>::bits;
  381|    789|   const size_t new_size = x_size < word_shift ? 0 : (x_size - word_shift);
  ------------------
  |  Branch (381:28): [True: 0, False: 789]
  ------------------
  382|       |
  383|    789|   BOTAN_ASSERT_NOMSG(new_size <= y_size);
  ------------------
  |  |   77|    789|   do {                                                                     \
  |  |   78|    789|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   79|    789|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (79:10): [True: 0, False: 789]
  |  |  ------------------
  |  |   80|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   81|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   82|      0|      }                                                                     \
  |  |   83|    789|   } while(0)
  |  |  ------------------
  |  |  |  Branch (83:12): [Folded, False: 789]
  |  |  ------------------
  ------------------
  384|       |
  385|    789|   if(new_size > 0) {
  ------------------
  |  Branch (385:7): [True: 789, False: 0]
  ------------------
  386|    789|      unchecked_copy_memory(y, x + word_shift, new_size);
  387|    789|   }
  388|    789|   zeroize_buffer(y + new_size, y_size - new_size);
  389|       |
  390|    789|   const auto carry_mask = CT::Mask<W>::expand(bit_shift);
  391|    789|   const W carry_shift = carry_mask.if_set_return(WordInfo<W>::bits - bit_shift);
  392|       |
  393|    789|   W carry = 0;
  394|  3.94k|   for(size_t i = new_size; i > 0; --i) {
  ------------------
  |  Branch (394:29): [True: 3.15k, False: 789]
  ------------------
  395|  3.15k|      W w = y[i - 1];
  396|  3.15k|      y[i - 1] = (w >> bit_shift) | carry;
  397|  3.15k|      carry = carry_mask.if_set_return(w << carry_shift);
  398|  3.15k|   }
  399|    789|}
_ZN5Botan15bigint_ct_is_eqITkNS_8WordTypeEmEENS_2CT4MaskIT_EEPKS3_mS6_m:
  519|    876|inline constexpr auto bigint_ct_is_eq(const W x[], size_t x_size, const W y[], size_t y_size) -> CT::Mask<W> {
  520|    876|   const size_t common_elems = std::min(x_size, y_size);
  521|       |
  522|    876|   W diff = 0;
  523|       |
  524|  10.8k|   for(size_t i = 0; i != common_elems; i++) {
  ------------------
  |  Branch (524:22): [True: 9.99k, False: 876]
  ------------------
  525|  9.99k|      diff |= (x[i] ^ y[i]);
  526|  9.99k|   }
  527|       |
  528|       |   // If any bits were set in high part of x/y, then they are not equal
  529|    876|   if(x_size < y_size) {
  ------------------
  |  Branch (529:7): [True: 0, False: 876]
  ------------------
  530|      0|      for(size_t i = x_size; i != y_size; i++) {
  ------------------
  |  Branch (530:30): [True: 0, False: 0]
  ------------------
  531|      0|         diff |= y[i];
  532|      0|      }
  533|    876|   } else if(y_size < x_size) {
  ------------------
  |  Branch (533:14): [True: 89, False: 787]
  ------------------
  534|    445|      for(size_t i = y_size; i != x_size; i++) {
  ------------------
  |  Branch (534:30): [True: 356, False: 89]
  ------------------
  535|    356|         diff |= x[i];
  536|    356|      }
  537|     89|   }
  538|       |
  539|    876|   return CT::Mask<W>::is_zero(diff);
  540|    876|}
_ZN5Botan15bigint_ct_is_ltITkNS_8WordTypeEmEENS_2CT4MaskIT_EEPKS3_mS6_mb:
  487|  70.4k|   -> CT::Mask<W> {
  488|  70.4k|   const size_t common_elems = std::min(x_size, y_size);
  489|       |
  490|  70.4k|   auto is_lt = CT::Mask<W>::expand(lt_or_equal);
  491|       |
  492|   546k|   for(size_t i = 0; i != common_elems; i++) {
  ------------------
  |  Branch (492:22): [True: 475k, False: 70.4k]
  ------------------
  493|   475k|      const auto eq = CT::Mask<W>::is_equal(x[i], y[i]);
  494|   475k|      const auto lt = CT::Mask<W>::is_lt(x[i], y[i]);
  495|   475k|      is_lt = eq.select_mask(is_lt, lt);
  496|   475k|   }
  497|       |
  498|  70.4k|   if(x_size < y_size) {
  ------------------
  |  Branch (498:7): [True: 2.22k, False: 68.1k]
  ------------------
  499|  2.22k|      W mask = 0;
  500|  11.8k|      for(size_t i = x_size; i != y_size; i++) {
  ------------------
  |  Branch (500:30): [True: 9.67k, False: 2.22k]
  ------------------
  501|  9.67k|         mask |= y[i];
  502|  9.67k|      }
  503|       |      // If any bits were set in high part of y, then is_lt should be forced true
  504|  2.22k|      is_lt |= CT::Mask<W>::expand(mask);
  505|  68.1k|   } else if(y_size < x_size) {
  ------------------
  |  Branch (505:14): [True: 22.7k, False: 45.4k]
  ------------------
  506|  22.7k|      W mask = 0;
  507|   162k|      for(size_t i = y_size; i != x_size; i++) {
  ------------------
  |  Branch (507:30): [True: 140k, False: 22.7k]
  ------------------
  508|   140k|         mask |= x[i];
  509|   140k|      }
  510|       |
  511|       |      // If any bits were set in high part of x, then is_lt should be false
  512|  22.7k|      is_lt &= CT::Mask<W>::is_zero(mask);
  513|  22.7k|   }
  514|       |
  515|  70.4k|   return is_lt;
  516|  70.4k|}
_ZN5Botan15bigint_cnd_swapITkNS_8WordTypeEmEEvT_PS1_S2_m:
   29|  3.87k|inline constexpr void bigint_cnd_swap(W cnd, W x[], W y[], size_t size) {
   30|  3.87k|   const auto mask = CT::Mask<W>::expand(cnd);
   31|       |
   32|  23.2k|   for(size_t i = 0; i != size; ++i) {
  ------------------
  |  Branch (32:22): [True: 19.3k, False: 3.87k]
  ------------------
   33|  19.3k|      const W a = x[i];
   34|  19.3k|      const W b = y[i];
   35|  19.3k|      x[i] = mask.select(b, a);
   36|  19.3k|      y[i] = mask.select(a, b);
   37|  19.3k|   }
   38|  3.87k|}
_ZN5Botan14bigint_sub_absITkNS_8WordTypeEmEENS_2CT4MaskIT_EEPS3_PKS3_S7_mS5_:
  279|  14.1k|inline constexpr auto bigint_sub_abs(W z[], const W x[], const W y[], size_t N, W ws[]) -> CT::Mask<W> {
  280|       |   // Subtract in both direction then conditional copy out the result
  281|       |
  282|  14.1k|   W* ws0 = ws;
  283|  14.1k|   W* ws1 = ws + N;
  284|       |
  285|  14.1k|   W borrow0 = 0;
  286|  14.1k|   W borrow1 = 0;
  287|       |
  288|  14.1k|   const size_t blocks = N - (N % 8);
  289|       |
  290|  14.1k|   for(size_t i = 0; i != blocks; i += 8) {
  ------------------
  |  Branch (290:22): [True: 0, False: 14.1k]
  ------------------
  291|      0|      borrow0 = word8_sub3(ws0 + i, x + i, y + i, borrow0);
  292|      0|      borrow1 = word8_sub3(ws1 + i, y + i, x + i, borrow1);
  293|      0|   }
  294|       |
  295|  84.7k|   for(size_t i = blocks; i != N; ++i) {
  ------------------
  |  Branch (295:27): [True: 70.6k, False: 14.1k]
  ------------------
  296|  70.6k|      ws0[i] = word_sub(x[i], y[i], &borrow0);
  297|  70.6k|      ws1[i] = word_sub(y[i], x[i], &borrow1);
  298|  70.6k|   }
  299|       |
  300|  14.1k|   return CT::conditional_copy_mem(borrow0, z, ws1, ws0, N);
  301|  14.1k|}
_ZN5Botan13monty_inverseITkNS_8WordTypeEmEET_S1_:
  703|    761|inline constexpr auto monty_inverse(W a) -> W {
  704|    761|   BOTAN_ARG_CHECK(a % 2 == 1, "Cannot compute Montgomery inverse of an even integer");
  ------------------
  |  |   35|    761|   do {                                                          \
  |  |   36|    761|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */              \
  |  |   37|    761|      if(!(expr)) {                                              \
  |  |  ------------------
  |  |  |  Branch (37:10): [True: 0, False: 761]
  |  |  ------------------
  |  |   38|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */     \
  |  |   39|      0|         Botan::throw_invalid_argument(msg, __func__, __FILE__); \
  |  |   40|      0|      }                                                          \
  |  |   41|    761|   } while(0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 761]
  |  |  ------------------
  ------------------
  705|       |
  706|       |   // Newton's Method, following https://lemire.me/blog/2017/09/18/computing-the-inverse-of-odd-integers/
  707|       |
  708|    761|   constexpr size_t iter = WordInfo<W>::bits == 64 ? 4 : 3;
  ------------------
  |  Branch (708:28): [True: 0, Folded]
  ------------------
  709|       |
  710|       |   // Initial guess provides 5 bits of accuracy
  711|    761|   W r = (3 * a) ^ 2;
  712|       |
  713|       |   // Each iteration doubles the accuracy
  714|  3.80k|   for(size_t i = 0; i != iter; ++i) {
  ------------------
  |  Branch (714:22): [True: 3.04k, False: 761]
  ------------------
  715|  3.04k|      r = r * (2 - r * a);
  716|  3.04k|   }
  717|       |
  718|       |   // Now invert in addition space
  719|    761|   r = (WordInfo<W>::max - r) + 1;
  720|       |
  721|    761|   return r;
  722|    761|}
_ZN5Botan22bigint_monty_maybe_subILm4ETkNS_8WordTypeEmEEvPT0_S1_PKS1_S4_:
  254|   484k|inline constexpr void bigint_monty_maybe_sub(W z[N], W x0, const W x[N], const W y[N]) {
  255|   484k|   W borrow = 0;
  256|       |
  257|  2.42M|   for(size_t i = 0; i != N; ++i) {
  ------------------
  |  Branch (257:22): [True: 1.93M, False: 484k]
  ------------------
  258|  1.93M|      z[i] = word_sub(x[i], y[i], &borrow);
  259|  1.93M|   }
  260|       |
  261|   484k|   borrow = (x0 - borrow) > x0;
  262|       |
  263|   484k|   CT::conditional_assign_mem(borrow, z, x, N);
  264|   484k|}

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

_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(); }

_ZNK5Botan7SHA_25613output_lengthEv:
   75|      5|      size_t output_length() const override { return output_bytes; }
_ZNK5Botan7SHA_25615hash_block_sizeEv:
   77|      1|      size_t hash_block_size() const override { return block_bytes; }
_ZN5Botan7SHA_2565clearEv:
   83|      2|      void clear() override { m_md.clear(); }

_ZNK5Botan9SIMD_4x323rawEv:
  942|  2.06k|      native_simd_type BOTAN_FN_ISA_SIMD_4X32 raw() const noexcept { return m_simd; }
_ZN5Botan9SIMD_4x32C2EDv2_x:
  944|  1.20k|      explicit BOTAN_FN_ISA_SIMD_4X32 SIMD_4x32(native_simd_type x) noexcept : m_simd(x) {}
_ZN5Botan9SIMD_4x327load_leEPKv:
  162|    220|      static SIMD_4x32 BOTAN_FN_ISA_SIMD_4X32 load_le(const void* in) noexcept {
  163|    220|#if defined(BOTAN_SIMD_USE_SSSE3)
  164|    220|         return SIMD_4x32(_mm_loadu_si128(reinterpret_cast<const __m128i*>(in)));
  165|       |#elif defined(BOTAN_SIMD_USE_ALTIVEC)
  166|       |         uint32_t R0 = Botan::load_le<uint32_t>(reinterpret_cast<const uint8_t*>(in), 0);
  167|       |         uint32_t R1 = Botan::load_le<uint32_t>(reinterpret_cast<const uint8_t*>(in), 1);
  168|       |         uint32_t R2 = Botan::load_le<uint32_t>(reinterpret_cast<const uint8_t*>(in), 2);
  169|       |         uint32_t R3 = Botan::load_le<uint32_t>(reinterpret_cast<const uint8_t*>(in), 3);
  170|       |         __vector unsigned int val = {R0, R1, R2, R3};
  171|       |         return SIMD_4x32(val);
  172|       |#elif defined(BOTAN_SIMD_USE_NEON)
  173|       |         SIMD_4x32 l(vld1q_u32(static_cast<const uint32_t*>(in)));
  174|       |         if constexpr(std::endian::native == std::endian::big) {
  175|       |            return l.bswap();
  176|       |         } else {
  177|       |            return l;
  178|       |         }
  179|       |#elif defined(BOTAN_SIMD_USE_LSX)
  180|       |         return SIMD_4x32(__lsx_vld(in, 0));
  181|       |#elif defined(BOTAN_SIMD_USE_SIMD128)
  182|       |         return SIMD_4x32(wasm_v128_load(in));
  183|       |#endif
  184|    220|      }
_ZNK5Botan9SIMD_4x328store_leEPh:
  234|     20|      void BOTAN_FN_ISA_SIMD_4X32 store_le(uint8_t out[]) const noexcept {
  235|     20|#if defined(BOTAN_SIMD_USE_SSSE3)
  236|       |
  237|     20|         _mm_storeu_si128(reinterpret_cast<__m128i*>(out), raw());
  238|       |
  239|       |#elif defined(BOTAN_SIMD_USE_ALTIVEC)
  240|       |
  241|       |         union {
  242|       |               __vector unsigned int V;
  243|       |               uint32_t R[4];
  244|       |         } vec{};
  245|       |
  246|       |         // NOLINTNEXTLINE(*-union-access)
  247|       |         vec.V = raw();
  248|       |         // NOLINTNEXTLINE(*-union-access)
  249|       |         Botan::store_le(out, vec.R[0], vec.R[1], vec.R[2], vec.R[3]);
  250|       |
  251|       |#elif defined(BOTAN_SIMD_USE_NEON)
  252|       |         if constexpr(std::endian::native == std::endian::little) {
  253|       |            vst1q_u8(out, vreinterpretq_u8_u32(m_simd));
  254|       |         } else {
  255|       |            vst1q_u8(out, vreinterpretq_u8_u32(bswap().m_simd));
  256|       |         }
  257|       |#elif defined(BOTAN_SIMD_USE_LSX)
  258|       |         __lsx_vst(raw(), out, 0);
  259|       |#elif defined(BOTAN_SIMD_USE_SIMD128)
  260|       |         wasm_v128_store(out, m_simd);
  261|       |#endif
  262|     20|      }
_ZN5Botan9SIMD_4x327load_beEPKv:
  189|     40|      static SIMD_4x32 BOTAN_FN_ISA_SIMD_4X32 load_be(const void* in) noexcept {
  190|     40|#if defined(BOTAN_SIMD_USE_SSSE3) || defined(BOTAN_SIMD_USE_LSX) || defined(BOTAN_SIMD_USE_SIMD128)
  191|     40|         return load_le(in).bswap();
  192|       |
  193|       |#elif defined(BOTAN_SIMD_USE_ALTIVEC)
  194|       |         uint32_t R0 = Botan::load_be<uint32_t>(reinterpret_cast<const uint8_t*>(in), 0);
  195|       |         uint32_t R1 = Botan::load_be<uint32_t>(reinterpret_cast<const uint8_t*>(in), 1);
  196|       |         uint32_t R2 = Botan::load_be<uint32_t>(reinterpret_cast<const uint8_t*>(in), 2);
  197|       |         uint32_t R3 = Botan::load_be<uint32_t>(reinterpret_cast<const uint8_t*>(in), 3);
  198|       |         __vector unsigned int val = {R0, R1, R2, R3};
  199|       |         return SIMD_4x32(val);
  200|       |
  201|       |#elif defined(BOTAN_SIMD_USE_NEON)
  202|       |         SIMD_4x32 l(vld1q_u32(static_cast<const uint32_t*>(in)));
  203|       |         if constexpr(std::endian::native == std::endian::little) {
  204|       |            return l.bswap();
  205|       |         } else {
  206|       |            return l;
  207|       |         }
  208|       |#endif
  209|     40|      }
_ZNK5Botan9SIMD_4x328store_leEPj:
  219|     20|      void BOTAN_FN_ISA_SIMD_4X32 store_le(uint32_t out[4]) const noexcept {
  220|     20|         this->store_le(reinterpret_cast<uint8_t*>(out));
  221|     20|      }
_ZNK5Botan9SIMD_4x32plERKS0_:
  385|    160|      SIMD_4x32 BOTAN_FN_ISA_SIMD_4X32 operator+(const SIMD_4x32& other) const noexcept {
  386|    160|         SIMD_4x32 retval(*this);
  387|    160|         retval += other;
  388|    160|         return retval;
  389|    160|      }
_ZN5Botan9SIMD_4x32pLERKS0_:
  427|    300|      void BOTAN_FN_ISA_SIMD_4X32 operator+=(const SIMD_4x32& other) noexcept {
  428|    300|#if defined(BOTAN_SIMD_USE_SSSE3)
  429|    300|         m_simd = _mm_add_epi32(m_simd, other.m_simd);
  430|       |#elif defined(BOTAN_SIMD_USE_ALTIVEC)
  431|       |         m_simd = vec_add(m_simd, other.m_simd);
  432|       |#elif defined(BOTAN_SIMD_USE_NEON)
  433|       |         m_simd = vaddq_u32(m_simd, other.m_simd);
  434|       |#elif defined(BOTAN_SIMD_USE_LSX)
  435|       |         m_simd = __lsx_vadd_w(m_simd, other.m_simd);
  436|       |#elif defined(BOTAN_SIMD_USE_SIMD128)
  437|       |         m_simd = wasm_i32x4_add(m_simd, other.m_simd);
  438|       |#endif
  439|    300|      }
_ZNK5Botan9SIMD_4x325bswapEv:
  576|     40|      BOTAN_FN_ISA_SIMD_4X32 SIMD_4x32 bswap() const noexcept {
  577|     40|#if defined(BOTAN_SIMD_USE_SSSE3)
  578|     40|         const auto idx = _mm_set_epi8(12, 13, 14, 15, 8, 9, 10, 11, 4, 5, 6, 7, 0, 1, 2, 3);
  579|       |
  580|     40|         return SIMD_4x32(_mm_shuffle_epi8(raw(), idx));
  581|       |#elif defined(BOTAN_SIMD_USE_ALTIVEC)
  582|       |   #ifdef BOTAN_SIMD_USE_VSX
  583|       |         return SIMD_4x32(vec_revb(m_simd));
  584|       |   #else
  585|       |         const __vector unsigned char rev[1] = {
  586|       |            {3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12},
  587|       |         };
  588|       |
  589|       |         return SIMD_4x32(vec_perm(m_simd, m_simd, rev[0]));
  590|       |   #endif
  591|       |
  592|       |#elif defined(BOTAN_SIMD_USE_NEON)
  593|       |         return SIMD_4x32(vreinterpretq_u32_u8(vrev32q_u8(vreinterpretq_u8_u32(m_simd))));
  594|       |#elif defined(BOTAN_SIMD_USE_LSX)
  595|       |         return SIMD_4x32(__lsx_vshuf4i_b(m_simd, 0b00011011));
  596|       |#elif defined(BOTAN_SIMD_USE_SIMD128)
  597|       |         return SIMD_4x32(wasm_i8x16_shuffle(m_simd, m_simd, 3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12));
  598|       |#endif
  599|     40|      }
_ZN5Botan9SIMD_4x327alignr4ERKS0_S2_:
  869|    120|      static inline SIMD_4x32 BOTAN_FN_ISA_SIMD_4X32 alignr4(const SIMD_4x32& a, const SIMD_4x32& b) {
  870|    120|#if defined(BOTAN_SIMD_USE_SSSE3)
  871|    120|         return SIMD_4x32(_mm_alignr_epi8(a.raw(), b.raw(), 4));
  872|       |#elif defined(BOTAN_SIMD_USE_NEON)
  873|       |         return SIMD_4x32(vextq_u32(b.raw(), a.raw(), 1));
  874|       |#elif defined(BOTAN_SIMD_USE_ALTIVEC)
  875|       |         const __vector unsigned char mask = {4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19};
  876|       |         return SIMD_4x32(vec_perm(b.raw(), a.raw(), mask));
  877|       |#elif defined(BOTAN_SIMD_USE_LSX)
  878|       |         const auto mask = SIMD_4x32(0x07060504, 0x0B0A0908, 0x0F0E0D0C, 0x13121110);
  879|       |         return SIMD_4x32(__lsx_vshuf_b(a.raw(), b.raw(), mask.raw()));
  880|       |#elif defined(BOTAN_SIMD_USE_SIMD128)
  881|       |         return SIMD_4x32(
  882|       |            wasm_i8x16_shuffle(b.raw(), a.raw(), 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19));
  883|       |#endif
  884|    120|      }
_ZN5Botan9SIMD_4x327alignr8ERKS0_S2_:
  886|     20|      static inline SIMD_4x32 BOTAN_FN_ISA_SIMD_4X32 alignr8(const SIMD_4x32& a, const SIMD_4x32& b) {
  887|     20|#if defined(BOTAN_SIMD_USE_SSSE3)
  888|     20|         return SIMD_4x32(_mm_alignr_epi8(a.raw(), b.raw(), 8));
  889|       |#elif defined(BOTAN_SIMD_USE_NEON)
  890|       |         return SIMD_4x32(vextq_u32(b.raw(), a.raw(), 2));
  891|       |#elif defined(BOTAN_SIMD_USE_ALTIVEC)
  892|       |         const __vector unsigned char mask = {8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23};
  893|       |         return SIMD_4x32(vec_perm(b.raw(), a.raw(), mask));
  894|       |#elif defined(BOTAN_SIMD_USE_LSX)
  895|       |         return SIMD_4x32(__lsx_vshuf4i_d(a.raw(), b.raw(), 0b0011));
  896|       |#elif defined(BOTAN_SIMD_USE_SIMD128)
  897|       |         return SIMD_4x32(
  898|       |            wasm_i8x16_shuffle(b.raw(), a.raw(), 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23));
  899|       |#endif
  900|     20|      }
_ZNK5Botan9SIMD_4x3217shift_elems_rightILm2EEES0_vQleT_Li3E:
  641|    160|      {
  642|    160|#if defined(BOTAN_SIMD_USE_SSSE3)
  643|    160|         return SIMD_4x32(_mm_srli_si128(raw(), 4 * I));
  644|       |#elif defined(BOTAN_SIMD_USE_NEON)
  645|       |         return SIMD_4x32(vextq_u32(raw(), vdupq_n_u32(0), I));
  646|       |#elif defined(BOTAN_SIMD_USE_ALTIVEC)
  647|       |         const __vector unsigned int zero = vec_splat_u32(0);
  648|       |
  649|       |         const __vector unsigned char shuf[3] = {
  650|       |            {4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19},
  651|       |            {8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23},
  652|       |            {12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27},
  653|       |         };
  654|       |
  655|       |         return SIMD_4x32(vec_perm(raw(), zero, shuf[I - 1]));
  656|       |#elif defined(BOTAN_SIMD_USE_LSX)
  657|       |         return SIMD_4x32(__lsx_vbsrl_v(raw(), 4 * I));
  658|       |#elif defined(BOTAN_SIMD_USE_SIMD128)
  659|       |         if constexpr(I == 0) {
  660|       |            return SIMD_4x32(m_simd);
  661|       |         }
  662|       |
  663|       |         const auto zero = wasm_u32x4_const_splat(0);
  664|       |         if constexpr(I == 1) {
  665|       |            return SIMD_4x32(
  666|       |               wasm_i8x16_shuffle(m_simd, zero, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 16, 16, 16));
  667|       |         }
  668|       |         if constexpr(I == 2) {
  669|       |            return SIMD_4x32(
  670|       |               wasm_i8x16_shuffle(m_simd, zero, 8, 9, 10, 11, 12, 13, 14, 15, 16, 16, 16, 16, 16, 16, 16, 16));
  671|       |         }
  672|       |
  673|       |         return SIMD_4x32(
  674|       |            wasm_i8x16_shuffle(m_simd, zero, 12, 13, 14, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16));
  675|       |#endif
  676|    160|      }

_ZN5Botan9SIMD_8x32C2Ejjjjjjjj:
   46|     10|                         uint32_t B7) noexcept {
   47|       |         // NOLINTNEXTLINE(*-prefer-member-initializer)
   48|     10|         m_avx2 = _mm256_set_epi32(B7, B6, B5, B4, B3, B2, B1, B0);
   49|     10|      }
_ZN5Botan9SIMD_8x325splatEj:
   58|    160|      static SIMD_8x32 splat(uint32_t B) noexcept { return SIMD_8x32(_mm256_set1_epi32(B)); }
_ZNK5Botan9SIMD_8x328store_leEPh:
   84|     80|      void store_le(uint8_t out[]) const noexcept { _mm256_storeu_si256(reinterpret_cast<__m256i*>(out), m_avx2); }
_ZNK5Botan9SIMD_8x32plERKS0_:
  164|     20|      SIMD_8x32 operator+(const SIMD_8x32& other) const noexcept {
  165|     20|         SIMD_8x32 retval(*this);
  166|     20|         retval += other;
  167|     20|         return retval;
  168|     20|      }
_ZN5Botan9SIMD_8x32pLERKS0_:
  199|  1.70k|      void operator+=(const SIMD_8x32& other) { m_avx2 = _mm256_add_epi32(m_avx2, other.m_avx2); }
_ZN5Botan9SIMD_8x32eOERKS0_:
  205|  1.60k|      void operator^=(const SIMD_8x32& other) { m_avx2 = _mm256_xor_si256(m_avx2, other.m_avx2); }
_ZN5Botan9SIMD_8x329transposeERS0_S1_S1_S1_:
  264|     20|      static void transpose(SIMD_8x32& B0, SIMD_8x32& B1, SIMD_8x32& B2, SIMD_8x32& B3) noexcept {
  265|     20|         const __m256i T0 = _mm256_unpacklo_epi32(B0.m_avx2, B1.m_avx2);
  266|     20|         const __m256i T1 = _mm256_unpacklo_epi32(B2.m_avx2, B3.m_avx2);
  267|     20|         const __m256i T2 = _mm256_unpackhi_epi32(B0.m_avx2, B1.m_avx2);
  268|     20|         const __m256i T3 = _mm256_unpackhi_epi32(B2.m_avx2, B3.m_avx2);
  269|       |
  270|     20|         B0.m_avx2 = _mm256_unpacklo_epi64(T0, T1);
  271|     20|         B1.m_avx2 = _mm256_unpackhi_epi64(T0, T1);
  272|     20|         B2.m_avx2 = _mm256_unpacklo_epi64(T2, T3);
  273|     20|         B3.m_avx2 = _mm256_unpackhi_epi64(T2, T3);
  274|     20|      }
_ZN5Botan9SIMD_8x329transposeERS0_S1_S1_S1_S1_S1_S1_S1_:
  302|     10|                            SIMD_8x32& B7) noexcept {
  303|     10|         transpose(B0, B1, B2, B3);
  304|     10|         transpose(B4, B5, B6, B7);
  305|       |
  306|     10|         swap_tops(B0, B4);
  307|     10|         swap_tops(B1, B5);
  308|     10|         swap_tops(B2, B6);
  309|     10|         swap_tops(B3, B7);
  310|     10|      }
_ZN5Botan9SIMD_8x3215reset_registersEv:
  335|      5|      static void reset_registers() noexcept { _mm256_zeroupper(); }
_ZN5Botan9SIMD_8x3214zero_registersEv:
  338|      5|      static void zero_registers() noexcept { _mm256_zeroall(); }
_ZNK5Botan9SIMD_8x323rawEv:
  340|    160|      __m256i BOTAN_FN_ISA_AVX2 raw() const noexcept { return m_avx2; }
_ZN5Botan9SIMD_8x32C2EDv4_x:
  343|  1.84k|      explicit SIMD_8x32(__m256i x) noexcept : m_avx2(x) {}
_ZN5Botan9SIMD_8x329swap_topsERS0_S1_:
  347|     40|      static void swap_tops(SIMD_8x32& A, SIMD_8x32& B) {
  348|     40|         auto T0 = SIMD_8x32(_mm256_permute2x128_si256(A.raw(), B.raw(), 0 + (2 << 4)));
  349|       |         auto T1 = SIMD_8x32(_mm256_permute2x128_si256(A.raw(), B.raw(), 1 + (3 << 4)));
  350|     40|         A = T0;
  351|     40|         B = T1;
  352|     40|      }
_ZNK5Botan9SIMD_8x324rotlILm7EEES0_vQaagtT_Li0EltT_Li32E:
  118|    400|      {
  119|       |#if defined(__AVX512VL__)
  120|       |         return SIMD_8x32(_mm256_rol_epi32(m_avx2, ROT));
  121|       |#else
  122|       |         if constexpr(ROT == 8) {
  123|       |            const __m256i shuf_rotl_8 =
  124|       |               _mm256_set_epi64x(0x0e0d0c0f'0a09080b, 0x06050407'02010003, 0x0e0d0c0f'0a09080b, 0x06050407'02010003);
  125|       |
  126|       |            return SIMD_8x32(_mm256_shuffle_epi8(m_avx2, shuf_rotl_8));
  127|       |         } else if constexpr(ROT == 16) {
  128|       |            const __m256i shuf_rotl_16 =
  129|       |               _mm256_set_epi64x(0x0d0c0f0e'09080b0a, 0x05040706'01000302, 0x0d0c0f0e'09080b0a, 0x05040706'01000302);
  130|       |
  131|       |            return SIMD_8x32(_mm256_shuffle_epi8(m_avx2, shuf_rotl_16));
  132|       |         } else if constexpr(ROT == 24) {
  133|       |            const __m256i shuf_rotl_24 =
  134|       |               _mm256_set_epi64x(0x0c0f0e0d'080b0a09, 0x04070605'00030201, 0x0c0f0e0d'080b0a09, 0x04070605'00030201);
  135|       |
  136|       |            return SIMD_8x32(_mm256_shuffle_epi8(m_avx2, shuf_rotl_24));
  137|    400|         } else {
  138|    400|            return SIMD_8x32(_mm256_xor_si256(_mm256_slli_epi32(m_avx2, static_cast<int>(ROT)),
  139|    400|                                              _mm256_srli_epi32(m_avx2, static_cast<int>(32 - ROT))));
  140|    400|         }
  141|    400|#endif
  142|    400|      }
_ZNK5Botan9SIMD_8x324rotlILm16EEES0_vQaagtT_Li0EltT_Li32E:
  118|    400|      {
  119|       |#if defined(__AVX512VL__)
  120|       |         return SIMD_8x32(_mm256_rol_epi32(m_avx2, ROT));
  121|       |#else
  122|       |         if constexpr(ROT == 8) {
  123|       |            const __m256i shuf_rotl_8 =
  124|       |               _mm256_set_epi64x(0x0e0d0c0f'0a09080b, 0x06050407'02010003, 0x0e0d0c0f'0a09080b, 0x06050407'02010003);
  125|       |
  126|       |            return SIMD_8x32(_mm256_shuffle_epi8(m_avx2, shuf_rotl_8));
  127|    400|         } else if constexpr(ROT == 16) {
  128|    400|            const __m256i shuf_rotl_16 =
  129|    400|               _mm256_set_epi64x(0x0d0c0f0e'09080b0a, 0x05040706'01000302, 0x0d0c0f0e'09080b0a, 0x05040706'01000302);
  130|       |
  131|    400|            return SIMD_8x32(_mm256_shuffle_epi8(m_avx2, shuf_rotl_16));
  132|       |         } else if constexpr(ROT == 24) {
  133|       |            const __m256i shuf_rotl_24 =
  134|       |               _mm256_set_epi64x(0x0c0f0e0d'080b0a09, 0x04070605'00030201, 0x0c0f0e0d'080b0a09, 0x04070605'00030201);
  135|       |
  136|       |            return SIMD_8x32(_mm256_shuffle_epi8(m_avx2, shuf_rotl_24));
  137|       |         } else {
  138|       |            return SIMD_8x32(_mm256_xor_si256(_mm256_slli_epi32(m_avx2, static_cast<int>(ROT)),
  139|       |                                              _mm256_srli_epi32(m_avx2, static_cast<int>(32 - ROT))));
  140|       |         }
  141|    400|#endif
  142|    400|      }
_ZNK5Botan9SIMD_8x324rotlILm12EEES0_vQaagtT_Li0EltT_Li32E:
  118|    400|      {
  119|       |#if defined(__AVX512VL__)
  120|       |         return SIMD_8x32(_mm256_rol_epi32(m_avx2, ROT));
  121|       |#else
  122|       |         if constexpr(ROT == 8) {
  123|       |            const __m256i shuf_rotl_8 =
  124|       |               _mm256_set_epi64x(0x0e0d0c0f'0a09080b, 0x06050407'02010003, 0x0e0d0c0f'0a09080b, 0x06050407'02010003);
  125|       |
  126|       |            return SIMD_8x32(_mm256_shuffle_epi8(m_avx2, shuf_rotl_8));
  127|       |         } else if constexpr(ROT == 16) {
  128|       |            const __m256i shuf_rotl_16 =
  129|       |               _mm256_set_epi64x(0x0d0c0f0e'09080b0a, 0x05040706'01000302, 0x0d0c0f0e'09080b0a, 0x05040706'01000302);
  130|       |
  131|       |            return SIMD_8x32(_mm256_shuffle_epi8(m_avx2, shuf_rotl_16));
  132|       |         } else if constexpr(ROT == 24) {
  133|       |            const __m256i shuf_rotl_24 =
  134|       |               _mm256_set_epi64x(0x0c0f0e0d'080b0a09, 0x04070605'00030201, 0x0c0f0e0d'080b0a09, 0x04070605'00030201);
  135|       |
  136|       |            return SIMD_8x32(_mm256_shuffle_epi8(m_avx2, shuf_rotl_24));
  137|    400|         } else {
  138|    400|            return SIMD_8x32(_mm256_xor_si256(_mm256_slli_epi32(m_avx2, static_cast<int>(ROT)),
  139|    400|                                              _mm256_srli_epi32(m_avx2, static_cast<int>(32 - ROT))));
  140|    400|         }
  141|    400|#endif
  142|    400|      }
_ZNK5Botan9SIMD_8x324rotlILm8EEES0_vQaagtT_Li0EltT_Li32E:
  118|    400|      {
  119|       |#if defined(__AVX512VL__)
  120|       |         return SIMD_8x32(_mm256_rol_epi32(m_avx2, ROT));
  121|       |#else
  122|    400|         if constexpr(ROT == 8) {
  123|    400|            const __m256i shuf_rotl_8 =
  124|    400|               _mm256_set_epi64x(0x0e0d0c0f'0a09080b, 0x06050407'02010003, 0x0e0d0c0f'0a09080b, 0x06050407'02010003);
  125|       |
  126|    400|            return SIMD_8x32(_mm256_shuffle_epi8(m_avx2, shuf_rotl_8));
  127|       |         } else if constexpr(ROT == 16) {
  128|       |            const __m256i shuf_rotl_16 =
  129|       |               _mm256_set_epi64x(0x0d0c0f0e'09080b0a, 0x05040706'01000302, 0x0d0c0f0e'09080b0a, 0x05040706'01000302);
  130|       |
  131|       |            return SIMD_8x32(_mm256_shuffle_epi8(m_avx2, shuf_rotl_16));
  132|       |         } else if constexpr(ROT == 24) {
  133|       |            const __m256i shuf_rotl_24 =
  134|       |               _mm256_set_epi64x(0x0c0f0e0d'080b0a09, 0x04070605'00030201, 0x0c0f0e0d'080b0a09, 0x04070605'00030201);
  135|       |
  136|       |            return SIMD_8x32(_mm256_shuffle_epi8(m_avx2, shuf_rotl_24));
  137|       |         } else {
  138|       |            return SIMD_8x32(_mm256_xor_si256(_mm256_slli_epi32(m_avx2, static_cast<int>(ROT)),
  139|       |                                              _mm256_srli_epi32(m_avx2, static_cast<int>(32 - ROT))));
  140|       |         }
  141|    400|#endif
  142|    400|      }

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

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

_ZN5Botan6BigIntD2Ev:
  185|   219k|      ~BigInt() { _const_time_unpoison(); }
_ZN5BotangtERKNS_6BigIntEm:
 1206|  4.69k|inline bool operator>(const BigInt& a, word b) {
 1207|  4.69k|   return (a.cmp_word(b) > 0);
 1208|  4.69k|}
_ZN5BotanneERKNS_6BigIntES2_:
 1166|    747|inline bool operator!=(const BigInt& a, const BigInt& b) {
 1167|    747|   return !a.is_equal(b);
 1168|    747|}
_ZN5Botan6BigInt4zeroEv:
   50|  15.5k|      static BigInt zero() { return BigInt(); }
_ZN5Botan6BigInt3oneEv:
   55|      2|      static BigInt one() { return BigInt::from_u64(1); }
_ZN5Botan6BigIntC2EOS0_:
  183|  45.8k|      BigInt(BigInt&& other) noexcept { this->swap(other); }
_ZN5Botan6BigIntaSEOS0_:
  190|   144k|      BigInt& operator=(BigInt&& other) noexcept {
  191|   144k|         if(this != &other) {
  ------------------
  |  Branch (191:13): [True: 144k, False: 0]
  ------------------
  192|   144k|            this->swap(other);
  193|   144k|         }
  194|       |
  195|   144k|         return (*this);
  196|   144k|      }
_ZN5Botan6BigInt4swapERS0_:
  207|   190k|      void swap(BigInt& other) noexcept {
  208|   190k|         m_data.swap(other.m_data);
  209|   190k|         std::swap(m_signedness, other.m_signedness);
  210|   190k|      }
_ZN5Botan6BigInt8swap_regERNSt3__16vectorImNS_16secure_allocatorImEEEE:
  214|  1.82k|      BOTAN_DEPRECATED("Deprecated no replacement") void swap_reg(secure_vector<word>& reg) {
  215|  1.82k|         m_data.swap(reg);
  216|       |         // sign left unchanged
  217|  1.82k|      }
_ZN5Botan6BigIntpLEm:
  229|    101|      BigInt& operator+=(word y) { return add(&y, 1, Positive); }
_ZN5Botan6BigIntmIEm:
  241|    748|      BigInt& operator-=(word y) { return sub(&y, 1, Positive); }
_ZN5Botan6BigInt3subEPKmmNS0_4SignE:
  332|  19.0k|      BigInt& sub(const word y[], size_t y_words, Sign sign) {
  333|  19.0k|         return add(y, y_words, sign == Positive ? Negative : Positive);
  ------------------
  |  Branch (333:33): [True: 19.0k, False: 0]
  ------------------
  334|  19.0k|      }
_ZN5Botan6BigInt5clearEv:
  415|  1.42k|      void clear() {
  416|  1.42k|         m_data.set_to_zero();
  417|  1.42k|         m_signedness = Positive;
  418|  1.42k|      }
_ZNK5Botan6BigInt7is_evenEv:
  455|    835|      bool is_even() const { return !get_bit(0); }
_ZNK5Botan6BigInt6is_oddEv:
  461|  49.1k|      bool is_odd() const { return get_bit(0); }
_ZNK5Botan6BigInt6signumEv:
  467|   623k|      int signum() const {
  468|   623k|         if(sig_words() == 0) {
  ------------------
  |  Branch (468:13): [True: 398, False: 623k]
  ------------------
  469|    398|            return 0;
  470|    398|         }
  471|   623k|         return (sign() == Negative) ? -1 : 1;
  ------------------
  |  Branch (471:17): [True: 642, False: 622k]
  ------------------
  472|   623k|      }
_ZNK5Botan6BigInt7is_zeroEv:
  484|  75.8k|      bool is_zero() const { return sig_words() == 0; }
_ZN5Botan6BigInt7set_bitEm:
  490|  2.67k|      void set_bit(size_t n) { conditionally_set_bit(n, true); }
_ZN5Botan6BigInt21conditionally_set_bitEmb:
  500|  6.54k|      void conditionally_set_bit(size_t n, bool set_it) {
  501|  6.54k|         const size_t which = n / (sizeof(word) * 8);
  502|  6.54k|         const word mask = static_cast<word>(set_it) << (n % (sizeof(word) * 8));
  503|  6.54k|         m_data.set_word_at(which, word_at(which) | mask);
  504|  6.54k|      }
_ZNK5Botan6BigInt7get_bitEm:
  523|   115k|      bool get_bit(size_t n) const { return ((word_at(n / (sizeof(word) * 8)) >> (n % (sizeof(word) * 8))) & 1) == 1; }
_ZNK5Botan6BigInt7word_atEm:
  574|   847k|      word word_at(size_t n) const { return m_data.get_word_at(n); }
_ZN5Botan6BigInt11set_word_atEmm:
  576|  39.7k|      BOTAN_DEPRECATED("Deprecated no replacement") void set_word_at(size_t i, word w) { m_data.set_word_at(i, w); }
_ZNK5Botan6BigInt4signEv:
  604|   801k|      Sign sign() const { return (m_signedness); }
_ZNK5Botan6BigInt12reverse_signEv:
  609|    674|      Sign reverse_sign() const {
  610|    674|         if(sign() == Positive) {
  ------------------
  |  Branch (610:13): [True: 672, False: 2]
  ------------------
  611|    672|            return Negative;
  612|    672|         }
  613|      2|         return Positive;
  614|    674|      }
_ZN5Botan6BigInt9flip_signEv:
  619|    629|      BOTAN_DEPRECATED("Deprecated no replacement") void flip_sign() { set_sign(reverse_sign()); }
_ZN5Botan6BigInt8set_signENS0_4SignE:
  625|  82.2k|      void set_sign(Sign sign) {
  626|  82.2k|         if(sign == Negative && is_zero()) {
  ------------------
  |  Branch (626:13): [True: 638, False: 81.6k]
  |  Branch (626:33): [True: 2, False: 636]
  ------------------
  627|      2|            sign = Positive;
  628|      2|         }
  629|       |
  630|  82.2k|         m_signedness = sign;
  631|  82.2k|      }
_ZNK5Botan6BigInt4sizeEv:
  642|   654k|      size_t size() const { return m_data.size(); }
_ZNK5Botan6BigInt9sig_wordsEv:
  648|  1.19M|      size_t sig_words() const { return m_data.sig_words(); }
_ZN5Botan6BigInt12mutable_dataEv:
  673|  89.2k|      BOTAN_DEPRECATED("Deprecated no replacement") word* mutable_data() { return m_data.mutable_data(); }
_ZNK5Botan6BigInt4dataEv:
  679|  1.66k|      BOTAN_DEPRECATED("Deprecated no replacement") const word* data() const { return m_data.const_data(); }
_ZNK5Botan6BigInt7grow_toEm:
  699|  78.0k|      BOTAN_DEPRECATED("Deprecated no replacement") void grow_to(size_t n) const { m_data.grow_to(n); }
_ZN5Botan6BigInt10power_of_2Em:
  856|  1.90k|      static BigInt power_of_2(size_t n) {
  857|  1.90k|         BigInt b;
  858|  1.90k|         b.set_bit(n);
  859|  1.90k|         return b;
  860|  1.90k|      }
_ZNK5Botan6BigInt8_as_spanEv:
  962|  10.2k|      std::span<const word> _as_span() const { return m_data.const_span(); }
_ZNK5Botan6BigInt5_dataEv:
  972|   893k|      const word* _data() const { return m_data.const_data(); }
_ZN5Botan6BigInt11_from_wordsERNSt3__16vectorImNS_16secure_allocatorImEEEE:
  991|  16.7k|      static BigInt _from_words(secure_vector<word>& words) {
  992|  16.7k|         BigInt bn;
  993|  16.7k|         bn.m_data.swap(words);
  994|  16.7k|         return bn;
  995|  16.7k|      }
_ZN5Botan6BigInt4Data12mutable_dataEv:
 1022|   199k|            word* mutable_data() {
 1023|   199k|               invalidate_sig_words();
 1024|   199k|               return m_reg.data();
 1025|   199k|            }
_ZNK5Botan6BigInt4Data10const_dataEv:
 1027|  1.11M|            const word* const_data() const { return m_reg.data(); }
_ZNK5Botan6BigInt4Data10const_spanEv:
 1029|  10.2k|            std::span<const word> const_span() const { return std::span{m_reg}; }
_ZNK5Botan6BigInt4Data11get_word_atEm:
 1038|   847k|            word get_word_at(size_t n) const {
 1039|   847k|               if(n < m_reg.size()) {
  ------------------
  |  Branch (1039:19): [True: 844k, False: 2.65k]
  ------------------
 1040|   844k|                  return m_reg[n];
 1041|   844k|               }
 1042|  2.65k|               return 0;
 1043|   847k|            }
_ZN5Botan6BigInt4Data11set_word_atEmm:
 1045|  46.8k|            void set_word_at(size_t i, word w) {
 1046|  46.8k|               invalidate_sig_words();
 1047|  46.8k|               if(i >= m_reg.size()) {
  ------------------
  |  Branch (1047:19): [True: 34.8k, False: 12.0k]
  ------------------
 1048|  34.8k|                  if(w == 0) {
  ------------------
  |  Branch (1048:22): [True: 1, False: 34.8k]
  ------------------
 1049|      1|                     return;
 1050|      1|                  }
 1051|  34.8k|                  grow_to(i + 1);
 1052|  34.8k|               }
 1053|  46.8k|               m_reg[i] = w;
 1054|  46.8k|            }
_ZNK5Botan6BigInt4Data7grow_toEm:
 1065|   142k|            void grow_to(size_t n) const {
 1066|   142k|               if(n > size()) {
  ------------------
  |  Branch (1066:19): [True: 91.1k, False: 50.8k]
  ------------------
 1067|  91.1k|                  if(n <= m_reg.capacity()) {
  ------------------
  |  Branch (1067:22): [True: 508, False: 90.6k]
  ------------------
 1068|    508|                     m_reg.resize(n);
 1069|  90.6k|                  } else {
 1070|  90.6k|                     m_reg.resize(n + (8 - (n % 8)));
 1071|  90.6k|                  }
 1072|  91.1k|               }
 1073|   142k|            }
_ZNK5Botan6BigInt4Data4sizeEv:
 1075|  1.09M|            size_t size() const { return m_reg.size(); }
_ZN5Botan6BigInt4Data4swapERS1_:
 1090|   190k|            void swap(Data& other) noexcept {
 1091|   190k|               m_reg.swap(other.m_reg);
 1092|   190k|               std::swap(m_sig_words, other.m_sig_words);
 1093|   190k|            }
_ZN5Botan6BigInt4Data4swapERNSt3__16vectorImNS_16secure_allocatorImEEEE:
 1095|  19.9k|            void swap(secure_vector<word>& reg) noexcept {
 1096|  19.9k|               m_reg.swap(reg);
 1097|  19.9k|               invalidate_sig_words();
 1098|  19.9k|            }
_ZNK5Botan6BigInt4Data20invalidate_sig_wordsEv:
 1100|   266k|            void invalidate_sig_words() const noexcept { m_sig_words = sig_words_npos; }
_ZNK5Botan6BigInt4Data9sig_wordsEv:
 1102|  1.19M|            size_t sig_words() const {
 1103|  1.19M|               if(m_sig_words == sig_words_npos) {
  ------------------
  |  Branch (1103:19): [True: 217k, False: 976k]
  ------------------
 1104|   217k|                  m_sig_words = calc_sig_words();
 1105|   217k|               }
 1106|  1.19M|               return m_sig_words;
 1107|  1.19M|            }
_ZN5BotanplERKNS_6BigIntES2_:
 1125|    808|inline BigInt operator+(const BigInt& x, const BigInt& y) {
 1126|    808|   return BigInt::add2(x, y._data(), y.sig_words(), y.sign());
 1127|    808|}
_ZN5BotanplERKNS_6BigIntEm:
 1129|    657|inline BigInt operator+(const BigInt& x, word y) {
 1130|    657|   return BigInt::add2(x, &y, 1, BigInt::Positive);
 1131|    657|}
_ZN5BotanmiERKNS_6BigIntES2_:
 1137|     45|inline BigInt operator-(const BigInt& x, const BigInt& y) {
 1138|     45|   return BigInt::add2(x, y._data(), y.sig_words(), y.reverse_sign());
 1139|     45|}
_ZN5BotanmiERKNS_6BigIntEm:
 1141|    789|inline BigInt operator-(const BigInt& x, word y) {
 1142|    789|   return BigInt::add2(x, &y, 1, BigInt::Negative);
 1143|    789|}
_ZN5BotanmlEmRKNS_6BigIntE:
 1148|  17.5k|inline BigInt operator*(word x, const BigInt& y) {
 1149|  17.5k|   return y * x;
 1150|  17.5k|}
_ZN5BotaneqERKNS_6BigIntES2_:
 1162|    129|inline bool operator==(const BigInt& a, const BigInt& b) {
 1163|    129|   return a.is_equal(b);
 1164|    129|}
_ZN5BotanleERKNS_6BigIntES2_:
 1170|     86|inline bool operator<=(const BigInt& a, const BigInt& b) {
 1171|     86|   return (a.cmp(b) <= 0);
 1172|     86|}
_ZN5BotangeERKNS_6BigIntES2_:
 1174|  2.73k|inline bool operator>=(const BigInt& a, const BigInt& b) {
 1175|  2.73k|   return (a.cmp(b) >= 0);
 1176|  2.73k|}
_ZN5BotanltERKNS_6BigIntES2_:
 1178|  53.5k|inline bool operator<(const BigInt& a, const BigInt& b) {
 1179|  53.5k|   return a.is_less_than(b);
 1180|  53.5k|}
_ZN5BotaneqERKNS_6BigIntEm:
 1186|  98.9k|inline bool operator==(const BigInt& a, word b) {
 1187|  98.9k|   return (a.cmp_word(b) == 0);
 1188|  98.9k|}
_ZN5BotanneERKNS_6BigIntEm:
 1190|  3.44k|inline bool operator!=(const BigInt& a, word b) {
 1191|  3.44k|   return (a.cmp_word(b) != 0);
 1192|  3.44k|}
_ZN5BotanleERKNS_6BigIntEm:
 1194|  1.37k|inline bool operator<=(const BigInt& a, word b) {
 1195|  1.37k|   return (a.cmp_word(b) <= 0);
 1196|  1.37k|}
_ZN5BotangeERKNS_6BigIntEm:
 1198|  4.06k|inline bool operator>=(const BigInt& a, word b) {
 1199|  4.06k|   return (a.cmp_word(b) >= 0);
 1200|  4.06k|}
_ZN5BotanltERKNS_6BigIntEm:
 1202|  3.50k|inline bool operator<(const BigInt& a, word b) {
 1203|  3.50k|   return (a.cmp_word(b) < 0);
 1204|  3.50k|}
_ZN5Botan6BigIntC2ERKS0_:
   88|  35.7k|      BigInt(const BigInt& other) = default;
_ZN5Botan6BigIntC2Ev:
   45|   137k|      BigInt() = default;
_ZN5Botan6BigIntaSERKS0_:
  201|  31.9k|      BigInt& operator=(const BigInt&) = default;

_ZN5Botan20Buffered_Computation6updateENSt3__14spanIKhLm18446744073709551615EEE:
   40|     10|      void update(std::span<const uint8_t> in) { add_data(in); }
_ZN5Botan20Buffered_Computation5finalITkNS_8concepts21resizable_byte_bufferENSt3__16vectorIhNS_16secure_allocatorIhEEEEEET_v:
   77|      2|      T final() {
   78|      2|         T output(output_length());
   79|      2|         final_result(output);
   80|      2|         return output;
   81|      2|      }
_ZN5Botan20Buffered_ComputationD2Ev:
  130|      2|      virtual ~Buffered_Computation() = default;

_ZNK5Botan10ChaCha_RNG31max_number_of_bytes_per_requestEv:
  108|     53|      size_t max_number_of_bytes_per_request() const override { return 0; }

_ZN5Botan11clear_bytesEPvm:
  101|  47.9k|inline constexpr void clear_bytes(void* ptr, size_t bytes) {
  102|  47.9k|   if(bytes > 0) {
  ------------------
  |  Branch (102:7): [True: 46.5k, False: 1.42k]
  ------------------
  103|  46.5k|      std::memset(ptr, 0, bytes);
  104|  46.5k|   }
  105|  47.9k|}
_ZN5Botan9clear_memImEEvPT_m:
  118|  33.8k|inline constexpr void clear_mem(T* ptr, size_t n) {
  119|  33.8k|   clear_bytes(ptr, sizeof(T) * n);
  120|  33.8k|}
_ZN5Botan8copy_memImQsr3stdE12is_trivial_vIu7__decayIT_EEEEvPS1_PKS1_m:
  144|  14.1k|inline constexpr void copy_mem(T* out, const T* in, size_t n) {
  145|  14.1k|   BOTAN_ASSERT_IMPLICATION(n > 0, in != nullptr && out != nullptr, "If n > 0 then args are not null");
  ------------------
  |  |  103|  14.1k|   do {                                                                                          \
  |  |  104|  14.1k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                                              \
  |  |  105|  28.2k|      if((expr1) && !(expr2)) {                                                                  \
  |  |  ------------------
  |  |  |  Branch (105:10): [True: 14.1k, False: 0]
  |  |  |  Branch (105:23): [True: 14.1k, False: 0]
  |  |  |  Branch (105:23): [True: 14.1k, False: 0]
  |  |  ------------------
  |  |  106|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                                     \
  |  |  107|      0|         Botan::assertion_failure(#expr1 " implies " #expr2, msg, __func__, __FILE__, __LINE__); \
  |  |  108|      0|      }                                                                                          \
  |  |  109|  14.1k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (109:12): [Folded, False: 14.1k]
  |  |  ------------------
  ------------------
  146|       |
  147|  14.1k|   if(in != nullptr && out != nullptr && n > 0) {
  ------------------
  |  Branch (147:7): [True: 14.1k, False: 0]
  |  Branch (147:24): [True: 14.1k, False: 0]
  |  Branch (147:42): [True: 14.1k, False: 0]
  ------------------
  148|  14.1k|      std::memmove(out, in, sizeof(T) * n);
  149|  14.1k|   }
  150|  14.1k|}
_ZN5Botan13typecast_copyITkNS_6ranges23contiguous_output_rangeERKNSt3__14spanIhLm8EEEmQaaaasr3stdE23is_trivially_copyable_vIT0_Entsr3std6rangesE5rangeIS7_Esr3stdE23is_trivially_copyable_vINS2_11conditionalIXsr21__is_primary_templateINS2_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS2_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS2_26indirectly_readable_traitsISF_EESG_E4type10value_typeEEEEvOSC_RKS7_:
  199|      4|inline constexpr void typecast_copy(ToR&& out /* NOLINT(*-std-forward) */, const FromT& in) {
  200|      4|   typecast_copy(out, std::span<const FromT, 1>(&in, 1));
  201|      4|}
_ZN5Botan13typecast_copyITkNS_6ranges23contiguous_output_rangeERKNSt3__14spanIhLm8EEETkNS1_16contiguous_rangeENS3_IKmLm1EEEQaasr3stdE23is_trivially_copyable_vINS2_11conditionalIXsr21__is_primary_templateINS2_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS2_6ranges5__cpo5beginEEclsr3stdE7declvalIRT0_EEEEEEEEE5valueENS2_26indirectly_readable_traitsISG_EESH_E4type10value_typeEEsr3stdE23is_trivially_copyable_vINS9_IXsr21__is_primary_templateINSA_Iu14__remove_cvrefIDTclL_ZNSC_5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENSI_ISQ_EESR_E4type10value_typeEEEEvOSN_RKSD_:
  176|      4|inline constexpr void typecast_copy(ToR&& out /* NOLINT(*-std-forward) */, const FromR& in) {
  177|      4|   ranges::assert_equal_byte_lengths(out, in);
  178|      4|   std::memcpy(std::ranges::data(out), std::ranges::data(in), ranges::size_bytes(out));
  179|      4|}
_ZN5Botan13typecast_copyImTkNS_6ranges16contiguous_rangeENSt3__14spanIKhLm8EEEQaaaasr3stdE26is_default_constructible_vIT_Esr3stdE23is_trivially_copyable_vIS6_Esr3stdE23is_trivially_copyable_vINS2_11conditionalIXsr21__is_primary_templateINS2_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS2_6ranges5__cpo5beginEEclsr3stdE7declvalIRT0_EEEEEEEEE5valueENS2_26indirectly_readable_traitsISE_EESF_E4type10value_typeEEEES6_RKSB_:
  210|  1.67k|inline constexpr ToT typecast_copy(const FromR& src) {
  211|  1.67k|   ToT dst;  // NOLINT(*-member-init)
  212|  1.67k|   typecast_copy(dst, src);
  213|  1.67k|   return dst;
  214|  1.67k|}
_ZN5Botan13typecast_copyImTkNS_6ranges16contiguous_rangeENSt3__14spanIKhLm8EEEQaaaasr3stdE23is_trivially_copyable_vINS2_11conditionalIXsr21__is_primary_templateINS2_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS2_6ranges5__cpo5beginEEclsr3stdE7declvalIRT0_EEEEEEEEE5valueENS2_26indirectly_readable_traitsISD_EESE_E4type10value_typeEEsr3stdE23is_trivially_copyable_vIT_Entsr3std6rangesE5rangeISK_EEEvRSK_RKSA_:
  188|  1.67k|inline constexpr void typecast_copy(ToT& out, const FromR& in) {
  189|  1.67k|   typecast_copy(std::span<ToT, 1>(&out, 1), in);
  190|  1.67k|}
_ZN5Botan13typecast_copyITkNS_6ranges23contiguous_output_rangeENSt3__14spanImLm1EEETkNS1_16contiguous_rangeENS3_IKhLm8EEEQaasr3stdE23is_trivially_copyable_vINS2_11conditionalIXsr21__is_primary_templateINS2_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS2_6ranges5__cpo5beginEEclsr3stdE7declvalIRT0_EEEEEEEEE5valueENS2_26indirectly_readable_traitsISE_EESF_E4type10value_typeEEsr3stdE23is_trivially_copyable_vINS7_IXsr21__is_primary_templateINS8_Iu14__remove_cvrefIDTclL_ZNSA_5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENSG_ISO_EESP_E4type10value_typeEEEEvOSL_RKSB_:
  176|  1.67k|inline constexpr void typecast_copy(ToR&& out /* NOLINT(*-std-forward) */, const FromR& in) {
  177|  1.67k|   ranges::assert_equal_byte_lengths(out, in);
  178|  1.67k|   std::memcpy(std::ranges::data(out), std::ranges::data(in), ranges::size_bytes(out));
  179|  1.67k|}
_ZN5Botan8copy_memITkNS_6ranges23contiguous_output_rangeENSt3__14spanIhLm18446744073709551615EEETkNS1_16contiguous_rangeENS3_IKhLm18446744073709551615EEEQaasr3stdE9is_same_vINS2_11conditionalIXsr21__is_primary_templateINS2_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS2_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS2_26indirectly_readable_traitsISE_EESF_E4type10value_typeENS7_IXsr21__is_primary_templateINS8_Iu14__remove_cvrefIDTclL_ZNSA_5beginEEclsr3stdE7declvalIRT0_EEEEEEEEE5valueENSG_ISO_EESP_E4type10value_typeEEsr3stdE23is_trivially_copyable_vIST_EEEvOSB_RKSL_:
  160|  1.04k|inline constexpr void copy_mem(OutR&& out /* NOLINT(*-std-forward) */, const InR& in) {
  161|  1.04k|   ranges::assert_equal_byte_lengths(out, in);
  162|  1.04k|   if(std::is_constant_evaluated()) {
  ------------------
  |  Branch (162:7): [Folded, False: 1.04k]
  ------------------
  163|      0|      std::copy(std::ranges::begin(in), std::ranges::end(in), std::ranges::begin(out));
  164|  1.04k|   } else if(ranges::size_bytes(out) > 0) {
  ------------------
  |  Branch (164:14): [True: 1.04k, False: 0]
  ------------------
  165|  1.04k|      std::memmove(std::ranges::data(out), std::ranges::data(in), ranges::size_bytes(out));
  166|  1.04k|   }
  167|  1.04k|}
_ZN5Botan13typecast_copyImTkNS_6ranges16contiguous_rangeENSt3__14spanIhLm8EEEQaaaasr3stdE26is_default_constructible_vIT_Esr3stdE23is_trivially_copyable_vIS5_Esr3stdE23is_trivially_copyable_vINS2_11conditionalIXsr21__is_primary_templateINS2_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS2_6ranges5__cpo5beginEEclsr3stdE7declvalIRT0_EEEEEEEEE5valueENS2_26indirectly_readable_traitsISD_EESE_E4type10value_typeEEEES5_RKSA_:
  210|  1.04k|inline constexpr ToT typecast_copy(const FromR& src) {
  211|  1.04k|   ToT dst;  // NOLINT(*-member-init)
  212|  1.04k|   typecast_copy(dst, src);
  213|  1.04k|   return dst;
  214|  1.04k|}
_ZN5Botan13typecast_copyImTkNS_6ranges16contiguous_rangeENSt3__14spanIhLm8EEEQaaaasr3stdE23is_trivially_copyable_vINS2_11conditionalIXsr21__is_primary_templateINS2_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS2_6ranges5__cpo5beginEEclsr3stdE7declvalIRT0_EEEEEEEEE5valueENS2_26indirectly_readable_traitsISC_EESD_E4type10value_typeEEsr3stdE23is_trivially_copyable_vIT_Entsr3std6rangesE5rangeISJ_EEEvRSJ_RKS9_:
  188|  1.04k|inline constexpr void typecast_copy(ToT& out, const FromR& in) {
  189|  1.04k|   typecast_copy(std::span<ToT, 1>(&out, 1), in);
  190|  1.04k|}
_ZN5Botan13typecast_copyITkNS_6ranges23contiguous_output_rangeENSt3__14spanImLm1EEETkNS1_16contiguous_rangeENS3_IhLm8EEEQaasr3stdE23is_trivially_copyable_vINS2_11conditionalIXsr21__is_primary_templateINS2_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS2_6ranges5__cpo5beginEEclsr3stdE7declvalIRT0_EEEEEEEEE5valueENS2_26indirectly_readable_traitsISD_EESE_E4type10value_typeEEsr3stdE23is_trivially_copyable_vINS6_IXsr21__is_primary_templateINS7_Iu14__remove_cvrefIDTclL_ZNS9_5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENSF_ISN_EESO_E4type10value_typeEEEEvOSK_RKSA_:
  176|  1.04k|inline constexpr void typecast_copy(ToR&& out /* NOLINT(*-std-forward) */, const FromR& in) {
  177|  1.04k|   ranges::assert_equal_byte_lengths(out, in);
  178|  1.04k|   std::memcpy(std::ranges::data(out), std::ranges::data(in), ranges::size_bytes(out));
  179|  1.04k|}
_ZN5Botan9clear_memITkNS_6ranges23contiguous_output_rangeENSt3__14spanImLm18446744073709551615EEEEEvOT_Qsr3stdE23is_trivially_copyable_vINS2_11conditionalIXsr21__is_primary_templateINS2_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS2_6ranges5__cpo5beginEEclsr3stdE7declvalIRS5_EEEEEEEEE5valueENS2_26indirectly_readable_traitsISD_EESE_E4type10value_typeEE:
  132|  14.1k|{
  133|  14.1k|   clear_bytes(std::ranges::data(mem), ranges::size_bytes(mem));
  134|  14.1k|}
_ZN5Botan8copy_memITkNS_6ranges23contiguous_output_rangeENSt3__14spanImLm18446744073709551615EEETkNS1_16contiguous_rangeENS3_IKmLm18446744073709551615EEEQaasr3stdE9is_same_vINS2_11conditionalIXsr21__is_primary_templateINS2_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS2_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS2_26indirectly_readable_traitsISE_EESF_E4type10value_typeENS7_IXsr21__is_primary_templateINS8_Iu14__remove_cvrefIDTclL_ZNSA_5beginEEclsr3stdE7declvalIRT0_EEEEEEEEE5valueENSG_ISO_EESP_E4type10value_typeEEsr3stdE23is_trivially_copyable_vIST_EEEvOSB_RKSL_:
  160|  5.18k|inline constexpr void copy_mem(OutR&& out /* NOLINT(*-std-forward) */, const InR& in) {
  161|  5.18k|   ranges::assert_equal_byte_lengths(out, in);
  162|  5.18k|   if(std::is_constant_evaluated()) {
  ------------------
  |  Branch (162:7): [Folded, False: 5.18k]
  ------------------
  163|      0|      std::copy(std::ranges::begin(in), std::ranges::end(in), std::ranges::begin(out));
  164|  5.18k|   } else if(ranges::size_bytes(out) > 0) {
  ------------------
  |  Branch (164:14): [True: 5.18k, False: 0]
  ------------------
  165|  5.18k|      std::memmove(std::ranges::data(out), std::ranges::data(in), ranges::size_bytes(out));
  166|  5.18k|   }
  167|  5.18k|}
_ZN5Botan8copy_memITkNS_6ranges23contiguous_output_rangeERNSt3__16vectorImNS_16secure_allocatorImEEEETkNS1_16contiguous_rangeENS2_4spanImLm18446744073709551615EEEQaasr3stdE9is_same_vINS2_11conditionalIXsr21__is_primary_templateINS2_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS2_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS2_26indirectly_readable_traitsISH_EESI_E4type10value_typeENSA_IXsr21__is_primary_templateINSB_Iu14__remove_cvrefIDTclL_ZNSD_5beginEEclsr3stdE7declvalIRT0_EEEEEEEEE5valueENSJ_ISR_EESS_E4type10value_typeEEsr3stdE23is_trivially_copyable_vISW_EEEvOSE_RKSO_:
  160|   463k|inline constexpr void copy_mem(OutR&& out /* NOLINT(*-std-forward) */, const InR& in) {
  161|   463k|   ranges::assert_equal_byte_lengths(out, in);
  162|   463k|   if(std::is_constant_evaluated()) {
  ------------------
  |  Branch (162:7): [Folded, False: 463k]
  ------------------
  163|      0|      std::copy(std::ranges::begin(in), std::ranges::end(in), std::ranges::begin(out));
  164|   463k|   } else if(ranges::size_bytes(out) > 0) {
  ------------------
  |  Branch (164:14): [True: 463k, False: 0]
  ------------------
  165|   463k|      std::memmove(std::ranges::data(out), std::ranges::data(in), ranges::size_bytes(out));
  166|   463k|   }
  167|   463k|}
_ZN5Botan9clear_memIhEEvPT_m:
  118|      4|inline constexpr void clear_mem(T* ptr, size_t n) {
  119|      4|   clear_bytes(ptr, sizeof(T) * n);
  120|      4|}
_ZN5Botan13typecast_copyITkNS_6ranges23contiguous_output_rangeERKNSt3__14spanIhLm4EEEjQaaaasr3stdE23is_trivially_copyable_vIT0_Entsr3std6rangesE5rangeIS7_Esr3stdE23is_trivially_copyable_vINS2_11conditionalIXsr21__is_primary_templateINS2_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS2_6ranges5__cpo5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENS2_26indirectly_readable_traitsISF_EESG_E4type10value_typeEEEEvOSC_RKS7_:
  199|     32|inline constexpr void typecast_copy(ToR&& out /* NOLINT(*-std-forward) */, const FromT& in) {
  200|     32|   typecast_copy(out, std::span<const FromT, 1>(&in, 1));
  201|     32|}
_ZN5Botan13typecast_copyITkNS_6ranges23contiguous_output_rangeERKNSt3__14spanIhLm4EEETkNS1_16contiguous_rangeENS3_IKjLm1EEEQaasr3stdE23is_trivially_copyable_vINS2_11conditionalIXsr21__is_primary_templateINS2_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS2_6ranges5__cpo5beginEEclsr3stdE7declvalIRT0_EEEEEEEEE5valueENS2_26indirectly_readable_traitsISG_EESH_E4type10value_typeEEsr3stdE23is_trivially_copyable_vINS9_IXsr21__is_primary_templateINSA_Iu14__remove_cvrefIDTclL_ZNSC_5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENSI_ISQ_EESR_E4type10value_typeEEEEvOSN_RKSD_:
  176|     32|inline constexpr void typecast_copy(ToR&& out /* NOLINT(*-std-forward) */, const FromR& in) {
  177|     32|   ranges::assert_equal_byte_lengths(out, in);
  178|     32|   std::memcpy(std::ranges::data(out), std::ranges::data(in), ranges::size_bytes(out));
  179|     32|}
_ZN5Botan8copy_memIhQsr3stdE12is_trivial_vIu7__decayIT_EEEEvPS1_PKS1_m:
  144|     57|inline constexpr void copy_mem(T* out, const T* in, size_t n) {
  145|     57|   BOTAN_ASSERT_IMPLICATION(n > 0, in != nullptr && out != nullptr, "If n > 0 then args are not null");
  ------------------
  |  |  103|     57|   do {                                                                                          \
  |  |  104|     57|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                                              \
  |  |  105|    108|      if((expr1) && !(expr2)) {                                                                  \
  |  |  ------------------
  |  |  |  Branch (105:10): [True: 54, False: 3]
  |  |  |  Branch (105:23): [True: 54, False: 0]
  |  |  |  Branch (105:23): [True: 54, False: 0]
  |  |  ------------------
  |  |  106|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                                     \
  |  |  107|      0|         Botan::assertion_failure(#expr1 " implies " #expr2, msg, __func__, __FILE__, __LINE__); \
  |  |  108|      0|      }                                                                                          \
  |  |  109|     57|   } while(0)
  |  |  ------------------
  |  |  |  Branch (109:12): [Folded, False: 57]
  |  |  ------------------
  ------------------
  146|       |
  147|     57|   if(in != nullptr && out != nullptr && n > 0) {
  ------------------
  |  Branch (147:7): [True: 57, False: 0]
  |  Branch (147:24): [True: 57, False: 0]
  |  Branch (147:42): [True: 54, False: 3]
  ------------------
  148|     54|      std::memmove(out, in, sizeof(T) * n);
  149|     54|   }
  150|     57|}
_ZN5Botan9clear_memIjEEvPT_m:
  118|      6|inline constexpr void clear_mem(T* ptr, size_t n) {
  119|      6|   clear_bytes(ptr, sizeof(T) * n);
  120|      6|}
_ZN5Botan13typecast_copyITkNS_6ranges23contiguous_output_rangeERNSt3__14spanIjLm18446744073709551615EEETkNS1_16contiguous_rangeENS3_IKhLm18446744073709551615EEEQaasr3stdE23is_trivially_copyable_vINS2_11conditionalIXsr21__is_primary_templateINS2_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS2_6ranges5__cpo5beginEEclsr3stdE7declvalIRT0_EEEEEEEEE5valueENS2_26indirectly_readable_traitsISF_EESG_E4type10value_typeEEsr3stdE23is_trivially_copyable_vINS8_IXsr21__is_primary_templateINS9_Iu14__remove_cvrefIDTclL_ZNSB_5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENSH_ISP_EESQ_E4type10value_typeEEEEvOSM_RKSC_:
  176|      2|inline constexpr void typecast_copy(ToR&& out /* NOLINT(*-std-forward) */, const FromR& in) {
  177|      2|   ranges::assert_equal_byte_lengths(out, in);
  178|      2|   std::memcpy(std::ranges::data(out), std::ranges::data(in), ranges::size_bytes(out));
  179|      2|}

_ZN5Botan6ranges25assert_equal_byte_lengthsITkNS0_14spanable_rangeENSt3__14spanIhLm18446744073709551615EEETpTkNS0_14spanable_rangeEJNS3_IKhLm18446744073709551615EEEEEEvRKT_DpRKT0_QgtsZT0_Li0E:
  100|  1.04k|{
  101|  1.04k|   const std::span s0{r0};
  102|       |
  103|       |   if constexpr(statically_spanable_range<R0>) {
  104|       |      constexpr size_t expected_size = s0.size_bytes();
  105|       |      (assert_exact_byte_length<expected_size>(rs), ...);
  106|  1.04k|   } else {
  107|  1.04k|      const size_t expected_size = s0.size_bytes();
  108|  1.04k|      const bool correct_size =
  109|  1.04k|         ((std::span<const std::ranges::range_value_t<Rs>>{rs}.size_bytes() == expected_size) && ...);
  110|       |
  111|  1.04k|      if(!correct_size) {
  ------------------
  |  Branch (111:10): [True: 0, False: 1.04k]
  ------------------
  112|      0|         memory_region_size_violation();
  113|      0|      }
  114|  1.04k|   }
  115|  1.04k|}
_ZN5Botan6ranges24assert_exact_byte_lengthILm8ETkNS0_14spanable_rangeENSt3__14spanIhLm8EEEEEvRKT0_:
   77|  1.04k|inline constexpr void assert_exact_byte_length(const R& r) {
   78|  1.04k|   const std::span s{r};
   79|  1.04k|   if constexpr(statically_spanable_range<R>) {
   80|  1.04k|      static_assert(s.size_bytes() == expected, "memory region does not have expected byte lengths");
   81|       |   } else {
   82|       |      if(s.size_bytes() != expected) {
   83|       |         memory_region_size_violation();
   84|       |      }
   85|       |   }
   86|  1.04k|}
_ZN5Botan6ranges25assert_equal_byte_lengthsITkNS0_14spanable_rangeENSt3__14spanIhLm8EEETpTkNS0_14spanable_rangeEJNS3_IKmLm1EEEEEEvRKT_DpRKT0_QgtsZT0_Li0E:
  100|      4|{
  101|      4|   const std::span s0{r0};
  102|       |
  103|      4|   if constexpr(statically_spanable_range<R0>) {
  104|      4|      constexpr size_t expected_size = s0.size_bytes();
  105|      4|      (assert_exact_byte_length<expected_size>(rs), ...);
  106|       |   } else {
  107|       |      const size_t expected_size = s0.size_bytes();
  108|       |      const bool correct_size =
  109|       |         ((std::span<const std::ranges::range_value_t<Rs>>{rs}.size_bytes() == expected_size) && ...);
  110|       |
  111|       |      if(!correct_size) {
  112|       |         memory_region_size_violation();
  113|       |      }
  114|       |   }
  115|      4|}
_ZN5Botan6ranges24assert_exact_byte_lengthILm8ETkNS0_14spanable_rangeENSt3__14spanIKmLm1EEEEEvRKT0_:
   77|      4|inline constexpr void assert_exact_byte_length(const R& r) {
   78|      4|   const std::span s{r};
   79|      4|   if constexpr(statically_spanable_range<R>) {
   80|      4|      static_assert(s.size_bytes() == expected, "memory region does not have expected byte lengths");
   81|       |   } else {
   82|       |      if(s.size_bytes() != expected) {
   83|       |         memory_region_size_violation();
   84|       |      }
   85|       |   }
   86|      4|}
_ZN5Botan6ranges10size_bytesITkNS0_14spanable_rangeENSt3__14spanIhLm8EEEEEmRKT_:
   59|      4|inline constexpr size_t size_bytes(const spanable_range auto& r) {
   60|      4|   return std::span{r}.size_bytes();
   61|      4|}
_ZN5Botan6ranges24assert_exact_byte_lengthILm8ETkNS0_14spanable_rangeENSt3__14spanIKhLm8EEEEEvRKT0_:
   77|  3.34k|inline constexpr void assert_exact_byte_length(const R& r) {
   78|  3.34k|   const std::span s{r};
   79|  3.34k|   if constexpr(statically_spanable_range<R>) {
   80|  3.34k|      static_assert(s.size_bytes() == expected, "memory region does not have expected byte lengths");
   81|       |   } else {
   82|       |      if(s.size_bytes() != expected) {
   83|       |         memory_region_size_violation();
   84|       |      }
   85|       |   }
   86|  3.34k|}
_ZN5Botan6ranges25assert_equal_byte_lengthsITkNS0_14spanable_rangeENSt3__14spanImLm1EEETpTkNS0_14spanable_rangeEJNS3_IKhLm8EEEEEEvRKT_DpRKT0_QgtsZT0_Li0E:
  100|  1.67k|{
  101|  1.67k|   const std::span s0{r0};
  102|       |
  103|  1.67k|   if constexpr(statically_spanable_range<R0>) {
  104|  1.67k|      constexpr size_t expected_size = s0.size_bytes();
  105|  1.67k|      (assert_exact_byte_length<expected_size>(rs), ...);
  106|       |   } else {
  107|       |      const size_t expected_size = s0.size_bytes();
  108|       |      const bool correct_size =
  109|       |         ((std::span<const std::ranges::range_value_t<Rs>>{rs}.size_bytes() == expected_size) && ...);
  110|       |
  111|       |      if(!correct_size) {
  112|       |         memory_region_size_violation();
  113|       |      }
  114|       |   }
  115|  1.67k|}
_ZN5Botan6ranges10size_bytesITkNS0_14spanable_rangeENSt3__14spanImLm1EEEEEmRKT_:
   59|  2.71k|inline constexpr size_t size_bytes(const spanable_range auto& r) {
   60|  2.71k|   return std::span{r}.size_bytes();
   61|  2.71k|}
_ZN5Botan6ranges10size_bytesITkNS0_14spanable_rangeENSt3__14spanIhLm18446744073709551615EEEEEmRKT_:
   59|  2.09k|inline constexpr size_t size_bytes(const spanable_range auto& r) {
   60|  2.09k|   return std::span{r}.size_bytes();
   61|  2.09k|}
_ZN5Botan6ranges24assert_exact_byte_lengthILm8ETkNS0_14spanable_rangeENSt3__15arrayIhLm8EEEEEvRKT0_:
   77|  1.04k|inline constexpr void assert_exact_byte_length(const R& r) {
   78|  1.04k|   const std::span s{r};
   79|  1.04k|   if constexpr(statically_spanable_range<R>) {
   80|  1.04k|      static_assert(s.size_bytes() == expected, "memory region does not have expected byte lengths");
   81|       |   } else {
   82|       |      if(s.size_bytes() != expected) {
   83|       |         memory_region_size_violation();
   84|       |      }
   85|       |   }
   86|  1.04k|}
_ZN5Botan6ranges25assert_equal_byte_lengthsITkNS0_14spanable_rangeENSt3__14spanImLm1EEETpTkNS0_14spanable_rangeEJNS3_IhLm8EEEEEEvRKT_DpRKT0_QgtsZT0_Li0E:
  100|  1.04k|{
  101|  1.04k|   const std::span s0{r0};
  102|       |
  103|  1.04k|   if constexpr(statically_spanable_range<R0>) {
  104|  1.04k|      constexpr size_t expected_size = s0.size_bytes();
  105|  1.04k|      (assert_exact_byte_length<expected_size>(rs), ...);
  106|       |   } else {
  107|       |      const size_t expected_size = s0.size_bytes();
  108|       |      const bool correct_size =
  109|       |         ((std::span<const std::ranges::range_value_t<Rs>>{rs}.size_bytes() == expected_size) && ...);
  110|       |
  111|       |      if(!correct_size) {
  112|       |         memory_region_size_violation();
  113|       |      }
  114|       |   }
  115|  1.04k|}
_ZN5Botan6ranges10size_bytesITkNS0_14spanable_rangeENSt3__14spanImLm18446744073709551615EEEEEmRKT_:
   59|  24.4k|inline constexpr size_t size_bytes(const spanable_range auto& r) {
   60|  24.4k|   return std::span{r}.size_bytes();
   61|  24.4k|}
_ZN5Botan6ranges25assert_equal_byte_lengthsITkNS0_14spanable_rangeENSt3__14spanImLm18446744073709551615EEETpTkNS0_14spanable_rangeEJNS3_IKmLm18446744073709551615EEEEEEvRKT_DpRKT0_QgtsZT0_Li0E:
  100|  5.18k|{
  101|  5.18k|   const std::span s0{r0};
  102|       |
  103|       |   if constexpr(statically_spanable_range<R0>) {
  104|       |      constexpr size_t expected_size = s0.size_bytes();
  105|       |      (assert_exact_byte_length<expected_size>(rs), ...);
  106|  5.18k|   } else {
  107|  5.18k|      const size_t expected_size = s0.size_bytes();
  108|  5.18k|      const bool correct_size =
  109|  5.18k|         ((std::span<const std::ranges::range_value_t<Rs>>{rs}.size_bytes() == expected_size) && ...);
  110|       |
  111|  5.18k|      if(!correct_size) {
  ------------------
  |  Branch (111:10): [True: 0, False: 5.18k]
  ------------------
  112|      0|         memory_region_size_violation();
  113|      0|      }
  114|  5.18k|   }
  115|  5.18k|}
_ZN5Botan6ranges25assert_equal_byte_lengthsITkNS0_14spanable_rangeENSt3__16vectorImNS_16secure_allocatorImEEEETpTkNS0_14spanable_rangeEJNS2_4spanImLm18446744073709551615EEEEEEvRKT_DpRKT0_QgtsZT0_Li0E:
  100|   463k|{
  101|   463k|   const std::span s0{r0};
  102|       |
  103|       |   if constexpr(statically_spanable_range<R0>) {
  104|       |      constexpr size_t expected_size = s0.size_bytes();
  105|       |      (assert_exact_byte_length<expected_size>(rs), ...);
  106|   463k|   } else {
  107|   463k|      const size_t expected_size = s0.size_bytes();
  108|   463k|      const bool correct_size =
  109|   463k|         ((std::span<const std::ranges::range_value_t<Rs>>{rs}.size_bytes() == expected_size) && ...);
  110|       |
  111|   463k|      if(!correct_size) {
  ------------------
  |  Branch (111:10): [True: 0, False: 463k]
  ------------------
  112|      0|         memory_region_size_violation();
  113|      0|      }
  114|   463k|   }
  115|   463k|}
_ZN5Botan6ranges10size_bytesITkNS0_14spanable_rangeENSt3__16vectorImNS_16secure_allocatorImEEEEEEmRKT_:
   59|   926k|inline constexpr size_t size_bytes(const spanable_range auto& r) {
   60|   926k|   return std::span{r}.size_bytes();
   61|   926k|}
_ZN5Botan6ranges24assert_exact_byte_lengthILm4ETkNS0_14spanable_rangeENSt3__14spanIhLm4EEEEEvRKT0_:
   77|     64|inline constexpr void assert_exact_byte_length(const R& r) {
   78|     64|   const std::span s{r};
   79|     64|   if constexpr(statically_spanable_range<R>) {
   80|     64|      static_assert(s.size_bytes() == expected, "memory region does not have expected byte lengths");
   81|       |   } else {
   82|       |      if(s.size_bytes() != expected) {
   83|       |         memory_region_size_violation();
   84|       |      }
   85|       |   }
   86|     64|}
_ZN5Botan6ranges25assert_equal_byte_lengthsITkNS0_14spanable_rangeENSt3__14spanIhLm4EEETpTkNS0_14spanable_rangeEJNS3_IKjLm1EEEEEEvRKT_DpRKT0_QgtsZT0_Li0E:
  100|     32|{
  101|     32|   const std::span s0{r0};
  102|       |
  103|     32|   if constexpr(statically_spanable_range<R0>) {
  104|     32|      constexpr size_t expected_size = s0.size_bytes();
  105|     32|      (assert_exact_byte_length<expected_size>(rs), ...);
  106|       |   } else {
  107|       |      const size_t expected_size = s0.size_bytes();
  108|       |      const bool correct_size =
  109|       |         ((std::span<const std::ranges::range_value_t<Rs>>{rs}.size_bytes() == expected_size) && ...);
  110|       |
  111|       |      if(!correct_size) {
  112|       |         memory_region_size_violation();
  113|       |      }
  114|       |   }
  115|     32|}
_ZN5Botan6ranges24assert_exact_byte_lengthILm4ETkNS0_14spanable_rangeENSt3__14spanIKjLm1EEEEEvRKT0_:
   77|     32|inline constexpr void assert_exact_byte_length(const R& r) {
   78|     32|   const std::span s{r};
   79|     32|   if constexpr(statically_spanable_range<R>) {
   80|     32|      static_assert(s.size_bytes() == expected, "memory region does not have expected byte lengths");
   81|       |   } else {
   82|       |      if(s.size_bytes() != expected) {
   83|       |         memory_region_size_violation();
   84|       |      }
   85|       |   }
   86|     32|}
_ZN5Botan6ranges10size_bytesITkNS0_14spanable_rangeENSt3__14spanIhLm4EEEEEmRKT_:
   59|     32|inline constexpr size_t size_bytes(const spanable_range auto& r) {
   60|     32|   return std::span{r}.size_bytes();
   61|     32|}
_ZN5Botan6ranges25assert_equal_byte_lengthsITkNS0_14spanable_rangeENSt3__14spanIjLm18446744073709551615EEETpTkNS0_14spanable_rangeEJNS3_IKhLm18446744073709551615EEEEEEvRKT_DpRKT0_QgtsZT0_Li0E:
  100|      4|{
  101|      4|   const std::span s0{r0};
  102|       |
  103|       |   if constexpr(statically_spanable_range<R0>) {
  104|       |      constexpr size_t expected_size = s0.size_bytes();
  105|       |      (assert_exact_byte_length<expected_size>(rs), ...);
  106|      4|   } else {
  107|      4|      const size_t expected_size = s0.size_bytes();
  108|      4|      const bool correct_size =
  109|      4|         ((std::span<const std::ranges::range_value_t<Rs>>{rs}.size_bytes() == expected_size) && ...);
  110|       |
  111|      4|      if(!correct_size) {
  ------------------
  |  Branch (111:10): [True: 0, False: 4]
  ------------------
  112|      0|         memory_region_size_violation();
  113|      0|      }
  114|      4|   }
  115|      4|}
_ZN5Botan6ranges25assert_equal_byte_lengthsITkNS0_14spanable_rangeENSt3__14spanIhLm18446744073709551615EEETpTkNS0_14spanable_rangeEJNS3_IKjLm18446744073709551615EEEEEEvRKT_DpRKT0_QgtsZT0_Li0E:
  100|      4|{
  101|      4|   const std::span s0{r0};
  102|       |
  103|       |   if constexpr(statically_spanable_range<R0>) {
  104|       |      constexpr size_t expected_size = s0.size_bytes();
  105|       |      (assert_exact_byte_length<expected_size>(rs), ...);
  106|      4|   } else {
  107|      4|      const size_t expected_size = s0.size_bytes();
  108|      4|      const bool correct_size =
  109|      4|         ((std::span<const std::ranges::range_value_t<Rs>>{rs}.size_bytes() == expected_size) && ...);
  110|       |
  111|      4|      if(!correct_size) {
  ------------------
  |  Branch (111:10): [True: 0, False: 4]
  ------------------
  112|      0|         memory_region_size_violation();
  113|      0|      }
  114|      4|   }
  115|      4|}
_ZN5Botan6ranges10size_bytesITkNS0_14spanable_rangeENSt3__14spanIjLm18446744073709551615EEEEEmRKT_:
   59|      2|inline constexpr size_t size_bytes(const spanable_range auto& r) {
   60|      2|   return std::span{r}.size_bytes();
   61|      2|}

_ZN5Botan21RandomNumberGeneratorD2Ev:
   52|      1|      virtual ~RandomNumberGenerator() = default;
_ZN5Botan21RandomNumberGenerator9randomizeENSt3__14spanIhLm18446744073709551615EEE:
   75|     53|      void randomize(std::span<uint8_t> output) { this->fill_bytes_with_input(output, {}); }
_ZN5Botan21RandomNumberGenerator11add_entropyENSt3__14spanIKhLm18446744073709551615EEE:
   98|      1|      void add_entropy(std::span<const uint8_t> input) { this->fill_bytes_with_input({}, input); }
_ZN5Botan21RandomNumberGenerator10random_vecENSt3__14spanIhLm18446744073709551615EEE:
  204|     53|      void random_vec(std::span<uint8_t> v) { this->randomize(v); }
_ZN5Botan21RandomNumberGeneratorC2Ev:
   54|      1|      RandomNumberGenerator() = default;
_ZN5Botan21RandomNumberGenerator10random_vecITkNS_8concepts21resizable_byte_bufferENSt3__16vectorIhNS_16secure_allocatorIhEEEEQsr3stdE21default_initializableIT_EEES8_m:
  230|     53|      T random_vec(size_t bytes) {
  231|     53|         T result;
  232|     53|         random_vec(result, bytes);
  233|     53|         return result;
  234|     53|      }
_ZN5Botan21RandomNumberGenerator10random_vecITkNS_8concepts21resizable_byte_bufferENSt3__16vectorIhNS_16secure_allocatorIhEEEEEEvRT_m:
  215|     53|      void random_vec(T& v, size_t bytes) {
  216|     53|         v.resize(bytes);
  217|     53|         random_vec(v);
  218|     53|      }

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

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

_ZN5Botan12StreamCipher15write_keystreamENSt3__14spanIhLm18446744073709551615EEE:
   86|     54|      void write_keystream(std::span<uint8_t> out) { generate_keystream(out.data(), out.size()); }
_ZN5Botan12StreamCipher6set_ivEPKhm:
  166|      2|      void set_iv(const uint8_t iv[], size_t iv_len) { set_iv_bytes(iv, iv_len); }
_ZN5Botan12StreamCipher15keystream_bytesITkNS_8concepts21resizable_byte_bufferENSt3__16vectorIhNS_16secure_allocatorIhEEEEEET_m:
   96|      1|      T keystream_bytes(size_t bytes) {
   97|      1|         T out(bytes);
   98|      1|         write_keystream(out);
   99|      1|         return out;
  100|      1|      }

_ZN5Botan18unwrap_strong_typeIRmEEDcOT_:
  243|      4|[[nodiscard]] constexpr decltype(auto) unwrap_strong_type(T&& t) {
  244|      4|   if constexpr(!concepts::strong_type<std::remove_cvref_t<T>>) {
  245|       |      // If the parameter type isn't a strong type, return it as is.
  246|      4|      return std::forward<T>(t);
  247|       |   } else {
  248|       |      // Unwrap the strong type and return the underlying value.
  249|       |      return std::forward<T>(t).get();
  250|       |   }
  251|      4|}
_ZN5Botan16wrap_strong_typeImRmQoosr3stdE18constructible_fromIT_T0_Eaasr8conceptsE11strong_typeIS2_Esr3stdE18constructible_fromINS2_12wrapped_typeES3_EEEDcOS3_:
  268|  2.71k|[[nodiscard]] constexpr decltype(auto) wrap_strong_type(ParamT&& t) {
  269|  2.71k|   if constexpr(std::same_as<std::remove_cvref_t<ParamT>, T>) {
  270|       |      // Noop, if the parameter type already is the desired return type.
  271|  2.71k|      return std::forward<ParamT>(t);
  272|       |   } else if constexpr(std::constructible_from<T, ParamT>) {
  273|       |      // Implicit conversion from the parameter type to the return type.
  274|       |      return T{std::forward<ParamT>(t)};
  275|       |   } else {
  276|       |      // Explicitly calling the wrapped type's constructor to support
  277|       |      // implicit conversions on types that mark their constructors as explicit.
  278|       |      static_assert(concepts::strong_type<T> && std::constructible_from<typename T::wrapped_type, ParamT>);
  279|       |      return T{typename T::wrapped_type{std::forward<ParamT>(t)}};
  280|       |   }
  281|  2.71k|}
_ZN5Botan18unwrap_strong_typeIRjEEDcOT_:
  243|     32|[[nodiscard]] constexpr decltype(auto) unwrap_strong_type(T&& t) {
  244|     32|   if constexpr(!concepts::strong_type<std::remove_cvref_t<T>>) {
  245|       |      // If the parameter type isn't a strong type, return it as is.
  246|     32|      return std::forward<T>(t);
  247|       |   } else {
  248|       |      // Unwrap the strong type and return the underlying value.
  249|       |      return std::forward<T>(t).get();
  250|       |   }
  251|     32|}

_ZN5Botan24Key_Length_SpecificationC2Emmm:
   37|      4|            m_min_keylen(min_k), m_max_keylen(max_k > 0 ? max_k : min_k), m_keylen_mod(k_mod) {}
  ------------------
  |  Branch (37:47): [True: 4, False: 0]
  ------------------
_ZNK5Botan24Key_Length_Specification15valid_keylengthEm:
   43|      4|      bool valid_keylength(size_t length) const {
   44|      4|         return ((length >= m_min_keylen) && (length <= m_max_keylen) && (length % m_keylen_mod == 0));
  ------------------
  |  Branch (44:18): [True: 4, False: 0]
  |  Branch (44:46): [True: 4, False: 0]
  |  Branch (44:74): [True: 4, False: 0]
  ------------------
   45|      4|      }
_ZNK5Botan18SymmetricAlgorithm15valid_keylengthEm:
  113|      4|      bool valid_keylength(size_t length) const { return key_spec().valid_keylength(length); }
_ZNK5Botan18SymmetricAlgorithm23assert_key_material_setEv:
  145|     59|      void assert_key_material_set() const { assert_key_material_set(has_keying_material()); }
_ZNK5Botan18SymmetricAlgorithm23assert_key_material_setEb:
  147|     59|      void assert_key_material_set(bool predicate) const {
  148|     59|         if(!predicate) {
  ------------------
  |  Branch (148:13): [True: 0, False: 59]
  ------------------
  149|      0|            throw_key_not_set_error();
  150|      0|         }
  151|     59|      }
_ZN5Botan18SymmetricAlgorithmD2Ev:
   81|      2|      virtual ~SymmetricAlgorithm() = default;
_ZN5Botan18SymmetricAlgorithmC2Ev:
   80|      2|      SymmetricAlgorithm() = default;

LLVMFuzzerInitialize:
   28|      2|extern "C" int LLVMFuzzerInitialize(int* /*argc*/, char*** /*argv*/) {
   29|       |   /*
   30|       |   * This disables the mlock pool, as overwrites within the pool are
   31|       |   * opaque to ASan or other instrumentation.
   32|       |   */
   33|      2|   ::setenv("BOTAN_MLOCK_POOL_SIZE", "0", 1);
   34|      2|   return 0;
   35|      2|}
LLVMFuzzerTestOneInput:
   39|  1.40k|extern "C" int LLVMFuzzerTestOneInput(const uint8_t in[], size_t len) {
   40|  1.40k|   if(len <= max_fuzzer_input_size) {
  ------------------
  |  Branch (40:7): [True: 1.40k, False: 9]
  ------------------
   41|  1.40k|      try {
   42|  1.40k|         fuzz(std::span<const uint8_t>(in, len));
   43|  1.40k|      } catch(const std::exception& e) {
   44|      0|         std::cerr << "Uncaught exception from fuzzer driver " << e.what() << "\n";
   45|      0|         abort();
   46|      0|      } catch(...) {
   47|      0|         std::cerr << "Uncaught exception from fuzzer driver (unknown type)\n";
   48|      0|         abort();
   49|      0|      }
   50|  1.40k|   }
   51|  1.40k|   return 0;
   52|  1.40k|}
_Z10fuzzer_rngv:
   62|      1|inline Botan::RandomNumberGenerator& fuzzer_rng() {
   63|      1|   return *fuzzer_rng_as_shared();
   64|      1|}
_Z20fuzzer_rng_as_sharedv:
   56|      1|inline std::shared_ptr<Botan::RandomNumberGenerator> fuzzer_rng_as_shared() {
   57|      1|   static const std::shared_ptr<Botan::ChaCha_RNG> rng =
   58|      1|      std::make_shared<Botan::ChaCha_RNG>(Botan::secure_vector<uint8_t>(32));
   59|      1|   return rng;
   60|      1|}

_Z4fuzzNSt3__14spanIKhLm18446744073709551615EEE:
   12|  1.40k|void fuzz(std::span<const uint8_t> in) {
   13|       |   // Ressol is mostly used for ECC point decompression so best to test smaller sizes
   14|  1.40k|   static const size_t p_bits = 256;
   15|       |   // Use p == 1 mod 4 since sqrt modulo p == 3 mod 4 is a fast case
   16|  1.40k|   static const Botan::BigInt p = random_prime(fuzzer_rng(), p_bits, 0, 1, 4);
   17|  1.40k|   static auto mod_p = Botan::Barrett_Reduction::for_public_modulus(p);
   18|       |
   19|  1.40k|   if(in.size() > p_bits / 8) {
  ------------------
  |  Branch (19:7): [True: 26, False: 1.37k]
  ------------------
   20|     26|      return;
   21|     26|   }
   22|       |
   23|  1.37k|   try {
   24|  1.37k|      const Botan::BigInt a = Botan::BigInt::from_bytes(in);
   25|  1.37k|      const Botan::BigInt a_sqrt = Botan::sqrt_modulo_prime(a, p);
   26|       |
   27|  1.37k|      if(a_sqrt > 0) {
  ------------------
  |  Branch (27:10): [True: 747, False: 627]
  ------------------
   28|    747|         const Botan::BigInt a_redc = mod_p.reduce(a);
   29|    747|         const Botan::BigInt z = mod_p.square(a_sqrt);
   30|       |
   31|    747|         if(z != a_redc) {
  ------------------
  |  Branch (31:13): [True: 0, False: 747]
  ------------------
   32|      0|            FUZZER_WRITE_AND_CRASH("A = " << a.to_hex_string() << "\n"
  ------------------
  |  |   70|      0|   do {                                                                                                       \
  |  |   71|      0|      std::cerr << expr << " @ Line " << __LINE__ << " in " << __FILE__ << "\n"; /* NOLINT(*-macro-paren*) */ \
  |  |   72|      0|      abort();                                                                                                \
  |  |   73|      0|   } while(0)
  |  |  ------------------
  |  |  |  Branch (73:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
   33|      0|                                          << "P = " << p.to_hex_string() << "\n"
   34|      0|                                          << "R = " << a_sqrt.to_hex_string() << "\n"
   35|      0|                                          << "Z = " << z.to_hex_string() << "\n");
   36|      0|         }
   37|    747|      }
   38|  1.37k|   } catch(const Botan::Exception& e) {}
   39|  1.37k|}

_ZN5Botan20Buffered_Computation5finalENSt3__14spanIhLm18446744073709551615EEE:
   54|      4|void Buffered_Computation::final(std::span<uint8_t> out) {
   55|      4|   BOTAN_ARG_CHECK(out.size() >= output_length(), "provided output buffer has insufficient capacity");
  ------------------
  |  |   35|      4|   do {                                                          \
  |  |   36|      4|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */              \
  |  |   37|      4|      if(!(expr)) {                                              \
  |  |  ------------------
  |  |  |  Branch (37:10): [True: 0, False: 4]
  |  |  ------------------
  |  |   38|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */     \
  |  |   39|      0|         Botan::throw_invalid_argument(msg, __func__, __FILE__); \
  |  |   40|      0|      }                                                          \
  |  |   41|      4|   } while(0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 4]
  |  |  ------------------
  ------------------
   56|      4|   final_result(out);
   57|      4|}

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

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

_ZN5Botan7SHA_25615compress_digestERNSt3__16vectorIjNS_16secure_allocatorIjEEEENS1_4spanIKhLm18446744073709551615EEEm:
   59|     10|                                                             size_t blocks) {
   60|     10|#if defined(BOTAN_HAS_SHA2_32_X86)
   61|     10|   if(CPUID::has(CPUID::Feature::SHA)) {
  ------------------
  |  Branch (61:7): [True: 10, False: 0]
  ------------------
   62|     10|      return SHA_256::compress_digest_x86(digest, input, blocks);
   63|     10|   }
   64|      0|#endif
   65|       |
   66|       |#if defined(BOTAN_HAS_SHA2_32_ARMV8)
   67|       |   if(CPUID::has(CPUID::Feature::SHA2)) {
   68|       |      return SHA_256::compress_digest_armv8(digest, input, blocks);
   69|       |   }
   70|       |#endif
   71|       |
   72|      0|#if defined(BOTAN_HAS_SHA2_32_X86_AVX2)
   73|      0|   if(CPUID::has(CPUID::Feature::AVX2, CPUID::Feature::BMI)) {
  ------------------
  |  Branch (73:7): [True: 0, False: 0]
  ------------------
   74|      0|      return SHA_256::compress_digest_x86_avx2(digest, input, blocks);
   75|      0|   }
   76|      0|#endif
   77|       |
   78|      0|#if defined(BOTAN_HAS_SHA2_32_SIMD)
   79|      0|   if(CPUID::has(CPUID::Feature::SIMD_4X32)) {
  ------------------
  |  Branch (79:7): [True: 0, False: 0]
  ------------------
   80|      0|      return SHA_256::compress_digest_x86_simd(digest, input, blocks);
   81|      0|   }
   82|      0|#endif
   83|       |
   84|      0|   uint32_t A = digest[0];
   85|      0|   uint32_t B = digest[1];
   86|      0|   uint32_t C = digest[2];
   87|      0|   uint32_t D = digest[3];
   88|      0|   uint32_t E = digest[4];
   89|      0|   uint32_t F = digest[5];
   90|      0|   uint32_t G = digest[6];
   91|      0|   uint32_t H = digest[7];
   92|       |
   93|      0|   std::array<uint32_t, 16> W{};
   94|       |
   95|      0|   BufferSlicer in(input);
   96|       |
   97|      0|   for(size_t i = 0; i != blocks; ++i) {
  ------------------
  |  Branch (97:22): [True: 0, False: 0]
  ------------------
   98|      0|      load_be(W, in.take<block_bytes>());
   99|       |
  100|       |      // clang-format off
  101|       |
  102|      0|      SHA2_32_F(A, B, C, D, E, F, G, H, W[ 0], W[14], W[ 9], W[ 1], 0x428A2F98);
  103|      0|      SHA2_32_F(H, A, B, C, D, E, F, G, W[ 1], W[15], W[10], W[ 2], 0x71374491);
  104|      0|      SHA2_32_F(G, H, A, B, C, D, E, F, W[ 2], W[ 0], W[11], W[ 3], 0xB5C0FBCF);
  105|      0|      SHA2_32_F(F, G, H, A, B, C, D, E, W[ 3], W[ 1], W[12], W[ 4], 0xE9B5DBA5);
  106|      0|      SHA2_32_F(E, F, G, H, A, B, C, D, W[ 4], W[ 2], W[13], W[ 5], 0x3956C25B);
  107|      0|      SHA2_32_F(D, E, F, G, H, A, B, C, W[ 5], W[ 3], W[14], W[ 6], 0x59F111F1);
  108|      0|      SHA2_32_F(C, D, E, F, G, H, A, B, W[ 6], W[ 4], W[15], W[ 7], 0x923F82A4);
  109|      0|      SHA2_32_F(B, C, D, E, F, G, H, A, W[ 7], W[ 5], W[ 0], W[ 8], 0xAB1C5ED5);
  110|      0|      SHA2_32_F(A, B, C, D, E, F, G, H, W[ 8], W[ 6], W[ 1], W[ 9], 0xD807AA98);
  111|      0|      SHA2_32_F(H, A, B, C, D, E, F, G, W[ 9], W[ 7], W[ 2], W[10], 0x12835B01);
  112|      0|      SHA2_32_F(G, H, A, B, C, D, E, F, W[10], W[ 8], W[ 3], W[11], 0x243185BE);
  113|      0|      SHA2_32_F(F, G, H, A, B, C, D, E, W[11], W[ 9], W[ 4], W[12], 0x550C7DC3);
  114|      0|      SHA2_32_F(E, F, G, H, A, B, C, D, W[12], W[10], W[ 5], W[13], 0x72BE5D74);
  115|      0|      SHA2_32_F(D, E, F, G, H, A, B, C, W[13], W[11], W[ 6], W[14], 0x80DEB1FE);
  116|      0|      SHA2_32_F(C, D, E, F, G, H, A, B, W[14], W[12], W[ 7], W[15], 0x9BDC06A7);
  117|      0|      SHA2_32_F(B, C, D, E, F, G, H, A, W[15], W[13], W[ 8], W[ 0], 0xC19BF174);
  118|       |
  119|      0|      SHA2_32_F(A, B, C, D, E, F, G, H, W[ 0], W[14], W[ 9], W[ 1], 0xE49B69C1);
  120|      0|      SHA2_32_F(H, A, B, C, D, E, F, G, W[ 1], W[15], W[10], W[ 2], 0xEFBE4786);
  121|      0|      SHA2_32_F(G, H, A, B, C, D, E, F, W[ 2], W[ 0], W[11], W[ 3], 0x0FC19DC6);
  122|      0|      SHA2_32_F(F, G, H, A, B, C, D, E, W[ 3], W[ 1], W[12], W[ 4], 0x240CA1CC);
  123|      0|      SHA2_32_F(E, F, G, H, A, B, C, D, W[ 4], W[ 2], W[13], W[ 5], 0x2DE92C6F);
  124|      0|      SHA2_32_F(D, E, F, G, H, A, B, C, W[ 5], W[ 3], W[14], W[ 6], 0x4A7484AA);
  125|      0|      SHA2_32_F(C, D, E, F, G, H, A, B, W[ 6], W[ 4], W[15], W[ 7], 0x5CB0A9DC);
  126|      0|      SHA2_32_F(B, C, D, E, F, G, H, A, W[ 7], W[ 5], W[ 0], W[ 8], 0x76F988DA);
  127|      0|      SHA2_32_F(A, B, C, D, E, F, G, H, W[ 8], W[ 6], W[ 1], W[ 9], 0x983E5152);
  128|      0|      SHA2_32_F(H, A, B, C, D, E, F, G, W[ 9], W[ 7], W[ 2], W[10], 0xA831C66D);
  129|      0|      SHA2_32_F(G, H, A, B, C, D, E, F, W[10], W[ 8], W[ 3], W[11], 0xB00327C8);
  130|      0|      SHA2_32_F(F, G, H, A, B, C, D, E, W[11], W[ 9], W[ 4], W[12], 0xBF597FC7);
  131|      0|      SHA2_32_F(E, F, G, H, A, B, C, D, W[12], W[10], W[ 5], W[13], 0xC6E00BF3);
  132|      0|      SHA2_32_F(D, E, F, G, H, A, B, C, W[13], W[11], W[ 6], W[14], 0xD5A79147);
  133|      0|      SHA2_32_F(C, D, E, F, G, H, A, B, W[14], W[12], W[ 7], W[15], 0x06CA6351);
  134|      0|      SHA2_32_F(B, C, D, E, F, G, H, A, W[15], W[13], W[ 8], W[ 0], 0x14292967);
  135|       |
  136|      0|      SHA2_32_F(A, B, C, D, E, F, G, H, W[ 0], W[14], W[ 9], W[ 1], 0x27B70A85);
  137|      0|      SHA2_32_F(H, A, B, C, D, E, F, G, W[ 1], W[15], W[10], W[ 2], 0x2E1B2138);
  138|      0|      SHA2_32_F(G, H, A, B, C, D, E, F, W[ 2], W[ 0], W[11], W[ 3], 0x4D2C6DFC);
  139|      0|      SHA2_32_F(F, G, H, A, B, C, D, E, W[ 3], W[ 1], W[12], W[ 4], 0x53380D13);
  140|      0|      SHA2_32_F(E, F, G, H, A, B, C, D, W[ 4], W[ 2], W[13], W[ 5], 0x650A7354);
  141|      0|      SHA2_32_F(D, E, F, G, H, A, B, C, W[ 5], W[ 3], W[14], W[ 6], 0x766A0ABB);
  142|      0|      SHA2_32_F(C, D, E, F, G, H, A, B, W[ 6], W[ 4], W[15], W[ 7], 0x81C2C92E);
  143|      0|      SHA2_32_F(B, C, D, E, F, G, H, A, W[ 7], W[ 5], W[ 0], W[ 8], 0x92722C85);
  144|      0|      SHA2_32_F(A, B, C, D, E, F, G, H, W[ 8], W[ 6], W[ 1], W[ 9], 0xA2BFE8A1);
  145|      0|      SHA2_32_F(H, A, B, C, D, E, F, G, W[ 9], W[ 7], W[ 2], W[10], 0xA81A664B);
  146|      0|      SHA2_32_F(G, H, A, B, C, D, E, F, W[10], W[ 8], W[ 3], W[11], 0xC24B8B70);
  147|      0|      SHA2_32_F(F, G, H, A, B, C, D, E, W[11], W[ 9], W[ 4], W[12], 0xC76C51A3);
  148|      0|      SHA2_32_F(E, F, G, H, A, B, C, D, W[12], W[10], W[ 5], W[13], 0xD192E819);
  149|      0|      SHA2_32_F(D, E, F, G, H, A, B, C, W[13], W[11], W[ 6], W[14], 0xD6990624);
  150|      0|      SHA2_32_F(C, D, E, F, G, H, A, B, W[14], W[12], W[ 7], W[15], 0xF40E3585);
  151|      0|      SHA2_32_F(B, C, D, E, F, G, H, A, W[15], W[13], W[ 8], W[ 0], 0x106AA070);
  152|       |
  153|      0|      SHA2_32_F(A, B, C, D, E, F, G, H, W[ 0], W[14], W[ 9], W[ 1], 0x19A4C116);
  154|      0|      SHA2_32_F(H, A, B, C, D, E, F, G, W[ 1], W[15], W[10], W[ 2], 0x1E376C08);
  155|      0|      SHA2_32_F(G, H, A, B, C, D, E, F, W[ 2], W[ 0], W[11], W[ 3], 0x2748774C);
  156|      0|      SHA2_32_F(F, G, H, A, B, C, D, E, W[ 3], W[ 1], W[12], W[ 4], 0x34B0BCB5);
  157|      0|      SHA2_32_F(E, F, G, H, A, B, C, D, W[ 4], W[ 2], W[13], W[ 5], 0x391C0CB3);
  158|      0|      SHA2_32_F(D, E, F, G, H, A, B, C, W[ 5], W[ 3], W[14], W[ 6], 0x4ED8AA4A);
  159|      0|      SHA2_32_F(C, D, E, F, G, H, A, B, W[ 6], W[ 4], W[15], W[ 7], 0x5B9CCA4F);
  160|      0|      SHA2_32_F(B, C, D, E, F, G, H, A, W[ 7], W[ 5], W[ 0], W[ 8], 0x682E6FF3);
  161|      0|      SHA2_32_F(A, B, C, D, E, F, G, H, W[ 8], W[ 6], W[ 1], W[ 9], 0x748F82EE);
  162|      0|      SHA2_32_F(H, A, B, C, D, E, F, G, W[ 9], W[ 7], W[ 2], W[10], 0x78A5636F);
  163|      0|      SHA2_32_F(G, H, A, B, C, D, E, F, W[10], W[ 8], W[ 3], W[11], 0x84C87814);
  164|      0|      SHA2_32_F(F, G, H, A, B, C, D, E, W[11], W[ 9], W[ 4], W[12], 0x8CC70208);
  165|      0|      SHA2_32_F(E, F, G, H, A, B, C, D, W[12], W[10], W[ 5], W[13], 0x90BEFFFA);
  166|      0|      SHA2_32_F(D, E, F, G, H, A, B, C, W[13], W[11], W[ 6], W[14], 0xA4506CEB);
  167|      0|      SHA2_32_F(C, D, E, F, G, H, A, B, W[14], W[12], W[ 7], W[15], 0xBEF9A3F7);
  168|      0|      SHA2_32_F(B, C, D, E, F, G, H, A, W[15], W[13], W[ 8], W[ 0], 0xC67178F2);
  169|       |
  170|       |      // clang-format on
  171|       |
  172|      0|      A = (digest[0] += A);
  173|      0|      B = (digest[1] += B);
  174|      0|      C = (digest[2] += C);
  175|      0|      D = (digest[3] += D);
  176|      0|      E = (digest[4] += E);
  177|      0|      F = (digest[5] += F);
  178|      0|      G = (digest[6] += G);
  179|      0|      H = (digest[7] += H);
  180|      0|   }
  181|      0|}
_ZN5Botan7SHA_25610compress_nERNSt3__16vectorIjNS_16secure_allocatorIjEEEENS1_4spanIKhLm18446744073709551615EEEm:
  215|     10|void SHA_256::compress_n(digest_type& digest, std::span<const uint8_t> input, size_t blocks) {
  216|     10|   SHA_256::compress_digest(digest, input, blocks);
  217|     10|}
_ZN5Botan7SHA_2564initERNSt3__16vectorIjNS_16secure_allocatorIjEEEE:
  219|      7|void SHA_256::init(digest_type& digest) {
  220|      7|   digest.assign({0x6A09E667, 0xBB67AE85, 0x3C6EF372, 0xA54FF53A, 0x510E527F, 0x9B05688C, 0x1F83D9AB, 0x5BE0CD19});
  221|      7|}
_ZN5Botan7SHA_2568add_dataENSt3__14spanIKhLm18446744073709551615EEE:
  231|      9|void SHA_256::add_data(std::span<const uint8_t> input) {
  232|      9|   m_md.update(input);
  233|      9|}
_ZN5Botan7SHA_25612final_resultENSt3__14spanIhLm18446744073709551615EEE:
  235|      4|void SHA_256::final_result(std::span<uint8_t> output) {
  236|      4|   m_md.final(output);
  237|      4|}

_ZN5Botan7SHA_25619compress_digest_x86ERNSt3__16vectorIjNS_16secure_allocatorIjEEEENS1_4spanIKhLm18446744073709551615EEEm:
   58|     10|                                                                                    size_t blocks) {
   59|     10|   alignas(64) static const uint32_t K[] = {
   60|     10|      0x428A2F98, 0x71374491, 0xB5C0FBCF, 0xE9B5DBA5, 0x3956C25B, 0x59F111F1, 0x923F82A4, 0xAB1C5ED5,
   61|     10|      0xD807AA98, 0x12835B01, 0x243185BE, 0x550C7DC3, 0x72BE5D74, 0x80DEB1FE, 0x9BDC06A7, 0xC19BF174,
   62|     10|      0xE49B69C1, 0xEFBE4786, 0x0FC19DC6, 0x240CA1CC, 0x2DE92C6F, 0x4A7484AA, 0x5CB0A9DC, 0x76F988DA,
   63|     10|      0x983E5152, 0xA831C66D, 0xB00327C8, 0xBF597FC7, 0xC6E00BF3, 0xD5A79147, 0x06CA6351, 0x14292967,
   64|     10|      0x27B70A85, 0x2E1B2138, 0x4D2C6DFC, 0x53380D13, 0x650A7354, 0x766A0ABB, 0x81C2C92E, 0x92722C85,
   65|     10|      0xA2BFE8A1, 0xA81A664B, 0xC24B8B70, 0xC76C51A3, 0xD192E819, 0xD6990624, 0xF40E3585, 0x106AA070,
   66|     10|      0x19A4C116, 0x1E376C08, 0x2748774C, 0x34B0BCB5, 0x391C0CB3, 0x4ED8AA4A, 0x5B9CCA4F, 0x682E6FF3,
   67|     10|      0x748F82EE, 0x78A5636F, 0x84C87814, 0x8CC70208, 0x90BEFFFA, 0xA4506CEB, 0xBEF9A3F7, 0xC67178F2,
   68|     10|   };
   69|       |
   70|     10|   const uint8_t* input = input_span.data();
   71|       |
   72|     10|   SIMD_4x32 S0 = SIMD_4x32::load_le(&digest[0]);  // NOLINT(*container-data-pointer)
   73|     10|   SIMD_4x32 S1 = SIMD_4x32::load_le(&digest[4]);
   74|       |
   75|     10|   sha256_permute_state(S0, S1);
   76|       |
   77|     20|   while(blocks > 0) {
  ------------------
  |  Branch (77:10): [True: 10, False: 10]
  ------------------
   78|     10|      const auto S0_SAVE = S0;
   79|     10|      const auto S1_SAVE = S1;
   80|       |
   81|     10|      auto W0 = SIMD_4x32::load_be(input);
   82|     10|      auto W1 = SIMD_4x32::load_be(input + 16);
   83|     10|      auto W2 = SIMD_4x32::load_be(input + 32);
   84|     10|      auto W3 = SIMD_4x32::load_be(input + 48);
   85|       |
   86|     10|      sha256_rnds4(S0, S1, W0, SIMD_4x32::load_le(&K[0]));
   87|     10|      sha256_rnds4(S0, S1, W1, SIMD_4x32::load_le(&K[4]));
   88|     10|      sha256_rnds4(S0, S1, W2, SIMD_4x32::load_le(&K[8]));
   89|     10|      sha256_rnds4(S0, S1, W3, SIMD_4x32::load_le(&K[12]));
   90|       |
   91|     10|      W0 = SIMD_4x32(_mm_sha256msg1_epu32(W0.raw(), W1.raw()));
   92|     10|      W1 = SIMD_4x32(_mm_sha256msg1_epu32(W1.raw(), W2.raw()));
   93|       |
   94|     10|      sha256_msg_exp(W2, W3, W0, W1);
   95|       |
   96|     10|      sha256_rnds4(S0, S1, W0, SIMD_4x32::load_le(&K[4 * 4]));
   97|     10|      sha256_rnds4(S0, S1, W1, SIMD_4x32::load_le(&K[4 * 5]));
   98|       |
   99|     10|      sha256_msg_exp(W0, W1, W2, W3);
  100|       |
  101|     10|      sha256_rnds4(S0, S1, W2, SIMD_4x32::load_le(&K[4 * 6]));
  102|     10|      sha256_rnds4(S0, S1, W3, SIMD_4x32::load_le(&K[4 * 7]));
  103|       |
  104|     10|      sha256_msg_exp(W2, W3, W0, W1);
  105|       |
  106|     10|      sha256_rnds4(S0, S1, W0, SIMD_4x32::load_le(&K[4 * 8]));
  107|     10|      sha256_rnds4(S0, S1, W1, SIMD_4x32::load_le(&K[4 * 9]));
  108|       |
  109|     10|      sha256_msg_exp(W0, W1, W2, W3);
  110|       |
  111|     10|      sha256_rnds4(S0, S1, W2, SIMD_4x32::load_le(&K[4 * 10]));
  112|     10|      sha256_rnds4(S0, S1, W3, SIMD_4x32::load_le(&K[4 * 11]));
  113|       |
  114|     10|      sha256_msg_exp(W2, W3, W0, W1);
  115|       |
  116|     10|      sha256_rnds4(S0, S1, W0, SIMD_4x32::load_le(&K[4 * 12]));
  117|     10|      sha256_rnds4(S0, S1, W1, SIMD_4x32::load_le(&K[4 * 13]));
  118|       |
  119|     10|      sha256_msg_exp(W0, W1, W2, W3);
  120|       |
  121|     10|      sha256_rnds4(S0, S1, W2, SIMD_4x32::load_le(&K[4 * 14]));
  122|     10|      sha256_rnds4(S0, S1, W3, SIMD_4x32::load_le(&K[4 * 15]));
  123|       |
  124|       |      // Add values back to state
  125|     10|      S0 += S0_SAVE;
  126|     10|      S1 += S1_SAVE;
  127|       |
  128|     10|      input += 64;
  129|     10|      blocks--;
  130|     10|   }
  131|       |
  132|     10|   sha256_permute_state(S1, S0);
  133|       |
  134|     10|   S0.store_le(&digest[0]);  // NOLINT(*container-data-pointer)
  135|     10|   S1.store_le(&digest[4]);
  136|     10|}
sha2_32_x86.cpp:_ZN5Botan12_GLOBAL__N_120sha256_permute_stateERNS_9SIMD_4x32ES2_:
   43|     20|BOTAN_FORCE_INLINE BOTAN_FN_ISA_SHANI void sha256_permute_state(SIMD_4x32& S0, SIMD_4x32& S1) {
   44|     20|   S0 = SIMD_4x32(_mm_shuffle_epi32(S0.raw(), 0b10110001));  // CDAB
   45|     20|   S1 = SIMD_4x32(_mm_shuffle_epi32(S1.raw(), 0b00011011));  // EFGH
   46|       |
   47|     20|   const auto T = SIMD_4x32::alignr8(S0, S1);                  // ABEF
   48|       |   S1 = SIMD_4x32(_mm_blend_epi16(S1.raw(), S0.raw(), 0xF0));  // CDGH
   49|     20|   S0 = T;
   50|     20|}
sha2_32_x86.cpp:_ZN5Botan12_GLOBAL__N_112sha256_rnds4ERNS_9SIMD_4x32ES2_RKS1_S4_:
   27|    160|                                                        const SIMD_4x32& k) {
   28|    160|   const auto mk = msg + k;
   29|    160|   S1 = SIMD_4x32(_mm_sha256rnds2_epu32(S1.raw(), S0.raw(), mk.raw()));
   30|    160|   S0 = SIMD_4x32(_mm_sha256rnds2_epu32(S0.raw(), S1.raw(), mk.shift_elems_right<2>().raw()));
   31|    160|}
sha2_32_x86.cpp:_ZN5Botan12_GLOBAL__N_114sha256_msg_expERNS_9SIMD_4x32ES2_S2_S2_:
   33|     60|BOTAN_FORCE_INLINE BOTAN_FN_ISA_SHANI void sha256_msg_exp(SIMD_4x32& W0, SIMD_4x32& W1, SIMD_4x32& W2, SIMD_4x32& W3) {
   34|     60|   W2 += SIMD_4x32::alignr4(W1, W0);
   35|     60|   W0 = SIMD_4x32(_mm_sha256msg1_epu32(W0.raw(), W1.raw()));
   36|     60|   W2 = SIMD_4x32(_mm_sha256msg2_epu32(W2.raw(), W1.raw()));
   37|       |
   38|     60|   W3 += SIMD_4x32::alignr4(W2, W1);
   39|     60|   W1 = SIMD_4x32(_mm_sha256msg1_epu32(W1.raw(), W2.raw()));
   40|     60|   W3 = SIMD_4x32(_mm_sha256msg2_epu32(W3.raw(), W2.raw()));
   41|     60|}

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

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

_ZN5Botan6BigIntpLERKS0_:
   16|      7|BigInt& BigInt::operator+=(const BigInt& y) {
   17|      7|   if(&y == this) {
  ------------------
  |  Branch (17:7): [True: 0, False: 7]
  ------------------
   18|      0|      return *this <<= 1;
   19|      0|   }
   20|      7|   return add(y._data(), y.sig_words(), y.sign());
   21|      7|}
_ZN5Botan6BigIntmIERKS0_:
   23|  18.2k|BigInt& BigInt::operator-=(const BigInt& y) {
   24|  18.2k|   if(&y == this) {
  ------------------
  |  Branch (24:7): [True: 0, False: 18.2k]
  ------------------
   25|      0|      this->clear();
   26|      0|      this->set_sign(Positive);
   27|      0|      return *this;
   28|      0|   }
   29|  18.2k|   return sub(y._data(), y.sig_words(), y.sign());
   30|  18.2k|}
_ZN5Botan6BigInt3addEPKmmNS0_4SignE:
   32|  19.1k|BigInt& BigInt::add(const word y[], size_t y_words, Sign y_sign) {
   33|  19.1k|   const size_t x_sw = sig_words();
   34|       |
   35|  19.1k|   grow_to(std::max(x_sw, y_words) + 1);
   36|       |
   37|  19.1k|   if(sign() == y_sign) {
  ------------------
  |  Branch (37:7): [True: 101, False: 19.0k]
  ------------------
   38|    101|      const word carry = bigint_add2(mutable_data(), size() - 1, y, y_words);
   39|    101|      mutable_data()[size() - 1] += carry;
   40|  19.0k|   } else {
   41|  19.0k|      const int32_t relative_size = bigint_cmp(_data(), x_sw, y, y_words);
   42|       |
   43|  19.0k|      if(relative_size >= 0) {
  ------------------
  |  Branch (43:10): [True: 19.0k, False: 16]
  ------------------
   44|       |         // *this >= y
   45|  19.0k|         bigint_sub2(mutable_data(), x_sw, y, y_words);
   46|  19.0k|      } else {
   47|       |         // *this < y: compute *this = y - *this
   48|     16|         bigint_sub2_rev(mutable_data(), y, y_words);
   49|     16|      }
   50|       |
   51|  19.0k|      if(relative_size < 0) {
  ------------------
  |  Branch (51:10): [True: 16, False: 19.0k]
  ------------------
   52|     16|         set_sign(y_sign);
   53|  19.0k|      } else if(relative_size == 0) {
  ------------------
  |  Branch (53:17): [True: 0, False: 19.0k]
  ------------------
   54|      0|         set_sign(Positive);
   55|      0|      }
   56|  19.0k|   }
   57|       |
   58|  19.1k|   return (*this);
   59|  19.1k|}
_ZN5Botan6BigIntrMERKS0_:
  232|  44.3k|BigInt& BigInt::operator%=(const BigInt& mod) {
  233|  44.3k|   return (*this = (*this) % mod);
  234|  44.3k|}
_ZN5Botan6BigIntlSEm:
  269|  29.1k|BigInt& BigInt::operator<<=(size_t shift) {
  270|  29.1k|   if(shift >= 65536) {
  ------------------
  |  Branch (270:7): [True: 0, False: 29.1k]
  ------------------
  271|      0|      throw Invalid_Argument("BigInt left shift count too large");
  272|      0|   }
  273|       |
  274|  29.1k|   const size_t sw = sig_words();
  275|  29.1k|   const size_t new_size = sw + (shift + WordInfo<word>::bits - 1) / WordInfo<word>::bits;
  276|       |
  277|  29.1k|   m_data.grow_to(new_size);
  278|       |
  279|  29.1k|   bigint_shl1(m_data.mutable_data(), new_size, sw, shift);
  280|       |
  281|  29.1k|   return (*this);
  282|  29.1k|}
_ZN5Botan6BigIntrSEm:
  287|  81.4k|BigInt& BigInt::operator>>=(size_t shift) {
  288|  81.4k|   bigint_shr1(m_data.mutable_data(), m_data.size(), shift);
  289|       |
  290|  81.4k|   if(sig_words() == 0 && m_signedness == Negative) {
  ------------------
  |  Branch (290:7): [True: 1, False: 81.4k]
  |  Branch (290:27): [True: 0, False: 1]
  ------------------
  291|      0|      m_signedness = Positive;
  292|      0|   }
  293|       |
  294|  81.4k|   return (*this);
  295|  81.4k|}

_ZN5Botan6BigInt4add2ERKS0_PKmmNS0_4SignE:
   20|  2.29k|BigInt BigInt::add2(const BigInt& x, const word y[], size_t y_size, BigInt::Sign y_sign) {
   21|  2.29k|   const size_t x_sw = x.sig_words();
   22|       |
   23|  2.29k|   BigInt z = BigInt::with_capacity(std::max(x_sw, y_size) + 1);
   24|       |
   25|  2.29k|   if(x.sign() == y_sign) {
  ------------------
  |  Branch (25:7): [True: 1.46k, False: 834]
  ------------------
   26|  1.46k|      const word carry = bigint_add3(z.mutable_data(), x._data(), x_sw, y, y_size);
   27|  1.46k|      z.mutable_data()[std::max(x_sw, y_size)] += carry;
   28|  1.46k|      z.set_sign(x.sign());
   29|  1.46k|   } else {
   30|    834|      const int32_t relative_size = bigint_cmp(x.data(), x_sw, y, y_size);
   31|       |
   32|    834|      if(relative_size < 0) {
  ------------------
  |  Branch (32:10): [True: 0, False: 834]
  ------------------
   33|       |         // x < y so z = abs(y - x)
   34|       |         // NOLINTNEXTLINE(*-suspicious-call-argument) intentionally swapping x and y here
   35|      0|         bigint_sub3(z.mutable_data(), y, y_size, x.data(), x_sw);
   36|      0|         z.set_sign(y_sign);
   37|    834|      } else if(relative_size == 0) {
  ------------------
  |  Branch (37:17): [True: 0, False: 834]
  ------------------
   38|       |         // Positive zero (nothing to do in this case)
   39|    834|      } else {
   40|       |         /*
   41|       |         * We know at this point that x >= y so if y_size is larger than
   42|       |         * x_sw, we are guaranteed they are just leading zeros which can
   43|       |         * be ignored
   44|       |         */
   45|    834|         y_size = std::min(x_sw, y_size);
   46|    834|         bigint_sub3(z.mutable_data(), x.data(), x_sw, y, y_size);
   47|    834|         z.set_sign(x.sign());
   48|    834|      }
   49|    834|   }
   50|       |
   51|  2.29k|   return z;
   52|  2.29k|}
_ZN5BotanmlERKNS_6BigIntEm:
   90|  17.5k|BigInt operator*(const BigInt& x, word y) {
   91|  17.5k|   const size_t x_sw = x.sig_words();
   92|       |
   93|  17.5k|   BigInt z = BigInt::with_capacity(x_sw + 1);
   94|       |
   95|  17.5k|   if(x_sw > 0 && y > 0) {
  ------------------
  |  Branch (95:7): [True: 17.5k, False: 0]
  |  Branch (95:19): [True: 17.5k, False: 0]
  ------------------
   96|  17.5k|      bigint_linmul3(z.mutable_data(), x._data(), x_sw, y);
   97|  17.5k|      z.set_sign(x.sign());
   98|  17.5k|   }
   99|       |
  100|  17.5k|   return z;
  101|  17.5k|}
_ZN5BotanrmERKNS_6BigIntES2_:
  134|  44.3k|BigInt operator%(const BigInt& n, const BigInt& mod) {
  135|  44.3k|   if(mod.is_zero()) {
  ------------------
  |  Branch (135:7): [True: 0, False: 44.3k]
  ------------------
  136|      0|      throw Invalid_Argument("BigInt::operator% divide by zero");
  137|      0|   }
  138|  44.3k|   if(mod.signum() < 0) {
  ------------------
  |  Branch (138:7): [True: 0, False: 44.3k]
  ------------------
  139|      0|      throw Invalid_Argument("BigInt::operator% modulus must be > 0");
  140|      0|   }
  141|  44.3k|   if(n.signum() >= 0 && mod.signum() >= 0 && n < mod) {
  ------------------
  |  Branch (141:7): [True: 44.3k, False: 2]
  |  Branch (141:26): [True: 44.3k, False: 0]
  |  Branch (141:47): [True: 0, False: 44.3k]
  ------------------
  142|      0|      return n;
  143|      0|   }
  144|       |
  145|  44.3k|   if(mod.sig_words() == 1) {
  ------------------
  |  Branch (145:7): [True: 29.5k, False: 14.7k]
  ------------------
  146|  29.5k|      return BigInt::from_word(n % mod.word_at(0));
  147|  29.5k|   }
  148|       |
  149|  14.7k|   BigInt q;
  150|  14.7k|   BigInt r;
  151|  14.7k|   vartime_divide(n, mod, q, r);
  152|  14.7k|   return r;
  153|  44.3k|}
_ZN5BotanrmERKNS_6BigIntEm:
  158|  53.0k|word operator%(const BigInt& n, word mod) {
  159|  53.0k|   if(mod == 0) {
  ------------------
  |  Branch (159:7): [True: 0, False: 53.0k]
  ------------------
  160|      0|      throw Invalid_Argument("BigInt::operator% divide by zero");
  161|      0|   }
  162|       |
  163|  53.0k|   if(mod == 1) {
  ------------------
  |  Branch (163:7): [True: 0, False: 53.0k]
  ------------------
  164|      0|      return 0;
  165|      0|   }
  166|       |
  167|  53.0k|   word remainder = 0;
  168|       |
  169|  53.0k|   if(n.signum() >= 0 && is_power_of_2(mod)) {
  ------------------
  |  Branch (169:7): [True: 53.0k, False: 0]
  |  Branch (169:26): [True: 23.4k, False: 29.5k]
  ------------------
  170|  23.4k|      remainder = (n.word_at(0) & (mod - 1));
  171|  29.5k|   } else {
  172|  29.5k|      const divide_precomp redc_mod(mod);
  173|  29.5k|      const size_t sw = n.sig_words();
  174|  63.3k|      for(size_t i = sw; i > 0; --i) {
  ------------------
  |  Branch (174:26): [True: 33.7k, False: 29.5k]
  ------------------
  175|  33.7k|         remainder = redc_mod.vartime_mod_2to1(remainder, n.word_at(i - 1));
  176|  33.7k|      }
  177|  29.5k|   }
  178|       |
  179|  53.0k|   if(remainder != 0 && n.sign() == BigInt::Negative) {
  ------------------
  |  Branch (179:7): [True: 53.0k, False: 0]
  |  Branch (179:25): [True: 0, False: 53.0k]
  ------------------
  180|      0|      return mod - remainder;
  181|      0|   }
  182|  53.0k|   return remainder;
  183|  53.0k|}
_ZN5BotanlsERKNS_6BigIntEm:
  188|  16.1k|BigInt operator<<(const BigInt& x, size_t shift) {
  189|  16.1k|   if(shift >= 65536) {
  ------------------
  |  Branch (189:7): [True: 0, False: 16.1k]
  ------------------
  190|      0|      throw Invalid_Argument("BigInt left shift count too large");
  191|      0|   }
  192|       |
  193|  16.1k|   if(x.is_zero()) {
  ------------------
  |  Branch (193:7): [True: 0, False: 16.1k]
  ------------------
  194|      0|      return BigInt::zero();
  195|      0|   }
  196|       |
  197|  16.1k|   const size_t x_sw = x.sig_words();
  198|       |
  199|  16.1k|   const size_t new_size = x_sw + shift / WordInfo<word>::bits + 1;
  200|  16.1k|   BigInt y = BigInt::with_capacity(new_size);
  201|  16.1k|   bigint_shl2(y.mutable_data(), new_size, x._data(), x_sw, shift);
  202|  16.1k|   y.set_sign(x.sign());
  203|  16.1k|   return y;
  204|  16.1k|}
_ZN5BotanrsERKNS_6BigIntEm:
  209|    789|BigInt operator>>(const BigInt& x, size_t shift) {
  210|    789|   const size_t shift_words = shift / WordInfo<word>::bits;
  211|    789|   const size_t x_sw = x.sig_words();
  212|       |
  213|    789|   if(shift_words >= x_sw) {
  ------------------
  |  Branch (213:7): [True: 0, False: 789]
  ------------------
  214|      0|      return BigInt::zero();
  215|      0|   }
  216|       |
  217|    789|   const size_t new_size = x_sw - shift_words;
  218|    789|   BigInt y = BigInt::with_capacity(new_size);
  219|    789|   bigint_shr2(y.mutable_data(), new_size, x._data(), x_sw, shift);
  220|       |
  221|    789|   if(x.signum() < 0 && y.is_zero()) {
  ------------------
  |  Branch (221:7): [True: 0, False: 789]
  |  Branch (221:25): [True: 0, False: 0]
  ------------------
  222|      0|      y.set_sign(BigInt::Positive);
  223|    789|   } else {
  224|    789|      y.set_sign(x.sign());
  225|    789|   }
  226|       |
  227|    789|   return y;
  228|    789|}

_ZN5Botan6BigInt9randomizeERNS_21RandomNumberGeneratorEmb:
   19|     53|void BigInt::randomize(RandomNumberGenerator& rng, size_t bitsize, bool set_high_bit) {
   20|     53|   set_sign(Positive);
   21|       |
   22|     53|   if(bitsize == 0) {
  ------------------
  |  Branch (22:7): [True: 0, False: 53]
  ------------------
   23|      0|      clear();
   24|     53|   } else {
   25|     53|      secure_vector<uint8_t> array = rng.random_vec(round_up(bitsize, 8) / 8);
   26|       |
   27|       |      // Always cut unwanted bits
   28|     53|      if(bitsize % 8 > 0) {
  ------------------
  |  Branch (28:10): [True: 0, False: 53]
  ------------------
   29|      0|         array[0] &= 0xFF >> (8 - (bitsize % 8));
   30|      0|      }
   31|       |
   32|       |      // Set the highest bit if wanted
   33|     53|      if(set_high_bit) {
  ------------------
  |  Branch (33:10): [True: 1, False: 52]
  ------------------
   34|      1|         array[0] |= 0x80 >> ((bitsize % 8) > 0 ? (8 - bitsize % 8) : 0);
  ------------------
  |  Branch (34:31): [True: 0, False: 1]
  ------------------
   35|      1|      }
   36|       |
   37|     53|      assign_from_bytes(array);
   38|     53|   }
   39|     53|}
_ZN5Botan6BigInt14random_integerERNS_21RandomNumberGeneratorERKS0_S4_:
   44|     86|BigInt BigInt::random_integer(RandomNumberGenerator& rng, const BigInt& min, const BigInt& max) {
   45|     86|   if(min.signum() < 0 || max.signum() < 0 || max <= min) {
  ------------------
  |  Branch (45:7): [True: 0, False: 86]
  |  Branch (45:27): [True: 0, False: 86]
  |  Branch (45:47): [True: 0, False: 86]
  ------------------
   46|      0|      throw Invalid_Argument("BigInt::random_integer invalid range");
   47|      0|   }
   48|       |
   49|       |   /*
   50|       |   If min is > 1 then we generate a random number `r` in [0,max-min)
   51|       |   and return min + r.
   52|       |
   53|       |   This same logic could also be reasonably chosen for min == 1, but
   54|       |   that breaks certain tests which expect stability of this function
   55|       |   when generating within [1,n)
   56|       |   */
   57|     86|   if(min > 1) {
  ------------------
  |  Branch (57:7): [True: 43, False: 43]
  ------------------
   58|     43|      const BigInt diff = max - min;
   59|       |      // This call is recursive, but will not recurse further
   60|     43|      return min + BigInt::random_integer(rng, BigInt::zero(), diff);
   61|     43|   }
   62|       |
   63|     43|   BOTAN_DEBUG_ASSERT(min <= 1);
  ------------------
  |  |  130|     43|      do { /* NOLINT(*-avoid-do-while) */ \
  |  |  131|     43|      } while(0)
  |  |  ------------------
  |  |  |  Branch (131:15): [Folded, False: 43]
  |  |  ------------------
  ------------------
   64|       |
   65|     43|   const size_t bits = max.bits();
   66|       |
   67|     52|   for(;;) {
   68|     52|      BigInt r;
   69|     52|      r.randomize(rng, bits, false);
   70|     52|      if(r >= min && r < max) {
  ------------------
  |  Branch (70:10): [True: 52, False: 0]
  |  Branch (70:22): [True: 43, False: 9]
  ------------------
   71|     43|         return r;
   72|     43|      }
   73|     52|   }
   74|     43|}

_ZN5Botan6BigIntC2Em:
   20|    628|BigInt::BigInt(uint64_t n) {
   21|    628|   if constexpr(sizeof(word) == 8) {
   22|    628|      m_data.set_word_at(0, static_cast<word>(n));
   23|       |   } else {
   24|       |      m_data.set_word_at(1, static_cast<word>(n >> 32));
   25|       |      m_data.set_word_at(0, static_cast<word>(n));
   26|       |   }
   27|    628|}
_ZN5Botan6BigInt8from_u64Em:
   30|    627|BigInt BigInt::from_u64(uint64_t n) {
   31|    627|   return BigInt(n);
   32|    627|}
_ZN5Botan6BigInt9from_wordEm:
   35|  31.5k|BigInt BigInt::from_word(word n) {
   36|  31.5k|   BigInt bn;
   37|  31.5k|   bn.set_word_at(0, n);
   38|  31.5k|   return bn;
   39|  31.5k|}
_ZN5Botan6BigInt8from_s32Ei:
   42|    625|BigInt BigInt::from_s32(int32_t n) {
   43|    625|   if(n >= 0) {
  ------------------
  |  Branch (43:7): [True: 0, False: 625]
  ------------------
   44|      0|      return BigInt::from_u64(static_cast<uint64_t>(n));
   45|    625|   } else {
   46|    625|      return -BigInt::from_u64(static_cast<uint64_t>(-static_cast<int64_t>(n)));
   47|    625|   }
   48|    625|}
_ZN5Botan6BigInt13with_capacityEm:
   51|  36.8k|BigInt BigInt::with_capacity(size_t size) {
   52|  36.8k|   BigInt bn;
   53|  36.8k|   bn.grow_to(size);
   54|  36.8k|   return bn;
   55|  36.8k|}
_ZN5Botan6BigInt10from_bytesENSt3__14spanIKhLm18446744073709551615EEE:
   83|  1.37k|BigInt BigInt::from_bytes(std::span<const uint8_t> input) {
   84|  1.37k|   BigInt r;
   85|  1.37k|   r.assign_from_bytes(input);
   86|  1.37k|   return r;
   87|  1.37k|}
_ZN5Botan6BigIntC2ERNS_21RandomNumberGeneratorEmb:
  114|      1|BigInt::BigInt(RandomNumberGenerator& rng, size_t bits, bool set_high_bit) {
  115|      1|   randomize(rng, bits, set_high_bit);
  116|      1|}
_ZNK5Botan6BigInt8cmp_wordEm:
  122|   116k|int32_t BigInt::cmp_word(word other) const {
  123|   116k|   if(signum() < 0) {
  ------------------
  |  Branch (123:7): [True: 629, False: 115k]
  ------------------
  124|    629|      return -1;  // other is positive ...
  125|    629|   }
  126|       |
  127|   115k|   const size_t sw = this->sig_words();
  128|   115k|   if(sw > 1) {
  ------------------
  |  Branch (128:7): [True: 44.8k, False: 70.5k]
  ------------------
  129|  44.8k|      return 1;  // must be larger since other is just one word ...
  130|  44.8k|   }
  131|       |
  132|  70.5k|   return bigint_cmp(this->_data(), sw, &other, 1);
  133|   115k|}
_ZNK5Botan6BigInt3cmpERKS0_b:
  138|  2.82k|int32_t BigInt::cmp(const BigInt& other, bool check_signs) const {
  139|  2.82k|   if(check_signs) {
  ------------------
  |  Branch (139:7): [True: 2.82k, False: 0]
  ------------------
  140|  2.82k|      if(other.signum() >= 0 && this->signum() < 0) {
  ------------------
  |  Branch (140:10): [True: 2.82k, False: 0]
  |  Branch (140:33): [True: 0, False: 2.82k]
  ------------------
  141|      0|         return -1;
  142|      0|      }
  143|       |
  144|  2.82k|      if(other.signum() < 0 && this->signum() >= 0) {
  ------------------
  |  Branch (144:10): [True: 0, False: 2.82k]
  |  Branch (144:32): [True: 0, False: 0]
  ------------------
  145|      0|         return 1;
  146|      0|      }
  147|       |
  148|  2.82k|      if(other.signum() < 0 && this->signum() < 0) {
  ------------------
  |  Branch (148:10): [True: 0, False: 2.82k]
  |  Branch (148:32): [True: 0, False: 0]
  ------------------
  149|      0|         return (-bigint_cmp(this->_data(), this->size(), other._data(), other.size()));
  150|      0|      }
  151|  2.82k|   }
  152|       |
  153|  2.82k|   return bigint_cmp(this->_data(), this->size(), other._data(), other.size());
  154|  2.82k|}
_ZNK5Botan6BigInt8is_equalERKS0_:
  156|    876|bool BigInt::is_equal(const BigInt& other) const {
  157|    876|   if(this->sign() != other.sign()) {
  ------------------
  |  Branch (157:7): [True: 0, False: 876]
  ------------------
  158|      0|      return false;
  159|      0|   }
  160|       |
  161|    876|   return bigint_ct_is_eq(this->_data(), this->size(), other._data(), other.size()).as_bool();
  162|    876|}
_ZNK5Botan6BigInt12is_less_thanERKS0_:
  164|  53.5k|bool BigInt::is_less_than(const BigInt& other) const {
  165|  53.5k|   if(this->signum() < 0 && other.signum() >= 0) {
  ------------------
  |  Branch (165:7): [True: 0, False: 53.5k]
  |  Branch (165:29): [True: 0, False: 0]
  ------------------
  166|      0|      return true;
  167|      0|   }
  168|       |
  169|  53.5k|   if(this->signum() >= 0 && other.signum() < 0) {
  ------------------
  |  Branch (169:7): [True: 53.5k, False: 0]
  |  Branch (169:30): [True: 0, False: 53.5k]
  ------------------
  170|      0|      return false;
  171|      0|   }
  172|       |
  173|  53.5k|   if(other.signum() < 0 && this->signum() < 0) {
  ------------------
  |  Branch (173:7): [True: 0, False: 53.5k]
  |  Branch (173:29): [True: 0, False: 0]
  ------------------
  174|      0|      return bigint_ct_is_lt(other._data(), other.size(), this->_data(), this->size()).as_bool();
  175|      0|   }
  176|       |
  177|  53.5k|   return bigint_ct_is_lt(this->_data(), this->size(), other._data(), other.size()).as_bool();
  178|  53.5k|}
_ZN5Botan6BigInt4Data11set_to_zeroEv:
  191|  1.42k|void BigInt::Data::set_to_zero() {
  192|  1.42k|   m_reg.resize(m_reg.capacity());
  193|  1.42k|   clear_mem(m_reg.data(), m_reg.size());
  194|  1.42k|   m_sig_words = 0;
  195|  1.42k|}
_ZNK5Botan6BigInt4Data14calc_sig_wordsEv:
  215|   217k|size_t BigInt::Data::calc_sig_words() const {
  216|   217k|   const size_t sz = m_reg.size();
  217|   217k|   size_t sig = sz;
  218|       |
  219|   217k|   word sub = 1;
  220|       |
  221|  2.05M|   for(size_t i = 0; i != sz; ++i) {
  ------------------
  |  Branch (221:22): [True: 1.83M, False: 217k]
  ------------------
  222|  1.83M|      const word w = m_reg[sz - i - 1];
  223|  1.83M|      sub &= ct_is_zero(w);
  224|  1.83M|      sig -= sub;
  225|  1.83M|   }
  226|       |
  227|       |   /*
  228|       |   * This depends on the data so is poisoned, but unpoison it here as
  229|       |   * later conditionals are made on the size.
  230|       |   */
  231|   217k|   CT::unpoison(sig);
  232|       |
  233|   217k|   return sig;
  234|   217k|}
_ZNK5Botan6BigInt13get_substringEmm:
  239|  92.2k|uint32_t BigInt::get_substring(size_t offset, size_t length) const {
  240|  92.2k|   if(length == 0 || length > 32) {
  ------------------
  |  Branch (240:7): [True: 0, False: 92.2k]
  |  Branch (240:22): [True: 0, False: 92.2k]
  ------------------
  241|      0|      throw Invalid_Argument("BigInt::get_substring invalid substring length");
  242|      0|   }
  243|       |
  244|  92.2k|   const uint32_t mask = 0xFFFFFFFF >> (32 - length);
  245|       |
  246|  92.2k|   const size_t word_offset = offset / WordInfo<word>::bits;
  247|  92.2k|   const size_t wshift = (offset % WordInfo<word>::bits);
  248|       |
  249|       |   /*
  250|       |   * The substring is contained within one or at most two words. The
  251|       |   * offset and length are not secret, so we can perform conditional
  252|       |   * operations on those values.
  253|       |   */
  254|  92.2k|   const word w0 = word_at(word_offset);
  255|       |
  256|  92.2k|   if(wshift == 0 || (offset + length) / WordInfo<word>::bits == word_offset) {
  ------------------
  |  Branch (256:7): [True: 6.92k, False: 85.2k]
  |  Branch (256:22): [True: 80.9k, False: 4.37k]
  ------------------
  257|  87.8k|      return static_cast<uint32_t>(w0 >> wshift) & mask;
  258|  87.8k|   } else {
  259|  4.37k|      const word w1 = word_at(word_offset + 1);
  260|  4.37k|      return static_cast<uint32_t>((w0 >> wshift) | (w1 << (WordInfo<word>::bits - wshift))) & mask;
  261|  4.37k|   }
  262|  92.2k|}
_ZNK5Botan6BigInt13top_bits_freeEv:
  298|  19.1k|size_t BigInt::top_bits_free() const {
  299|  19.1k|   const size_t words = sig_words();
  300|       |
  301|  19.1k|   const word top_word = word_at(words - 1);
  302|  19.1k|   const size_t bits_used = high_bit(CT::value_barrier(top_word));
  303|  19.1k|   CT::unpoison(bits_used);
  304|  19.1k|   return WordInfo<word>::bits - bits_used;
  305|  19.1k|}
_ZNK5Botan6BigInt4bitsEv:
  307|  3.68k|size_t BigInt::bits() const {
  308|  3.68k|   const size_t words = sig_words();
  309|       |
  310|  3.68k|   if(words == 0) {
  ------------------
  |  Branch (310:7): [True: 1, False: 3.68k]
  ------------------
  311|      1|      return 0;
  312|      1|   }
  313|       |
  314|  3.68k|   const size_t full_words = (words - 1) * WordInfo<word>::bits;
  315|  3.68k|   const size_t top_bits = WordInfo<word>::bits - top_bits_free();
  316|       |
  317|  3.68k|   return full_words + top_bits;
  318|  3.68k|}
_ZNK5Botan6BigIntngEv:
  323|    625|BigInt BigInt::operator-() const {
  324|    625|   BigInt x = (*this);
  325|    625|   x.flip_sign();
  326|    625|   return x;
  327|    625|}
_ZN5Botan6BigInt12reduce_belowERKS0_RNSt3__16vectorImNS_16secure_allocatorImEEEE:
  329|  15.5k|size_t BigInt::reduce_below(const BigInt& p, secure_vector<word>& ws) {
  330|  15.5k|   if(p.signum() < 0 || this->signum() < 0) {
  ------------------
  |  Branch (330:7): [True: 0, False: 15.5k]
  |  Branch (330:25): [True: 0, False: 15.5k]
  ------------------
  331|      0|      throw Invalid_Argument("BigInt::reduce_below both values must be positive");
  332|      0|   }
  333|       |
  334|  15.5k|   const size_t p_words = p.sig_words();
  335|       |
  336|  15.5k|   if(size() < p_words + 1) {
  ------------------
  |  Branch (336:7): [True: 1.20k, False: 14.3k]
  ------------------
  337|  1.20k|      grow_to(p_words + 1);
  338|  1.20k|   }
  339|       |
  340|  15.5k|   if(ws.size() < p_words + 1) {
  ------------------
  |  Branch (340:7): [True: 15.5k, False: 0]
  ------------------
  341|  15.5k|      ws.resize(p_words + 1);
  342|  15.5k|   }
  343|       |
  344|  15.5k|   clear_mem(ws.data(), ws.size());
  345|       |
  346|  15.5k|   size_t reductions = 0;
  347|       |
  348|  17.3k|   for(;;) {
  349|  17.3k|      const word borrow = bigint_sub3(ws.data(), _data(), p_words + 1, p._data(), p_words);
  350|  17.3k|      if(borrow > 0) {
  ------------------
  |  Branch (350:10): [True: 15.5k, False: 1.82k]
  ------------------
  351|  15.5k|         break;
  352|  15.5k|      }
  353|       |
  354|  1.82k|      ++reductions;
  355|  1.82k|      swap_reg(ws);
  356|  1.82k|   }
  357|       |
  358|  15.5k|   return reductions;
  359|  15.5k|}
_ZNK5Botan6BigInt3absEv:
  386|      2|BigInt BigInt::abs() const {
  387|      2|   BigInt x = (*this);
  388|      2|   x.set_sign(Positive);
  389|      2|   return x;
  390|      2|}
_ZN5Botan6BigInt17assign_from_bytesENSt3__14spanIKhLm18446744073709551615EEE:
  425|  1.42k|void BigInt::assign_from_bytes(std::span<const uint8_t> bytes) {
  426|  1.42k|   clear();
  427|       |
  428|  1.42k|   const size_t length = bytes.size();
  429|  1.42k|   const size_t full_words = length / sizeof(word);
  430|  1.42k|   const size_t extra_bytes = length % sizeof(word);
  431|       |
  432|  1.42k|   secure_vector<word> reg((round_up(full_words + (extra_bytes > 0 ? 1 : 0), 8)));
  ------------------
  |  Branch (432:52): [True: 1.04k, False: 383]
  ------------------
  433|       |
  434|  3.09k|   for(size_t i = 0; i != full_words; ++i) {
  ------------------
  |  Branch (434:22): [True: 1.67k, False: 1.42k]
  ------------------
  435|  1.67k|      reg[i] = load_be<word>(bytes.last<sizeof(word)>());
  436|  1.67k|      bytes = bytes.first(bytes.size() - sizeof(word));
  437|  1.67k|   }
  438|       |
  439|  1.42k|   if(!bytes.empty()) {
  ------------------
  |  Branch (439:7): [True: 1.04k, False: 383]
  ------------------
  440|  1.04k|      BOTAN_ASSERT_NOMSG(extra_bytes == bytes.size());
  ------------------
  |  |   77|  1.04k|   do {                                                                     \
  |  |   78|  1.04k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   79|  1.04k|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (79:10): [True: 0, False: 1.04k]
  |  |  ------------------
  |  |   80|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   81|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   82|      0|      }                                                                     \
  |  |   83|  1.04k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (83:12): [Folded, False: 1.04k]
  |  |  ------------------
  ------------------
  441|  1.04k|      std::array<uint8_t, sizeof(word)> last_partial_word = {0};
  442|  1.04k|      copy_mem(std::span{last_partial_word}.last(extra_bytes), bytes);
  443|  1.04k|      reg[full_words] = load_be<word>(last_partial_word);
  444|  1.04k|   }
  445|       |
  446|  1.42k|   m_data.swap(reg);
  447|  1.42k|}
_ZN5Botan6BigInt11ct_cond_addEbRKS0_:
  449|    765|void BigInt::ct_cond_add(bool predicate, const BigInt& value) {
  450|    765|   if(this->signum() < 0 || value.signum() < 0) {
  ------------------
  |  Branch (450:7): [True: 0, False: 765]
  |  Branch (450:29): [True: 0, False: 765]
  ------------------
  451|      0|      throw Invalid_Argument("BigInt::ct_cond_add requires both values to be positive");
  452|      0|   }
  453|    765|   const size_t v_words = value.sig_words();
  454|       |
  455|       |   // The carry can propagate through every existing word of *this, so the
  456|       |   // output needs one slot above whichever input is wider.
  457|    765|   this->grow_to(std::max(this->size(), v_words) + 1);
  458|       |
  459|    765|   const auto mask = CT::Mask<word>::expand(static_cast<word>(predicate)).value();
  460|       |
  461|    765|   word carry = 0;
  462|       |
  463|    765|   word* x = this->mutable_data();
  464|    765|   const word* y = value._data();
  465|       |
  466|  3.82k|   for(size_t i = 0; i != v_words; ++i) {
  ------------------
  |  Branch (466:22): [True: 3.06k, False: 765]
  ------------------
  467|  3.06k|      x[i] = word_add(x[i], y[i] & mask, &carry);
  468|  3.06k|   }
  469|       |
  470|  9.94k|   for(size_t i = v_words; i != size(); ++i) {
  ------------------
  |  Branch (470:28): [True: 9.18k, False: 765]
  ------------------
  471|  9.18k|      x[i] = word_add(x[i], static_cast<word>(0), &carry);
  472|  9.18k|   }
  473|    765|}
_ZN5Botan6BigInt14cond_flip_signEb:
  521|  15.2k|void BigInt::cond_flip_sign(bool predicate) {
  522|       |   // This code is assuming Negative == 0, Positive == 1
  523|       |
  524|  15.2k|   const auto mask = CT::Mask<uint8_t>::expand_bool(predicate);
  525|       |
  526|  15.2k|   const uint8_t current_sign = static_cast<uint8_t>(sign());
  527|       |
  528|  15.2k|   const uint8_t new_sign = mask.select(current_sign ^ 1, current_sign);
  529|       |
  530|  15.2k|   set_sign(static_cast<Sign>(new_sign));
  531|  15.2k|}
_ZN5Botan6BigInt14ct_cond_assignEbRKS0_:
  533|    510|void BigInt::ct_cond_assign(bool predicate, const BigInt& other) {
  534|    510|   const size_t t_words = size();
  535|    510|   const size_t o_words = other.size();
  536|       |
  537|    510|   if(t_words < o_words) {
  ------------------
  |  Branch (537:7): [True: 510, False: 0]
  ------------------
  538|    510|      grow_to(o_words);
  539|    510|   }
  540|       |
  541|    510|   const size_t r_words = std::max(t_words, o_words);
  542|       |
  543|    510|   const auto mask = CT::Mask<word>::expand_bool(predicate);
  544|       |
  545|  8.67k|   for(size_t i = 0; i != r_words; ++i) {
  ------------------
  |  Branch (545:22): [True: 8.16k, False: 510]
  ------------------
  546|  8.16k|      const word o_word = other.word_at(i);
  547|  8.16k|      const word t_word = this->word_at(i);
  548|  8.16k|      this->set_word_at(i, mask.select(o_word, t_word));
  549|  8.16k|   }
  550|       |
  551|    510|   const auto same_sign = CT::Mask<word>::is_equal(sign(), other.sign()).as_choice();
  552|    510|   cond_flip_sign((mask.as_choice() && !same_sign).as_bool());
  553|    510|}
_ZNK5Botan6BigInt20_const_time_unpoisonEv:
  559|   219k|void BigInt::_const_time_unpoison() const {
  560|   219k|   CT::unpoison(m_data.const_data(), m_data.size());
  561|   219k|}

_ZN5Botan15ct_divide_pow2kEmRKNS_6BigIntE:
   89|     15|BigInt ct_divide_pow2k(size_t k, const BigInt& y) {
   90|     15|   BOTAN_ARG_CHECK(y.signum() != 0, "Cannot divide by zero");
  ------------------
  |  |   35|     15|   do {                                                          \
  |  |   36|     15|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */              \
  |  |   37|     15|      if(!(expr)) {                                              \
  |  |  ------------------
  |  |  |  Branch (37:10): [True: 0, False: 15]
  |  |  ------------------
  |  |   38|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */     \
  |  |   39|      0|         Botan::throw_invalid_argument(msg, __func__, __FILE__); \
  |  |   40|      0|      }                                                          \
  |  |   41|     15|   } while(0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 15]
  |  |  ------------------
  ------------------
   91|     15|   BOTAN_ARG_CHECK(y.signum() >= 0, "Negative divisor not supported");
  ------------------
  |  |   35|     15|   do {                                                          \
  |  |   36|     15|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */              \
  |  |   37|     15|      if(!(expr)) {                                              \
  |  |  ------------------
  |  |  |  Branch (37:10): [True: 0, False: 15]
  |  |  ------------------
  |  |   38|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */     \
  |  |   39|      0|         Botan::throw_invalid_argument(msg, __func__, __FILE__); \
  |  |   40|      0|      }                                                          \
  |  |   41|     15|   } while(0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 15]
  |  |  ------------------
  ------------------
   92|     15|   BOTAN_ARG_CHECK(k > 1, "Invalid k");
  ------------------
  |  |   35|     15|   do {                                                          \
  |  |   36|     15|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */              \
  |  |   37|     15|      if(!(expr)) {                                              \
  |  |  ------------------
  |  |  |  Branch (37:10): [True: 0, False: 15]
  |  |  ------------------
  |  |   38|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */     \
  |  |   39|      0|         Botan::throw_invalid_argument(msg, __func__, __FILE__); \
  |  |   40|      0|      }                                                          \
  |  |   41|     15|   } while(0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 15]
  |  |  ------------------
  ------------------
   93|       |
   94|     15|   const size_t x_bits = k + 1;
   95|     15|   const size_t y_bits = y.bits();
   96|       |
   97|     15|   if(x_bits < y_bits) {
  ------------------
  |  Branch (97:7): [True: 0, False: 15]
  ------------------
   98|      0|      return BigInt::zero();
   99|      0|   }
  100|       |
  101|     15|   BOTAN_ASSERT_NOMSG(y_bits >= 1);
  ------------------
  |  |   77|     15|   do {                                                                     \
  |  |   78|     15|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   79|     15|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (79:10): [True: 0, False: 15]
  |  |  ------------------
  |  |   80|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   81|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   82|      0|      }                                                                     \
  |  |   83|     15|   } while(0)
  |  |  ------------------
  |  |  |  Branch (83:12): [Folded, False: 15]
  |  |  ------------------
  ------------------
  102|     15|   const size_t x_words = (x_bits + WordInfo<word>::bits - 1) / WordInfo<word>::bits;
  103|     15|   const size_t y_words = y.sig_words();
  104|       |
  105|     15|   BigInt q = BigInt::with_capacity(x_words);
  106|     15|   BigInt r = BigInt::with_capacity(y_words + 1);
  107|     15|   BigInt t = BigInt::with_capacity(y_words + 1);  // a temporary
  108|       |
  109|     15|   r.set_bit(y_bits - 1);
  110|  3.88k|   for(size_t i = y_bits - 1; i != x_bits; ++i) {
  ------------------
  |  Branch (110:31): [True: 3.87k, False: 15]
  ------------------
  111|  3.87k|      const size_t b = x_bits - 1 - i;
  112|       |
  113|  3.87k|      if(i >= y_bits) {
  ------------------
  |  Branch (113:10): [True: 3.85k, False: 15]
  ------------------
  114|  3.85k|         bigint_shl1(r.mutable_data(), r.size(), r.size(), 1);
  115|  3.85k|      }
  116|       |
  117|  3.87k|      const bool r_gte_y = bigint_sub3(t.mutable_data(), r._data(), r.size(), y._data(), y_words) == 0;
  118|       |
  119|  3.87k|      q.conditionally_set_bit(b, r_gte_y);
  120|       |
  121|  3.87k|      bigint_cnd_swap(static_cast<word>(r_gte_y), r.mutable_data(), t.mutable_data(), y_words + 1);
  122|  3.87k|   }
  123|       |
  124|       |   // No need for sign fixup
  125|       |
  126|     15|   return q;
  127|     15|}
_ZN5Botan11ct_mod_wordERKNS_6BigIntEm:
  174|    256|word ct_mod_word(const BigInt& x, word y) {
  175|    256|   BOTAN_ARG_CHECK(x.signum() >= 0, "The argument x must be non-negative");
  ------------------
  |  |   35|    256|   do {                                                          \
  |  |   36|    256|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */              \
  |  |   37|    256|      if(!(expr)) {                                              \
  |  |  ------------------
  |  |  |  Branch (37:10): [True: 0, False: 256]
  |  |  ------------------
  |  |   38|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */     \
  |  |   39|      0|         Botan::throw_invalid_argument(msg, __func__, __FILE__); \
  |  |   40|      0|      }                                                          \
  |  |   41|    256|   } while(0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 256]
  |  |  ------------------
  ------------------
  176|    256|   BOTAN_ARG_CHECK(y != 0, "Cannot divide by zero");
  ------------------
  |  |   35|    256|   do {                                                          \
  |  |   36|    256|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */              \
  |  |   37|    256|      if(!(expr)) {                                              \
  |  |  ------------------
  |  |  |  Branch (37:10): [True: 0, False: 256]
  |  |  ------------------
  |  |   38|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */     \
  |  |   39|      0|         Botan::throw_invalid_argument(msg, __func__, __FILE__); \
  |  |   40|      0|      }                                                          \
  |  |   41|    256|   } while(0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 256]
  |  |  ------------------
  ------------------
  177|       |
  178|    256|   const size_t x_bits = x.bits();
  179|       |
  180|    256|   word r = 0;
  181|       |
  182|  65.7k|   for(size_t i = 0; i != x_bits; ++i) {
  ------------------
  |  Branch (182:22): [True: 65.5k, False: 256]
  ------------------
  183|  65.5k|      const size_t b = x_bits - 1 - i;
  184|  65.5k|      const bool x_b = x.get_bit(b);
  185|       |
  186|  65.5k|      const auto r_carry = CT::Mask<word>::expand_top_bit(r);
  187|       |
  188|  65.5k|      r <<= 1;
  189|  65.5k|      r += static_cast<word>(x_b);
  190|       |
  191|  65.5k|      const auto r_gte_y = CT::Mask<word>::is_gte(r, y) | r_carry;
  192|  65.5k|      r = r_gte_y.select(r - y, r);
  193|  65.5k|   }
  194|       |
  195|    256|   return r;
  196|    256|}
_ZN5Botan20vartime_divide_pow2kEmRKNS_6BigIntE:
  232|    747|BigInt vartime_divide_pow2k(size_t k, const BigInt& y_arg) {
  233|    747|   constexpr size_t WB = WordInfo<word>::bits;
  234|       |
  235|    747|   BOTAN_ARG_CHECK(y_arg.signum() != 0, "Cannot divide by zero");
  ------------------
  |  |   35|    747|   do {                                                          \
  |  |   36|    747|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */              \
  |  |   37|    747|      if(!(expr)) {                                              \
  |  |  ------------------
  |  |  |  Branch (37:10): [True: 0, False: 747]
  |  |  ------------------
  |  |   38|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */     \
  |  |   39|      0|         Botan::throw_invalid_argument(msg, __func__, __FILE__); \
  |  |   40|      0|      }                                                          \
  |  |   41|    747|   } while(0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 747]
  |  |  ------------------
  ------------------
  236|    747|   BOTAN_ARG_CHECK(y_arg.signum() >= 0, "Negative divisor not supported");
  ------------------
  |  |   35|    747|   do {                                                          \
  |  |   36|    747|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */              \
  |  |   37|    747|      if(!(expr)) {                                              \
  |  |  ------------------
  |  |  |  Branch (37:10): [True: 0, False: 747]
  |  |  ------------------
  |  |   38|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */     \
  |  |   39|      0|         Botan::throw_invalid_argument(msg, __func__, __FILE__); \
  |  |   40|      0|      }                                                          \
  |  |   41|    747|   } while(0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 747]
  |  |  ------------------
  ------------------
  237|    747|   BOTAN_ARG_CHECK(k > 1, "Invalid k");
  ------------------
  |  |   35|    747|   do {                                                          \
  |  |   36|    747|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */              \
  |  |   37|    747|      if(!(expr)) {                                              \
  |  |  ------------------
  |  |  |  Branch (37:10): [True: 0, False: 747]
  |  |  ------------------
  |  |   38|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */     \
  |  |   39|      0|         Botan::throw_invalid_argument(msg, __func__, __FILE__); \
  |  |   40|      0|      }                                                          \
  |  |   41|    747|   } while(0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 747]
  |  |  ------------------
  ------------------
  238|       |
  239|    747|   BigInt y = y_arg;
  240|       |
  241|    747|   const size_t y_words = y.sig_words();
  242|       |
  243|    747|   BOTAN_ASSERT_NOMSG(y_words > 0);
  ------------------
  |  |   77|    747|   do {                                                                     \
  |  |   78|    747|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   79|    747|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (79:10): [True: 0, False: 747]
  |  |  ------------------
  |  |   80|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   81|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   82|      0|      }                                                                     \
  |  |   83|    747|   } while(0)
  |  |  ------------------
  |  |  |  Branch (83:12): [Folded, False: 747]
  |  |  ------------------
  ------------------
  244|       |
  245|       |   // Calculate shifts needed to normalize y with high bit set
  246|    747|   const size_t shifts = y.top_bits_free();
  247|       |
  248|    747|   if(shifts > 0) {
  ------------------
  |  Branch (248:7): [True: 0, False: 747]
  ------------------
  249|      0|      y <<= shifts;
  250|      0|   }
  251|       |
  252|    747|   BigInt r;
  253|    747|   r.set_bit(k + shifts);  // (2^k) << shifts
  254|       |
  255|       |   // we know y has not changed size, since we only shifted up to set high bit
  256|    747|   const size_t t = y_words - 1;
  257|    747|   const size_t n = std::max(y_words, r.sig_words()) - 1;
  258|       |
  259|    747|   BOTAN_ASSERT_NOMSG(n >= t);
  ------------------
  |  |   77|    747|   do {                                                                     \
  |  |   78|    747|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   79|    747|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (79:10): [True: 0, False: 747]
  |  |  ------------------
  |  |   80|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   81|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   82|      0|      }                                                                     \
  |  |   83|    747|   } while(0)
  |  |  ------------------
  |  |  |  Branch (83:12): [Folded, False: 747]
  |  |  ------------------
  ------------------
  260|       |
  261|    747|   BigInt q = BigInt::zero();
  262|    747|   q.grow_to(n - t + 1);
  263|       |
  264|    747|   word* q_words = q.mutable_data();
  265|       |
  266|    747|   BigInt shifted_y = y << (WB * (n - t));
  267|       |
  268|       |   // Set q_{n-t} to number of times r > shifted_y
  269|    747|   secure_vector<word> ws;
  270|    747|   q_words[n - t] = r.reduce_below(shifted_y, ws);
  271|       |
  272|    747|   const word y_t0 = y.word_at(t);
  273|    747|   const word y_t1 = y.word_at(t - 1);
  274|    747|   BOTAN_DEBUG_ASSERT((y_t0 >> (WB - 1)) == 1);
  ------------------
  |  |  130|    747|      do { /* NOLINT(*-avoid-do-while) */ \
  |  |  131|    747|      } while(0)
  |  |  ------------------
  |  |  |  Branch (131:15): [Folded, False: 747]
  |  |  ------------------
  ------------------
  275|       |
  276|    747|   const divide_precomp div_y_t0(y_t0);
  277|       |
  278|  4.48k|   for(size_t i = n; i != t; --i) {
  ------------------
  |  Branch (278:22): [True: 3.73k, False: 747]
  ------------------
  279|  3.73k|      const word x_i0 = r.word_at(i);
  280|  3.73k|      const word x_i1 = r.word_at(i - 1);
  281|  3.73k|      const word x_i2 = r.word_at(i - 2);
  282|       |
  283|  3.73k|      word qit = (x_i0 == y_t0) ? WordInfo<word>::max : div_y_t0.vartime_div_2to1(x_i0, x_i1);
  ------------------
  |  Branch (283:18): [True: 0, False: 3.73k]
  ------------------
  284|       |
  285|       |      // Per HAC 14.23, this operation is required at most twice
  286|  4.48k|      for(size_t j = 0; j != 2; ++j) {
  ------------------
  |  Branch (286:25): [True: 4.48k, False: 0]
  ------------------
  287|  4.48k|         if(division_check_vartime(qit, y_t0, y_t1, x_i0, x_i1, x_i2)) {
  ------------------
  |  Branch (287:13): [True: 747, False: 3.73k]
  ------------------
  288|    747|            BOTAN_ASSERT_NOMSG(qit > 0);
  ------------------
  |  |   77|    747|   do {                                                                     \
  |  |   78|    747|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   79|    747|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (79:10): [True: 0, False: 747]
  |  |  ------------------
  |  |   80|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   81|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   82|      0|      }                                                                     \
  |  |   83|    747|   } while(0)
  |  |  ------------------
  |  |  |  Branch (83:12): [Folded, False: 747]
  |  |  ------------------
  ------------------
  289|    747|            qit--;
  290|  3.73k|         } else {
  291|  3.73k|            break;
  292|  3.73k|         }
  293|  4.48k|      }
  294|       |
  295|  3.73k|      shifted_y >>= WB;
  296|       |      // Now shifted_y == y << (WB * (i-t-1))
  297|       |
  298|       |      /*
  299|       |      * Special case qit == 0 and qit == 1 which occurs relatively often here due to a
  300|       |      * combination of the fixed 2^k and in many cases the typical structure of
  301|       |      * public moduli (as this function is called by Barrett_Reduction::for_public_modulus).
  302|       |      *
  303|       |      * Over the test suite, about 5% of loop iterations have qit == 1 and 10% have qit == 0
  304|       |      */
  305|       |
  306|  3.73k|      if(qit != 0) {
  ------------------
  |  Branch (306:10): [True: 3.73k, False: 0]
  ------------------
  307|  3.73k|         if(qit == 1) {
  ------------------
  |  Branch (307:13): [True: 747, False: 2.98k]
  ------------------
  308|    747|            r -= shifted_y;
  309|  2.98k|         } else {
  310|  2.98k|            r -= qit * shifted_y;
  311|  2.98k|         }
  312|       |
  313|  3.73k|         if(r.signum() < 0) {
  ------------------
  |  Branch (313:13): [True: 0, False: 3.73k]
  ------------------
  314|      0|            BOTAN_ASSERT_NOMSG(qit > 0);
  ------------------
  |  |   77|      0|   do {                                                                     \
  |  |   78|      0|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   79|      0|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (79:10): [True: 0, False: 0]
  |  |  ------------------
  |  |   80|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   81|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   82|      0|      }                                                                     \
  |  |   83|      0|   } while(0)
  |  |  ------------------
  |  |  |  Branch (83:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
  315|      0|            qit--;
  316|      0|            r += shifted_y;
  317|      0|            BOTAN_ASSERT_NOMSG(r.signum() >= 0);
  ------------------
  |  |   77|      0|   do {                                                                     \
  |  |   78|      0|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   79|      0|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (79:10): [True: 0, False: 0]
  |  |  ------------------
  |  |   80|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   81|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   82|      0|      }                                                                     \
  |  |   83|      0|   } while(0)
  |  |  ------------------
  |  |  |  Branch (83:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
  318|      0|         }
  319|  3.73k|      }
  320|       |
  321|  3.73k|      q_words[i - t - 1] = qit;
  322|  3.73k|   }
  323|       |
  324|    747|   return q;
  325|    747|}
_ZN5Botan14vartime_divideERKNS_6BigIntES2_RS0_S3_:
  332|  14.7k|void vartime_divide(const BigInt& x, const BigInt& y_arg, BigInt& q_out, BigInt& r_out) {
  333|  14.7k|   constexpr size_t WB = WordInfo<word>::bits;
  334|       |
  335|  14.7k|   if(y_arg.is_zero()) {
  ------------------
  |  Branch (335:7): [True: 0, False: 14.7k]
  ------------------
  336|      0|      throw Invalid_Argument("vartime_divide: cannot divide by zero");
  337|      0|   }
  338|       |
  339|  14.7k|   const size_t y_words = y_arg.sig_words();
  340|       |
  341|  14.7k|   BOTAN_ASSERT_NOMSG(y_words > 0);
  ------------------
  |  |   77|  14.7k|   do {                                                                     \
  |  |   78|  14.7k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   79|  14.7k|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (79:10): [True: 0, False: 14.7k]
  |  |  ------------------
  |  |   80|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   81|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   82|      0|      }                                                                     \
  |  |   83|  14.7k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (83:12): [Folded, False: 14.7k]
  |  |  ------------------
  ------------------
  342|       |
  343|  14.7k|   BigInt y = y_arg;
  344|       |
  345|  14.7k|   BigInt r = x;
  346|  14.7k|   BigInt q = BigInt::zero();
  347|  14.7k|   secure_vector<word> ws;
  348|       |
  349|  14.7k|   r.set_sign(BigInt::Positive);
  350|  14.7k|   y.set_sign(BigInt::Positive);
  351|       |
  352|       |   // Calculate shifts needed to normalize y with high bit set
  353|  14.7k|   const size_t shifts = y.top_bits_free();
  354|       |
  355|  14.7k|   if(shifts > 0) {
  ------------------
  |  Branch (355:7): [True: 14.5k, False: 164]
  ------------------
  356|  14.5k|      y <<= shifts;
  357|  14.5k|      r <<= shifts;
  358|  14.5k|   }
  359|       |
  360|       |   // we know y has not changed size, since we only shifted up to set high bit
  361|  14.7k|   const size_t t = y_words - 1;
  362|  14.7k|   const size_t n = std::max(y_words, r.sig_words()) - 1;  // r may have changed size however
  363|       |
  364|  14.7k|   BOTAN_ASSERT_NOMSG(n >= t);
  ------------------
  |  |   77|  14.7k|   do {                                                                     \
  |  |   78|  14.7k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   79|  14.7k|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (79:10): [True: 0, False: 14.7k]
  |  |  ------------------
  |  |   80|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   81|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   82|      0|      }                                                                     \
  |  |   83|  14.7k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (83:12): [Folded, False: 14.7k]
  |  |  ------------------
  ------------------
  365|       |
  366|  14.7k|   q.grow_to(n - t + 1);
  367|       |
  368|  14.7k|   word* q_words = q.mutable_data();
  369|       |
  370|  14.7k|   BigInt shifted_y = y << (WB * (n - t));
  371|       |
  372|       |   // Set q_{n-t} to number of times r > shifted_y
  373|  14.7k|   q_words[n - t] = r.reduce_below(shifted_y, ws);
  374|       |
  375|  14.7k|   const word y_t0 = y.word_at(t);
  376|  14.7k|   const word y_t1 = y.word_at(t - 1);
  377|  14.7k|   BOTAN_DEBUG_ASSERT((y_t0 >> (WB - 1)) == 1);
  ------------------
  |  |  130|  14.7k|      do { /* NOLINT(*-avoid-do-while) */ \
  |  |  131|  14.7k|      } while(0)
  |  |  ------------------
  |  |  |  Branch (131:15): [Folded, False: 14.7k]
  |  |  ------------------
  ------------------
  378|       |
  379|  14.7k|   const divide_precomp div_y_t0(y_t0);
  380|       |
  381|  29.3k|   for(size_t i = n; i != t; --i) {
  ------------------
  |  Branch (381:22): [True: 14.5k, False: 14.7k]
  ------------------
  382|  14.5k|      const word x_i0 = r.word_at(i);
  383|  14.5k|      const word x_i1 = r.word_at(i - 1);
  384|  14.5k|      const word x_i2 = r.word_at(i - 2);
  385|       |
  386|  14.5k|      word qit = (x_i0 == y_t0) ? WordInfo<word>::max : div_y_t0.vartime_div_2to1(x_i0, x_i1);
  ------------------
  |  Branch (386:18): [True: 92, False: 14.5k]
  ------------------
  387|       |
  388|       |      // Per HAC 14.23, this operation is required at most twice
  389|  15.3k|      for(size_t j = 0; j != 2; ++j) {
  ------------------
  |  Branch (389:25): [True: 15.3k, False: 21]
  ------------------
  390|  15.3k|         if(division_check_vartime(qit, y_t0, y_t1, x_i0, x_i1, x_i2)) {
  ------------------
  |  Branch (390:13): [True: 794, False: 14.5k]
  ------------------
  391|    794|            BOTAN_ASSERT_NOMSG(qit > 0);
  ------------------
  |  |   77|    794|   do {                                                                     \
  |  |   78|    794|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   79|    794|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (79:10): [True: 0, False: 794]
  |  |  ------------------
  |  |   80|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   81|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   82|      0|      }                                                                     \
  |  |   83|    794|   } while(0)
  |  |  ------------------
  |  |  |  Branch (83:12): [Folded, False: 794]
  |  |  ------------------
  ------------------
  392|    794|            qit--;
  393|  14.5k|         } else {
  394|  14.5k|            break;
  395|  14.5k|         }
  396|  15.3k|      }
  397|       |
  398|  14.5k|      shifted_y >>= WB;
  399|       |      // Now shifted_y == y << (WB * (i-t-1))
  400|       |
  401|  14.5k|      if(qit != 0) {
  ------------------
  |  Branch (401:10): [True: 14.5k, False: 34]
  ------------------
  402|  14.5k|         r -= qit * shifted_y;
  403|  14.5k|         if(r.signum() < 0) {
  ------------------
  |  Branch (403:13): [True: 7, False: 14.5k]
  ------------------
  404|      7|            BOTAN_ASSERT_NOMSG(qit > 0);
  ------------------
  |  |   77|      7|   do {                                                                     \
  |  |   78|      7|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   79|      7|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (79:10): [True: 0, False: 7]
  |  |  ------------------
  |  |   80|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   81|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   82|      0|      }                                                                     \
  |  |   83|      7|   } while(0)
  |  |  ------------------
  |  |  |  Branch (83:12): [Folded, False: 7]
  |  |  ------------------
  ------------------
  405|      7|            qit--;
  406|      7|            r += shifted_y;
  407|      7|            BOTAN_ASSERT_NOMSG(r.signum() >= 0);
  ------------------
  |  |   77|      7|   do {                                                                     \
  |  |   78|      7|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   79|      7|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (79:10): [True: 0, False: 7]
  |  |  ------------------
  |  |   80|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   81|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   82|      0|      }                                                                     \
  |  |   83|      7|   } while(0)
  |  |  ------------------
  |  |  |  Branch (83:12): [Folded, False: 7]
  |  |  ------------------
  ------------------
  408|      7|         }
  409|  14.5k|      }
  410|       |
  411|  14.5k|      q_words[i - t - 1] = qit;
  412|  14.5k|   }
  413|       |
  414|  14.7k|   if(shifts > 0) {
  ------------------
  |  Branch (414:7): [True: 14.5k, False: 164]
  ------------------
  415|  14.5k|      r >>= shifts;
  416|  14.5k|   }
  417|       |
  418|  14.7k|   sign_fixup(x, y_arg, q, r);
  419|       |
  420|  14.7k|   r_out = r;
  421|  14.7k|   q_out = q;
  422|  14.7k|}
divide.cpp:_ZN5Botan12_GLOBAL__N_110sign_fixupERKNS_6BigIntES3_RS1_S4_:
   21|  14.7k|void sign_fixup(const BigInt& x, const BigInt& y, BigInt& q, BigInt& r) {
   22|  14.7k|   q.cond_flip_sign(x.sign() != y.sign());
   23|       |
   24|  14.7k|   if(x.signum() < 0 && r.signum() != 0) {
  ------------------
  |  Branch (24:7): [True: 2, False: 14.7k]
  |  Branch (24:25): [True: 2, False: 0]
  ------------------
   25|      2|      if(y.signum() > 0) {
  ------------------
  |  Branch (25:10): [True: 2, False: 0]
  ------------------
   26|      2|         q -= 1;
   27|      2|      } else {
   28|      0|         q += 1;
   29|      0|      }
   30|      2|      r = y.abs() - r;
   31|      2|   }
   32|  14.7k|}
divide.cpp:_ZN5Botan12_GLOBAL__N_122division_check_vartimeEmmmmmm:
   34|  19.8k|inline bool division_check_vartime(word q, word y2, word y1, word x3, word x2, word x1) {
   35|       |   /*
   36|       |   Compute (y3,y2,y1) = (y2,y1) * q
   37|       |   and return true if (y3,y2,y1) > (x3,x2,x1)
   38|       |   */
   39|       |
   40|  19.8k|   word y3 = 0;
   41|  19.8k|   y1 = word_madd2(q, y1, &y3);
   42|  19.8k|   y2 = word_madd2(q, y2, &y3);
   43|       |
   44|  19.8k|   if(x3 != y3) {
  ------------------
  |  Branch (44:7): [True: 8.85k, False: 10.9k]
  ------------------
   45|  8.85k|      return (y3 > x3);
   46|  8.85k|   }
   47|  10.9k|   if(x2 != y2) {
  ------------------
  |  Branch (47:7): [True: 10.8k, False: 129]
  ------------------
   48|  10.8k|      return (y2 > x2);
   49|  10.8k|   }
   50|    129|   return (y1 > x1);
   51|  10.9k|}

_ZN5Botan17bigint_comba_sqr4EPmPKm:
   17|   382k|void bigint_comba_sqr4(word z[8], const word x[4]) {
   18|   382k|   word3<word> accum;
   19|       |
   20|   382k|   accum.mul(x[0], x[0]);
   21|   382k|   z[0] = accum.extract();
   22|   382k|   accum.mul_x2(x[0], x[1]);
   23|   382k|   z[1] = accum.extract();
   24|   382k|   accum.mul_x2(x[0], x[2]);
   25|   382k|   accum.mul(x[1], x[1]);
   26|   382k|   z[2] = accum.extract();
   27|   382k|   accum.mul_x2(x[0], x[3]);
   28|   382k|   accum.mul_x2(x[1], x[2]);
   29|   382k|   z[3] = accum.extract();
   30|   382k|   accum.mul_x2(x[1], x[3]);
   31|   382k|   accum.mul(x[2], x[2]);
   32|   382k|   z[4] = accum.extract();
   33|   382k|   accum.mul_x2(x[2], x[3]);
   34|   382k|   z[5] = accum.extract();
   35|   382k|   accum.mul(x[3], x[3]);
   36|   382k|   z[6] = accum.extract();
   37|   382k|   z[7] = accum.extract();
   38|   382k|}
_ZN5Botan17bigint_comba_mul4EPmPKmS2_:
   43|   110k|void bigint_comba_mul4(word z[8], const word x[4], const word y[4]) {
   44|   110k|   word3<word> accum;
   45|       |
   46|   110k|   accum.mul(x[0], y[0]);
   47|   110k|   z[0] = accum.extract();
   48|   110k|   accum.mul(x[0], y[1]);
   49|   110k|   accum.mul(x[1], y[0]);
   50|   110k|   z[1] = accum.extract();
   51|   110k|   accum.mul(x[0], y[2]);
   52|   110k|   accum.mul(x[1], y[1]);
   53|   110k|   accum.mul(x[2], y[0]);
   54|   110k|   z[2] = accum.extract();
   55|   110k|   accum.mul(x[0], y[3]);
   56|   110k|   accum.mul(x[1], y[2]);
   57|   110k|   accum.mul(x[2], y[1]);
   58|   110k|   accum.mul(x[3], y[0]);
   59|   110k|   z[3] = accum.extract();
   60|   110k|   accum.mul(x[1], y[3]);
   61|   110k|   accum.mul(x[2], y[2]);
   62|   110k|   accum.mul(x[3], y[1]);
   63|   110k|   z[4] = accum.extract();
   64|   110k|   accum.mul(x[2], y[3]);
   65|   110k|   accum.mul(x[3], y[2]);
   66|   110k|   z[5] = accum.extract();
   67|   110k|   accum.mul(x[3], y[3]);
   68|   110k|   z[6] = accum.extract();
   69|   110k|   z[7] = accum.extract();
   70|   110k|}
_ZN5Botan17bigint_comba_mul6EPmPKmS2_:
  116|  28.2k|void bigint_comba_mul6(word z[12], const word x[6], const word y[6]) {
  117|  28.2k|   word3<word> accum;
  118|       |
  119|  28.2k|   accum.mul(x[0], y[0]);
  120|  28.2k|   z[0] = accum.extract();
  121|  28.2k|   accum.mul(x[0], y[1]);
  122|  28.2k|   accum.mul(x[1], y[0]);
  123|  28.2k|   z[1] = accum.extract();
  124|  28.2k|   accum.mul(x[0], y[2]);
  125|  28.2k|   accum.mul(x[1], y[1]);
  126|  28.2k|   accum.mul(x[2], y[0]);
  127|  28.2k|   z[2] = accum.extract();
  128|  28.2k|   accum.mul(x[0], y[3]);
  129|  28.2k|   accum.mul(x[1], y[2]);
  130|  28.2k|   accum.mul(x[2], y[1]);
  131|  28.2k|   accum.mul(x[3], y[0]);
  132|  28.2k|   z[3] = accum.extract();
  133|  28.2k|   accum.mul(x[0], y[4]);
  134|  28.2k|   accum.mul(x[1], y[3]);
  135|  28.2k|   accum.mul(x[2], y[2]);
  136|  28.2k|   accum.mul(x[3], y[1]);
  137|  28.2k|   accum.mul(x[4], y[0]);
  138|  28.2k|   z[4] = accum.extract();
  139|  28.2k|   accum.mul(x[0], y[5]);
  140|  28.2k|   accum.mul(x[1], y[4]);
  141|  28.2k|   accum.mul(x[2], y[3]);
  142|  28.2k|   accum.mul(x[3], y[2]);
  143|  28.2k|   accum.mul(x[4], y[1]);
  144|  28.2k|   accum.mul(x[5], y[0]);
  145|  28.2k|   z[5] = accum.extract();
  146|  28.2k|   accum.mul(x[1], y[5]);
  147|  28.2k|   accum.mul(x[2], y[4]);
  148|  28.2k|   accum.mul(x[3], y[3]);
  149|  28.2k|   accum.mul(x[4], y[2]);
  150|  28.2k|   accum.mul(x[5], y[1]);
  151|  28.2k|   z[6] = accum.extract();
  152|  28.2k|   accum.mul(x[2], y[5]);
  153|  28.2k|   accum.mul(x[3], y[4]);
  154|  28.2k|   accum.mul(x[4], y[3]);
  155|  28.2k|   accum.mul(x[5], y[2]);
  156|  28.2k|   z[7] = accum.extract();
  157|  28.2k|   accum.mul(x[3], y[5]);
  158|  28.2k|   accum.mul(x[4], y[4]);
  159|  28.2k|   accum.mul(x[5], y[3]);
  160|  28.2k|   z[8] = accum.extract();
  161|  28.2k|   accum.mul(x[4], y[5]);
  162|  28.2k|   accum.mul(x[5], y[4]);
  163|  28.2k|   z[9] = accum.extract();
  164|  28.2k|   accum.mul(x[5], y[5]);
  165|  28.2k|   z[10] = accum.extract();
  166|  28.2k|   z[11] = accum.extract();
  167|  28.2k|}

_ZN5Botan10bigint_mulEPmmPKmmmS2_mmS0_m:
  292|   138k|                size_t ws_size) {
  293|   138k|   zeroize_buffer(z, z_size);
  294|       |
  295|   138k|   if(x_sw == 1) {
  ------------------
  |  Branch (295:7): [True: 0, False: 138k]
  ------------------
  296|      0|      bigint_linmul3(z, y, y_sw, x[0]);
  297|   138k|   } else if(y_sw == 1) {
  ------------------
  |  Branch (297:14): [True: 0, False: 138k]
  ------------------
  298|      0|      bigint_linmul3(z, x, x_sw, y[0]);
  299|   138k|   } else if(sized_for_comba_mul<4>(x_sw, x_size, y_sw, y_size, z_size)) {
  ------------------
  |  Branch (299:14): [True: 110k, False: 28.2k]
  ------------------
  300|   110k|      bigint_comba_mul4(z, x, y);
  301|   110k|   } else if(sized_for_comba_mul<6>(x_sw, x_size, y_sw, y_size, z_size)) {
  ------------------
  |  Branch (301:14): [True: 28.2k, False: 0]
  ------------------
  302|  28.2k|      bigint_comba_mul6(z, x, y);
  303|  28.2k|   } else if(sized_for_comba_mul<8>(x_sw, x_size, y_sw, y_size, z_size)) {
  ------------------
  |  Branch (303:14): [True: 0, False: 0]
  ------------------
  304|      0|      bigint_comba_mul8(z, x, y);
  305|      0|   } else if(sized_for_comba_mul<9>(x_sw, x_size, y_sw, y_size, z_size)) {
  ------------------
  |  Branch (305:14): [True: 0, False: 0]
  ------------------
  306|      0|      bigint_comba_mul9(z, x, y);
  307|      0|   } else if(sized_for_comba_mul<16>(x_sw, x_size, y_sw, y_size, z_size)) {
  ------------------
  |  Branch (307:14): [True: 0, False: 0]
  ------------------
  308|      0|      bigint_comba_mul16(z, x, y);
  309|      0|   } else if(sized_for_comba_mul<24>(x_sw, x_size, y_sw, y_size, z_size)) {
  ------------------
  |  Branch (309:14): [True: 0, False: 0]
  ------------------
  310|      0|      bigint_comba_mul24(z, x, y);
  311|      0|   } else if(x_sw < KARATSUBA_MULTIPLY_THRESHOLD || y_sw < KARATSUBA_MULTIPLY_THRESHOLD || workspace == nullptr) {
  ------------------
  |  Branch (311:14): [True: 0, False: 0]
  |  Branch (311:53): [True: 0, False: 0]
  |  Branch (311:92): [True: 0, False: 0]
  ------------------
  312|      0|      basecase_mul(z, z_size, x, x_sw, y, y_sw);
  313|      0|   } else {
  314|      0|      const size_t N = karatsuba_size(z_size, x_size, x_sw, y_size, y_sw);
  315|       |
  316|      0|      if(N > 0 && z_size >= 2 * N && ws_size >= 2 * N) {
  ------------------
  |  Branch (316:10): [True: 0, False: 0]
  |  Branch (316:19): [True: 0, False: 0]
  |  Branch (316:38): [True: 0, False: 0]
  ------------------
  317|      0|         karatsuba_mul(z, x, y, N, workspace);
  318|      0|      } else {
  319|      0|         basecase_mul(z, z_size, x, x_sw, y, y_sw);
  320|      0|      }
  321|      0|   }
  322|   138k|}
_ZN5Botan10bigint_sqrEPmmPKmmmS0_m:
  327|   382k|void bigint_sqr(word z[], size_t z_size, const word x[], size_t x_size, size_t x_sw, word workspace[], size_t ws_size) {
  328|   382k|   zeroize_buffer(z, z_size);
  329|       |
  330|   382k|   BOTAN_ASSERT(z_size / 2 >= x_sw, "Output size is sufficient");
  ------------------
  |  |   64|   382k|   do {                                                                                 \
  |  |   65|   382k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                                     \
  |  |   66|   382k|      if(!(expr)) {                                                                     \
  |  |  ------------------
  |  |  |  Branch (66:10): [True: 0, False: 382k]
  |  |  ------------------
  |  |   67|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                            \
  |  |   68|      0|         Botan::assertion_failure(#expr, assertion_made, __func__, __FILE__, __LINE__); \
  |  |   69|      0|      }                                                                                 \
  |  |   70|   382k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (70:12): [Folded, False: 382k]
  |  |  ------------------
  ------------------
  331|       |
  332|   382k|   if(x_sw == 1) {
  ------------------
  |  Branch (332:7): [True: 0, False: 382k]
  ------------------
  333|      0|      bigint_linmul3(z, x, x_sw, x[0]);
  334|   382k|   } else if(sized_for_comba_sqr<4>(x_sw, x_size, z_size)) {
  ------------------
  |  Branch (334:14): [True: 382k, False: 0]
  ------------------
  335|   382k|      bigint_comba_sqr4(z, x);
  336|   382k|   } else if(sized_for_comba_sqr<6>(x_sw, x_size, z_size)) {
  ------------------
  |  Branch (336:14): [True: 0, False: 0]
  ------------------
  337|      0|      bigint_comba_sqr6(z, x);
  338|      0|   } else if(sized_for_comba_sqr<8>(x_sw, x_size, z_size)) {
  ------------------
  |  Branch (338:14): [True: 0, False: 0]
  ------------------
  339|      0|      bigint_comba_sqr8(z, x);
  340|      0|   } else if(sized_for_comba_sqr<9>(x_sw, x_size, z_size)) {
  ------------------
  |  Branch (340:14): [True: 0, False: 0]
  ------------------
  341|      0|      bigint_comba_sqr9(z, x);
  342|      0|   } else if(sized_for_comba_sqr<16>(x_sw, x_size, z_size)) {
  ------------------
  |  Branch (342:14): [True: 0, False: 0]
  ------------------
  343|      0|      bigint_comba_sqr16(z, x);
  344|      0|   } else if(sized_for_comba_sqr<24>(x_sw, x_size, z_size)) {
  ------------------
  |  Branch (344:14): [True: 0, False: 0]
  ------------------
  345|      0|      bigint_comba_sqr24(z, x);
  346|      0|   } else if(x_size < KARATSUBA_SQUARE_THRESHOLD || workspace == nullptr) {
  ------------------
  |  Branch (346:14): [True: 0, False: 0]
  |  Branch (346:53): [True: 0, False: 0]
  ------------------
  347|      0|      basecase_sqr(z, z_size, x, x_sw);
  348|      0|   } else {
  349|      0|      const size_t N = karatsuba_size(z_size, x_size, x_sw);
  350|       |
  351|      0|      if(N > 0 && z_size >= 2 * N && ws_size >= 2 * N) {
  ------------------
  |  Branch (351:10): [True: 0, False: 0]
  |  Branch (351:19): [True: 0, False: 0]
  |  Branch (351:38): [True: 0, False: 0]
  ------------------
  352|      0|         karatsuba_sqr(z, x, N, workspace);
  353|      0|      } else {
  354|      0|         basecase_sqr(z, z_size, x, x_sw);
  355|      0|      }
  356|      0|   }
  357|   382k|}
mp_karat.cpp:_ZN5Botan12_GLOBAL__N_119sized_for_comba_mulILm4EEEbmmmmm:
  272|   138k|inline bool sized_for_comba_mul(size_t x_sw, size_t x_size, size_t y_sw, size_t y_size, size_t z_size) {
  273|   138k|   return (x_sw <= SZ && x_size >= SZ && y_sw <= SZ && y_size >= SZ && z_size >= 2 * SZ);
  ------------------
  |  Branch (273:12): [True: 110k, False: 28.2k]
  |  Branch (273:26): [True: 110k, False: 0]
  |  Branch (273:42): [True: 110k, False: 0]
  |  Branch (273:56): [True: 110k, False: 0]
  |  Branch (273:72): [True: 110k, False: 0]
  ------------------
  274|   138k|}
mp_karat.cpp:_ZN5Botan12_GLOBAL__N_119sized_for_comba_mulILm6EEEbmmmmm:
  272|  28.2k|inline bool sized_for_comba_mul(size_t x_sw, size_t x_size, size_t y_sw, size_t y_size, size_t z_size) {
  273|  28.2k|   return (x_sw <= SZ && x_size >= SZ && y_sw <= SZ && y_size >= SZ && z_size >= 2 * SZ);
  ------------------
  |  Branch (273:12): [True: 28.2k, False: 0]
  |  Branch (273:26): [True: 28.2k, False: 0]
  |  Branch (273:42): [True: 28.2k, False: 0]
  |  Branch (273:56): [True: 28.2k, False: 0]
  |  Branch (273:72): [True: 28.2k, False: 0]
  ------------------
  274|  28.2k|}
mp_karat.cpp:_ZN5Botan12_GLOBAL__N_119sized_for_comba_sqrILm4EEEbmmm:
  277|   382k|inline bool sized_for_comba_sqr(size_t x_sw, size_t x_size, size_t z_size) {
  278|   382k|   return (x_sw <= SZ && x_size >= SZ && z_size >= 2 * SZ);
  ------------------
  |  Branch (278:12): [True: 382k, False: 0]
  |  Branch (278:26): [True: 382k, False: 0]
  |  Branch (278:42): [True: 382k, False: 0]
  ------------------
  279|   382k|}

_ZN5Botan19bigint_monty_redc_4EPmPKmS2_mS0_:
   12|   484k|void bigint_monty_redc_4(word r[4], const word z[8], const word p[4], word p_dash, word ws[4]) {
   13|   484k|   word3<word> accum;
   14|   484k|   accum.add(z[0]);
   15|   484k|   ws[0] = accum.monty_step(p[0], p_dash);
   16|   484k|   accum.mul(ws[0], p[1]);
   17|   484k|   accum.add(z[1]);
   18|   484k|   ws[1] = accum.monty_step(p[0], p_dash);
   19|   484k|   accum.mul(ws[0], p[2]);
   20|   484k|   accum.mul(ws[1], p[1]);
   21|   484k|   accum.add(z[2]);
   22|   484k|   ws[2] = accum.monty_step(p[0], p_dash);
   23|   484k|   accum.mul(ws[0], p[3]);
   24|   484k|   accum.mul(ws[1], p[2]);
   25|   484k|   accum.mul(ws[2], p[1]);
   26|   484k|   accum.add(z[3]);
   27|   484k|   ws[3] = accum.monty_step(p[0], p_dash);
   28|   484k|   accum.mul(ws[1], p[3]);
   29|   484k|   accum.mul(ws[2], p[2]);
   30|   484k|   accum.mul(ws[3], p[1]);
   31|   484k|   accum.add(z[4]);
   32|   484k|   ws[0] = accum.extract();
   33|   484k|   accum.mul(ws[2], p[3]);
   34|   484k|   accum.mul(ws[3], p[2]);
   35|   484k|   accum.add(z[5]);
   36|   484k|   ws[1] = accum.extract();
   37|   484k|   accum.mul(ws[3], p[3]);
   38|   484k|   accum.add(z[6]);
   39|   484k|   ws[2] = accum.extract();
   40|   484k|   accum.add(z[7]);
   41|   484k|   ws[3] = accum.extract();
   42|   484k|   const word w1 = accum.extract();
   43|   484k|   bigint_monty_maybe_sub<4>(r, w1, ws, p);
   44|   484k|}

_ZN5Botan17Barrett_ReductionC2ERKNS_6BigIntES1_m:
   17|    762|      m_modulus(m), m_mu(std::move(mu)), m_mod_words(mw), m_modulus_bits(m.bits()) {
   18|       |   // Give some extra space for Karatsuba
   19|    762|   m_modulus.grow_to(m_mod_words + 8);
   20|    762|   m_mu.grow_to(m_mod_words + 8);
   21|    762|}
_ZN5Botan17Barrett_Reduction18for_secret_modulusERKNS_6BigIntE:
   23|     15|Barrett_Reduction Barrett_Reduction::for_secret_modulus(const BigInt& mod) {
   24|     15|   BOTAN_ARG_CHECK(mod.signum() > 0, "Modulus must be positive");
  ------------------
  |  |   35|     15|   do {                                                          \
  |  |   36|     15|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */              \
  |  |   37|     15|      if(!(expr)) {                                              \
  |  |  ------------------
  |  |  |  Branch (37:10): [True: 0, False: 15]
  |  |  ------------------
  |  |   38|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */     \
  |  |   39|      0|         Botan::throw_invalid_argument(msg, __func__, __FILE__); \
  |  |   40|      0|      }                                                          \
  |  |   41|     15|   } while(0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 15]
  |  |  ------------------
  ------------------
   25|       |
   26|     15|   const size_t mod_words = mod.sig_words();
   27|       |
   28|       |   // Compute mu = floor(2^{2k} / m)
   29|     15|   const size_t mu_bits = 2 * WordInfo<word>::bits * mod_words;
   30|     15|   return Barrett_Reduction(mod, ct_divide_pow2k(mu_bits, mod), mod_words);
   31|     15|}
_ZN5Botan17Barrett_Reduction18for_public_modulusERKNS_6BigIntE:
   33|    747|Barrett_Reduction Barrett_Reduction::for_public_modulus(const BigInt& mod) {
   34|    747|   BOTAN_ARG_CHECK(mod.signum() > 0, "Modulus must be positive");
  ------------------
  |  |   35|    747|   do {                                                          \
  |  |   36|    747|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */              \
  |  |   37|    747|      if(!(expr)) {                                              \
  |  |  ------------------
  |  |  |  Branch (37:10): [True: 0, False: 747]
  |  |  ------------------
  |  |   38|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */     \
  |  |   39|      0|         Botan::throw_invalid_argument(msg, __func__, __FILE__); \
  |  |   40|      0|      }                                                          \
  |  |   41|    747|   } while(0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 747]
  |  |  ------------------
  ------------------
   35|       |
   36|    747|   const size_t mod_words = mod.sig_words();
   37|       |
   38|       |   // Compute mu = floor(2^{2k} / m)
   39|    747|   const size_t mu_bits = 2 * WordInfo<word>::bits * mod_words;
   40|    747|   return Barrett_Reduction(mod, vartime_divide_pow2k(mu_bits, mod), mod_words);
   41|    747|}
_ZNK5Botan17Barrett_Reduction8multiplyERKNS_6BigIntES3_:
  159|  5.30k|BigInt Barrett_Reduction::multiply(const BigInt& x, const BigInt& y) const {
  160|  5.30k|   BOTAN_ARG_CHECK(acceptable_barrett_input(x, m_modulus).as_bool(), "Invalid x param for Barrett multiply");
  ------------------
  |  |   35|  5.30k|   do {                                                          \
  |  |   36|  5.30k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */              \
  |  |   37|  5.30k|      if(!(expr)) {                                              \
  |  |  ------------------
  |  |  |  Branch (37:10): [True: 0, False: 5.30k]
  |  |  ------------------
  |  |   38|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */     \
  |  |   39|      0|         Botan::throw_invalid_argument(msg, __func__, __FILE__); \
  |  |   40|      0|      }                                                          \
  |  |   41|  5.30k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 5.30k]
  |  |  ------------------
  ------------------
  161|  5.30k|   BOTAN_ARG_CHECK(acceptable_barrett_input(y, m_modulus).as_bool(), "Invalid y param for Barrett multiply");
  ------------------
  |  |   35|  5.30k|   do {                                                          \
  |  |   36|  5.30k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */              \
  |  |   37|  5.30k|      if(!(expr)) {                                              \
  |  |  ------------------
  |  |  |  Branch (37:10): [True: 0, False: 5.30k]
  |  |  ------------------
  |  |   38|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */     \
  |  |   39|      0|         Botan::throw_invalid_argument(msg, __func__, __FILE__); \
  |  |   40|      0|      }                                                          \
  |  |   41|  5.30k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 5.30k]
  |  |  ------------------
  ------------------
  162|       |
  163|  5.30k|   secure_vector<word> ws(2 * (m_mod_words + 2));
  164|  5.30k|   secure_vector<word> xy(2 * m_mod_words);
  165|       |
  166|  5.30k|   bigint_mul(xy.data(),
  167|  5.30k|              xy.size(),
  168|  5.30k|              x._data(),
  169|  5.30k|              x.size(),
  170|  5.30k|              std::min(x.size(), m_mod_words),
  171|  5.30k|              y._data(),
  172|  5.30k|              y.size(),
  173|  5.30k|              std::min(y.size(), m_mod_words),
  174|  5.30k|              ws.data(),
  175|  5.30k|              ws.size());
  176|       |
  177|  5.30k|   return barrett_reduce(m_mod_words, m_modulus, m_mu, xy, ws);
  178|  5.30k|}
_ZNK5Botan17Barrett_Reduction6squareERKNS_6BigIntE:
  180|  6.29k|BigInt Barrett_Reduction::square(const BigInt& x) const {
  181|  6.29k|   BOTAN_ARG_CHECK(acceptable_barrett_input(x, m_modulus).as_bool(), "Invalid x param for Barrett square");
  ------------------
  |  |   35|  6.29k|   do {                                                          \
  |  |   36|  6.29k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */              \
  |  |   37|  6.29k|      if(!(expr)) {                                              \
  |  |  ------------------
  |  |  |  Branch (37:10): [True: 0, False: 6.29k]
  |  |  ------------------
  |  |   38|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */     \
  |  |   39|      0|         Botan::throw_invalid_argument(msg, __func__, __FILE__); \
  |  |   40|      0|      }                                                          \
  |  |   41|  6.29k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 6.29k]
  |  |  ------------------
  ------------------
  182|       |
  183|  6.29k|   secure_vector<word> ws(2 * (m_mod_words + 2));
  184|  6.29k|   secure_vector<word> x2(2 * m_mod_words);
  185|       |
  186|  6.29k|   bigint_sqr(x2.data(), x2.size(), x._data(), x.size(), std::min(x.size(), m_mod_words), ws.data(), ws.size());
  187|       |
  188|  6.29k|   return barrett_reduce(m_mod_words, m_modulus, m_mu, x2, ws);
  189|  6.29k|}
_ZNK5Botan17Barrett_Reduction6reduceERKNS_6BigIntE:
  191|  2.52k|BigInt Barrett_Reduction::reduce(const BigInt& x) const {
  192|  2.52k|   BOTAN_ARG_CHECK(x.signum() >= 0, "Argument must be non-negative");
  ------------------
  |  |   35|  2.52k|   do {                                                          \
  |  |   36|  2.52k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */              \
  |  |   37|  2.52k|      if(!(expr)) {                                              \
  |  |  ------------------
  |  |  |  Branch (37:10): [True: 0, False: 2.52k]
  |  |  ------------------
  |  |   38|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */     \
  |  |   39|      0|         Botan::throw_invalid_argument(msg, __func__, __FILE__); \
  |  |   40|      0|      }                                                          \
  |  |   41|  2.52k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 2.52k]
  |  |  ------------------
  ------------------
  193|       |
  194|  2.52k|   const size_t x_sw = x.sig_words();
  195|  2.52k|   BOTAN_ARG_CHECK(x_sw <= 2 * m_mod_words, "Argument is too large for Barrett reduction");
  ------------------
  |  |   35|  2.52k|   do {                                                          \
  |  |   36|  2.52k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */              \
  |  |   37|  2.52k|      if(!(expr)) {                                              \
  |  |  ------------------
  |  |  |  Branch (37:10): [True: 0, False: 2.52k]
  |  |  ------------------
  |  |   38|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */     \
  |  |   39|      0|         Botan::throw_invalid_argument(msg, __func__, __FILE__); \
  |  |   40|      0|      }                                                          \
  |  |   41|  2.52k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 2.52k]
  |  |  ------------------
  ------------------
  196|       |
  197|  2.52k|   x.grow_to(2 * m_mod_words);
  198|       |
  199|  2.52k|   secure_vector<word> ws;
  200|  2.52k|   return barrett_reduce(m_mod_words, m_modulus, m_mu, x._as_span(), ws);
  201|  2.52k|}
barrett.cpp:_ZN5Botan12_GLOBAL__N_124acceptable_barrett_inputERKNS_6BigIntES3_:
  151|  16.9k|CT::Choice acceptable_barrett_input(const BigInt& x, const BigInt& modulus) {
  152|  16.9k|   auto x_is_positive = CT::Choice::from_int(static_cast<uint32_t>(x.signum() >= 0));
  153|  16.9k|   auto x_lt_mod = bigint_ct_is_lt(x._data(), x.size(), modulus._data(), modulus.sig_words()).as_choice();
  154|  16.9k|   return x_is_positive && x_lt_mod;
  155|  16.9k|}
barrett.cpp:_ZN5Botan12_GLOBAL__N_114barrett_reduceEmRKNS_6BigIntES3_NSt3__14spanIKmLm18446744073709551615EEERNS4_6vectorImNS_16secure_allocatorImEEEE:
   54|  14.1k|   size_t mod_words, const BigInt& modulus, const BigInt& mu, std::span<const word> x_words, secure_vector<word>& ws) {
   55|  14.1k|   BOTAN_ASSERT_NOMSG(modulus.sig_words() == mod_words);
  ------------------
  |  |   77|  14.1k|   do {                                                                     \
  |  |   78|  14.1k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   79|  14.1k|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (79:10): [True: 0, False: 14.1k]
  |  |  ------------------
  |  |   80|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   81|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   82|      0|      }                                                                     \
  |  |   83|  14.1k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (83:12): [Folded, False: 14.1k]
  |  |  ------------------
  ------------------
   56|       |
   57|       |   // Caller must expand input to be at least this size
   58|  14.1k|   BOTAN_ASSERT_NOMSG(x_words.size() >= 2 * mod_words);
  ------------------
  |  |   77|  14.1k|   do {                                                                     \
  |  |   78|  14.1k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   79|  14.1k|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (79:10): [True: 0, False: 14.1k]
  |  |  ------------------
  |  |   80|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   81|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   82|      0|      }                                                                     \
  |  |   83|  14.1k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (83:12): [Folded, False: 14.1k]
  |  |  ------------------
  ------------------
   59|       |
   60|       |   // Normally mod_words + 1 but can be + 2 if the modulus is a power of 2
   61|  14.1k|   const size_t mu_words = mu.sig_words();
   62|  14.1k|   BOTAN_ASSERT_NOMSG(mu_words <= mod_words + 2);
  ------------------
  |  |   77|  14.1k|   do {                                                                     \
  |  |   78|  14.1k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   79|  14.1k|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (79:10): [True: 0, False: 14.1k]
  |  |  ------------------
  |  |   80|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   81|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   82|      0|      }                                                                     \
  |  |   83|  14.1k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (83:12): [Folded, False: 14.1k]
  |  |  ------------------
  ------------------
   63|       |
   64|  14.1k|   if(ws.size() < 2 * (mod_words + 2)) {
  ------------------
  |  Branch (64:7): [True: 2.52k, False: 11.6k]
  ------------------
   65|  2.52k|      ws.resize(2 * (mod_words + 2));
   66|  2.52k|   }
   67|       |
   68|  14.1k|   CT::poison(x_words);
   69|       |
   70|       |   /*
   71|       |   * Following the notation of Handbook of Applied Cryptography
   72|       |   * Algorithm 14.42 "Barrett modular reduction", page 604
   73|       |   * <https://cacr.uwaterloo.ca/hac/about/chap14.pdf>
   74|       |   *
   75|       |   * Using `mu` for μ in the code
   76|       |   */
   77|       |
   78|       |   // Compute q1 = floor(x / 2^(k - 1)) which is equivalent to ignoring the low (k-1) words
   79|       |
   80|       |   // 2 * mod_words + 1 is sufficient, extra is to enable Karatsuba
   81|  14.1k|   secure_vector<word> r(2 * mu_words + 2);
   82|       |
   83|  14.1k|   copy_mem(r.data(), x_words.data() + (mod_words - 1), mod_words + 1);
   84|       |
   85|       |   // Now compute q2 = q1 * μ
   86|       |
   87|       |   // We allocate more size than required since this allows Karatsuba more often;
   88|       |   // just `mu_words + (mod_words + 1)` is sufficient
   89|  14.1k|   const size_t q2_size = 2 * mu_words + 2;
   90|       |
   91|  14.1k|   secure_vector<word> q2(q2_size);
   92|       |
   93|  14.1k|   bigint_mul(
   94|  14.1k|      q2.data(), q2.size(), r.data(), r.size(), mod_words + 1, mu._data(), mu.size(), mu_words, ws.data(), ws.size());
   95|       |
   96|       |   // Compute r2 = (floor(q2 / b^(k+1)) * m) mod 2^(k+1)
   97|       |   // The division/floor is again effected by just ignoring the low k + 1 words
   98|  14.1k|   bigint_mul(r.data(),
   99|  14.1k|              r.size(),
  100|  14.1k|              &q2[mod_words + 1],  // ignoring the low mod_words + 1 words of the first product
  101|  14.1k|              q2.size() - (mod_words + 1),
  102|  14.1k|              mod_words + 1,
  103|  14.1k|              modulus._data(),
  104|  14.1k|              modulus.size(),
  105|  14.1k|              mod_words,
  106|  14.1k|              ws.data(),
  107|  14.1k|              ws.size());
  108|       |
  109|       |   // Clear the high words of the product, equivalent to computing mod 2^(k+1)
  110|       |   // TODO add masked mul to avoid computing high bits at all
  111|  14.1k|   clear_mem(std::span{r}.subspan(mod_words + 1));
  112|       |
  113|       |   // Compute r = r1 - r2
  114|       |
  115|       |   // The return value of bigint_sub_abs isn't quite right for what we need here so first compare
  116|  14.1k|   const int32_t relative_size = bigint_cmp(r.data(), mod_words + 1, x_words.data(), mod_words + 1);
  117|       |
  118|  14.1k|   bigint_sub_abs(r.data(), r.data(), x_words.data(), mod_words + 1, ws.data());
  119|       |
  120|       |   /*
  121|       |   If r is negative then we have to set r to r + 2^(k+1)
  122|       |
  123|       |   However for r negative computing this sum is equivalent to computing 2^(k+1) - abs(r)
  124|       |   */
  125|  14.1k|   clear_mem(ws.data(), mod_words + 2);
  126|  14.1k|   ws[mod_words + 1] = 1;
  127|  14.1k|   bigint_sub2(ws.data(), mod_words + 2, r.data(), mod_words + 2);
  128|       |
  129|       |   // If relative_size > 0 then assign r to 2^(k+1) - r
  130|  14.1k|   CT::Mask<word>::is_equal(static_cast<word>(relative_size), 1).select_n(r.data(), ws.data(), r.data(), mod_words + 2);
  131|       |
  132|       |   /*
  133|       |   * Per HAC Note 14.44 (ii) "step 4 is repeated at most twice since 0 ≤ r < 3m"
  134|       |   */
  135|  14.1k|   const size_t bound = 2;
  136|       |
  137|  14.1k|   BOTAN_ASSERT_NOMSG(r.size() >= mod_words + 1);
  ------------------
  |  |   77|  14.1k|   do {                                                                     \
  |  |   78|  14.1k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   79|  14.1k|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (79:10): [True: 0, False: 14.1k]
  |  |  ------------------
  |  |   80|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   81|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   82|      0|      }                                                                     \
  |  |   83|  14.1k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (83:12): [Folded, False: 14.1k]
  |  |  ------------------
  ------------------
  138|  42.3k|   for(size_t i = 0; i != bound; ++i) {
  ------------------
  |  Branch (138:22): [True: 28.2k, False: 14.1k]
  ------------------
  139|  28.2k|      const word borrow = bigint_sub3(ws.data(), r.data(), mod_words + 1, modulus._data(), mod_words);
  140|  28.2k|      CT::Mask<word>::is_zero(borrow).select_n(r.data(), ws.data(), r.data(), mod_words + 1);
  141|  28.2k|   }
  142|       |
  143|  14.1k|   CT::unpoison(q2);
  144|  14.1k|   CT::unpoison(r);
  145|  14.1k|   CT::unpoison(ws);
  146|  14.1k|   CT::unpoison(x_words);
  147|       |
  148|  14.1k|   return BigInt::_from_words(r);
  149|  14.1k|}

_ZN5Botan12random_primeERNS_21RandomNumberGeneratorEmRKNS_6BigIntEmmm:
  189|      1|   RandomNumberGenerator& rng, size_t bits, const BigInt& coprime, size_t equiv, size_t modulo, size_t prob) {
  190|      1|   if(bits <= 1) {
  ------------------
  |  Branch (190:7): [True: 0, False: 1]
  ------------------
  191|      0|      throw Invalid_Argument("random_prime: Can't make a prime of " + std::to_string(bits) + " bits");
  192|      0|   }
  193|      1|   if(coprime.signum() < 0 || (coprime.signum() != 0 && coprime.is_even()) || coprime.bits() >= bits) {
  ------------------
  |  Branch (193:7): [True: 0, False: 1]
  |  Branch (193:32): [True: 0, False: 1]
  |  Branch (193:57): [True: 0, False: 0]
  |  Branch (193:79): [True: 0, False: 1]
  ------------------
  194|      0|      throw Invalid_Argument("random_prime: invalid coprime");
  195|      0|   }
  196|       |   // TODO(Botan4) reduce this to ~1000
  197|      1|   if(modulo == 0 || modulo >= 100000) {
  ------------------
  |  Branch (197:7): [True: 0, False: 1]
  |  Branch (197:22): [True: 0, False: 1]
  ------------------
  198|      0|      throw Invalid_Argument("random_prime: Invalid modulo value");
  199|      0|   }
  200|       |
  201|      1|   equiv %= modulo;
  202|       |
  203|      1|   if(equiv == 0) {
  ------------------
  |  Branch (203:7): [True: 0, False: 1]
  ------------------
  204|      0|      throw Invalid_Argument("random_prime Invalid value for equiv/modulo");
  205|      0|   }
  206|       |
  207|       |   // Handle small values:
  208|       |
  209|      1|   if(bits <= 16) {
  ------------------
  |  Branch (209:7): [True: 0, False: 1]
  ------------------
  210|      0|      if(equiv != 1 || modulo != 2 || coprime != 0) {
  ------------------
  |  Branch (210:10): [True: 0, False: 0]
  |  Branch (210:24): [True: 0, False: 0]
  |  Branch (210:39): [True: 0, False: 0]
  ------------------
  211|      0|         throw Not_Implemented("random_prime equiv/modulo/coprime options not usable for small primes");
  212|      0|      }
  213|       |
  214|      0|      if(bits == 2) {
  ------------------
  |  Branch (214:10): [True: 0, False: 0]
  ------------------
  215|      0|         return BigInt::from_word(((rng.next_byte() % 2) == 0 ? 2 : 3));
  ------------------
  |  Branch (215:36): [True: 0, False: 0]
  ------------------
  216|      0|      } else if(bits == 3) {
  ------------------
  |  Branch (216:17): [True: 0, False: 0]
  ------------------
  217|      0|         return BigInt::from_word(((rng.next_byte() % 2) == 0 ? 5 : 7));
  ------------------
  |  Branch (217:36): [True: 0, False: 0]
  ------------------
  218|      0|      } else if(bits == 4) {
  ------------------
  |  Branch (218:17): [True: 0, False: 0]
  ------------------
  219|      0|         return BigInt::from_word(((rng.next_byte() % 2) == 0 ? 11 : 13));
  ------------------
  |  Branch (219:36): [True: 0, False: 0]
  ------------------
  220|      0|      } else {
  221|      0|         for(;;) {
  222|       |            // This is slightly biased, but for small primes it does not seem to matter
  223|      0|            uint8_t b[4] = {0};
  224|      0|            rng.randomize(b, 4);
  225|      0|            const size_t idx = load_le<uint32_t>(b, 0) % PRIME_TABLE_SIZE;
  226|      0|            const uint16_t small_prime = PRIMES[idx];
  227|       |
  228|      0|            if(high_bit(small_prime) == bits) {
  ------------------
  |  Branch (228:16): [True: 0, False: 0]
  ------------------
  229|      0|               return BigInt::from_word(small_prime);
  230|      0|            }
  231|      0|         }
  232|      0|      }
  233|      0|   }
  234|       |
  235|       |   // The check_2p1 sieve filter is only appropriate when generating q for a
  236|       |   // safe prime; for arbitrary equiv/modulo it can pre-reject every candidate
  237|       |   // (eg equiv=1, modulo=3 makes the residue mod 3 always equal (3-1)/2).
  238|      1|   return random_prime_with_sieve(rng, bits, coprime, equiv, modulo, prob, false);
  239|      1|}
make_prm.cpp:_ZN5Botan12_GLOBAL__N_123random_prime_with_sieveERNS_21RandomNumberGeneratorEmRKNS_6BigIntEmmmb:
  113|      1|                               bool sieve_check_2p1) {
  114|      1|   const size_t MAX_ATTEMPTS = 32 * 1024;
  115|       |
  116|      1|   const size_t mr_trials = miller_rabin_test_iterations(bits, prob, true);
  117|       |
  118|      1|   while(true) {
  ------------------
  |  Branch (118:10): [True: 1, Folded]
  ------------------
  119|      1|      BigInt p(rng, bits);
  120|       |
  121|       |      // Force lowest and two top bits on
  122|      1|      p.set_bit(bits - 1);
  123|      1|      p.set_bit(bits - 2);
  124|      1|      p.set_bit(0);
  125|       |
  126|       |      // Force p to be equal to equiv mod modulo
  127|      1|      p += (modulo - (p % modulo)) + equiv;
  128|       |
  129|      1|      Prime_Sieve sieve(p, bits, modulo, sieve_check_2p1);
  130|       |
  131|     96|      for(size_t attempt = 0; attempt <= MAX_ATTEMPTS; ++attempt) {
  ------------------
  |  Branch (131:31): [True: 96, False: 0]
  ------------------
  132|     96|         p += modulo;
  133|       |
  134|     96|         if(!sieve.next()) {
  ------------------
  |  Branch (134:13): [True: 81, False: 15]
  ------------------
  135|     81|            continue;
  136|     81|         }
  137|       |
  138|       |         // here p can be even if modulo is odd, continue on in that case
  139|     15|         if(p.is_even()) {
  ------------------
  |  Branch (139:13): [True: 0, False: 15]
  ------------------
  140|      0|            continue;
  141|      0|         }
  142|       |
  143|     15|         BOTAN_DEBUG_ASSERT(no_small_multiples(p, sieve));
  ------------------
  |  |  130|     15|      do { /* NOLINT(*-avoid-do-while) */ \
  |  |  131|     15|      } while(0)
  |  |  ------------------
  |  |  |  Branch (131:15): [Folded, False: 15]
  |  |  ------------------
  ------------------
  144|       |
  145|     15|         auto mod_p = Barrett_Reduction::for_secret_modulus(p);
  146|     15|         const Montgomery_Params monty_p(p, mod_p);
  147|       |
  148|     15|         if(coprime > 1) {
  ------------------
  |  Branch (148:13): [True: 0, False: 15]
  ------------------
  149|       |            /*
  150|       |            First do a single M-R iteration to quickly eliminate most non-primes,
  151|       |            before doing the coprimality check which is expensive
  152|       |            */
  153|      0|            if(!is_miller_rabin_probable_prime(p, mod_p, monty_p, rng, 1)) {
  ------------------
  |  Branch (153:16): [True: 0, False: 0]
  ------------------
  154|      0|               continue;
  155|      0|            }
  156|       |
  157|       |            /*
  158|       |            * Check if p - 1 and coprime are relatively prime, using gcd.
  159|       |            * The gcd computation is const-time
  160|       |            */
  161|      0|            if(gcd(p - 1, coprime) > 1) {
  ------------------
  |  Branch (161:16): [True: 0, False: 0]
  ------------------
  162|      0|               continue;
  163|      0|            }
  164|      0|         }
  165|       |
  166|     15|         if(p.bits() > bits) {
  ------------------
  |  Branch (166:13): [True: 0, False: 15]
  ------------------
  167|      0|            break;
  168|      0|         }
  169|       |
  170|     15|         if(!is_miller_rabin_probable_prime(p, mod_p, monty_p, rng, mr_trials)) {
  ------------------
  |  Branch (170:13): [True: 14, False: 1]
  ------------------
  171|     14|            continue;
  172|     14|         }
  173|       |
  174|      1|         if(prob > 32 && !is_lucas_probable_prime(p, mod_p)) {
  ------------------
  |  Branch (174:13): [True: 1, False: 0]
  |  Branch (174:26): [True: 0, False: 1]
  ------------------
  175|      0|            continue;
  176|      0|         }
  177|       |
  178|      1|         return p;
  179|      1|      }
  180|      1|   }
  181|      1|}
make_prm.cpp:_ZN5Botan12_GLOBAL__N_111Prime_SieveC2ERKNS_6BigIntEmmb:
   27|      1|            m_sieve(std::min(sieve_size, PRIME_TABLE_SIZE)), m_step(step), m_check_2p1(check_2p1) {
   28|    257|         for(size_t i = 0; i != m_sieve.size(); ++i) {
  ------------------
  |  Branch (28:28): [True: 256, False: 1]
  ------------------
   29|    256|            m_sieve[i] = ct_mod_word(init_value, PRIMES[i]);
   30|    256|         }
   31|      1|      }
make_prm.cpp:_ZN5Botan12_GLOBAL__N_111Prime_Sieve4nextEv:
   37|     96|      bool next() {
   38|     96|         auto passes = CT::Mask<word>::set();
   39|  24.6k|         for(size_t i = 0; i != m_sieve.size(); ++i) {
  ------------------
  |  Branch (39:28): [True: 24.5k, False: 96]
  ------------------
   40|  24.5k|            m_sieve[i] = sieve_step_incr(m_sieve[i], m_step, PRIMES[i]);
   41|       |
   42|       |            // If m_sieve[i] == 0 then val % p == 0 -> not prime
   43|  24.5k|            passes &= CT::Mask<word>::expand(m_sieve[i]);
   44|       |
   45|  24.5k|            if(this->check_2p1()) {
  ------------------
  |  Branch (45:16): [True: 0, False: 24.5k]
  ------------------
   46|       |               /*
   47|       |               If v % p == (p-1)/2 then 2*v+1 == 0 (mod p)
   48|       |
   49|       |               So if potentially generating a safe prime, we want to
   50|       |               avoid this value because 2*v+1 will certainly not be prime.
   51|       |
   52|       |               See "Safe Prime Generation with a Combined Sieve" M. Wiener
   53|       |               https://eprint.iacr.org/2003/186.pdf
   54|       |               */
   55|      0|               passes &= ~CT::Mask<word>::is_equal(m_sieve[i], (PRIMES[i] - 1) / 2);
   56|      0|            }
   57|  24.5k|         }
   58|       |
   59|     96|         return passes.as_bool();
   60|     96|      }
make_prm.cpp:_ZN5Botan12_GLOBAL__N_111Prime_Sieve15sieve_step_incrEmmm:
   66|  24.5k|      static constexpr word sieve_step_incr(word v, word step, word mod) {
   67|  24.5k|         BOTAN_DEBUG_ASSERT(v < mod);
  ------------------
  |  |  130|  24.5k|      do { /* NOLINT(*-avoid-do-while) */ \
  |  |  131|  24.5k|      } while(0)
  |  |  ------------------
  |  |  |  Branch (131:15): [Folded, False: 24.5k]
  |  |  ------------------
  ------------------
   68|       |         // The sieve step and primes are public so this modulo is ok
   69|  24.5k|         const word stepmod = (step >= mod) ? (step % mod) : step;
  ------------------
  |  Branch (69:31): [True: 96, False: 24.4k]
  ------------------
   70|       |
   71|       |         // This sum is at most 2*(mod-1)
   72|  24.5k|         const word next = (v + stepmod);
   73|  24.5k|         return next - CT::Mask<word>::is_gte(next, mod).if_set_return(mod);
   74|  24.5k|      }
make_prm.cpp:_ZNK5Botan12_GLOBAL__N_111Prime_Sieve9check_2p1Ev:
   35|  24.5k|      bool check_2p1() const { return m_check_2p1; }

_ZN5Botan17Montgomery_Params4DataC2ERKNS_6BigIntERKNS_17Barrett_ReductionE:
   40|    761|Montgomery_Params::Data::Data(const BigInt& p, const Barrett_Reduction& mod_p) {
   41|    761|   if(p.is_even() || p < 3) {
  ------------------
  |  Branch (41:7): [True: 0, False: 761]
  |  Branch (41:22): [True: 0, False: 761]
  ------------------
   42|      0|      throw Invalid_Argument("Montgomery_Params invalid modulus");
   43|      0|   }
   44|       |
   45|    761|   m_p = p;
   46|    761|   m_p_words = m_p.sig_words();
   47|    761|   m_p_dash = monty_inverse(m_p.word_at(0));
   48|       |
   49|    761|   const BigInt r = BigInt::power_of_2(m_p_words * WordInfo<word>::bits);
   50|       |
   51|    761|   m_r1 = mod_p.reduce(r);
   52|    761|   m_r2 = mod_p.square(m_r1);
   53|    761|   m_r3 = mod_p.multiply(m_r1, m_r2);
   54|       |
   55|       |   // Barrett should be at least zero prefixing up to modulus size
   56|    761|   BOTAN_ASSERT_NOMSG(m_r1.size() >= m_p_words);
  ------------------
  |  |   77|    761|   do {                                                                     \
  |  |   78|    761|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   79|    761|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (79:10): [True: 0, False: 761]
  |  |  ------------------
  |  |   80|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   81|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   82|      0|      }                                                                     \
  |  |   83|    761|   } while(0)
  |  |  ------------------
  |  |  |  Branch (83:12): [Folded, False: 761]
  |  |  ------------------
  ------------------
   57|    761|   BOTAN_ASSERT_NOMSG(m_r2.size() >= m_p_words);
  ------------------
  |  |   77|    761|   do {                                                                     \
  |  |   78|    761|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   79|    761|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (79:10): [True: 0, False: 761]
  |  |  ------------------
  |  |   80|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   81|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   82|      0|      }                                                                     \
  |  |   83|    761|   } while(0)
  |  |  ------------------
  |  |  |  Branch (83:12): [Folded, False: 761]
  |  |  ------------------
  ------------------
   58|    761|   BOTAN_ASSERT_NOMSG(m_r3.size() >= m_p_words);
  ------------------
  |  |   77|    761|   do {                                                                     \
  |  |   78|    761|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   79|    761|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (79:10): [True: 0, False: 761]
  |  |  ------------------
  |  |   80|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   81|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   82|      0|      }                                                                     \
  |  |   83|    761|   } while(0)
  |  |  ------------------
  |  |  |  Branch (83:12): [Folded, False: 761]
  |  |  ------------------
  ------------------
   59|    761|}
_ZN5Botan17Montgomery_ParamsC2ERKNS_6BigIntERKNS_17Barrett_ReductionE:
   62|    761|      m_data(std::make_shared<Data>(p, mod_p)) {}
_ZNK5Botan17Montgomery_ParamseqERKS0_:
   67|  99.5k|bool Montgomery_Params::operator==(const Montgomery_Params& other) const {
   68|  99.5k|   if(this->m_data == other.m_data) {
  ------------------
  |  Branch (68:7): [True: 99.5k, False: 0]
  ------------------
   69|  99.5k|      return true;
   70|  99.5k|   }
   71|       |
   72|      0|   return (this->m_data->p() == other.m_data->p());
   73|  99.5k|}
_ZN5Botan14Montgomery_IntC2ERKNS_17Montgomery_ParamsENSt3__16vectorImNS_16secure_allocatorImEEEE:
  227|  18.1k|      m_params(params), m_v(std::move(words)) {
  228|  18.1k|   BOTAN_ASSERT_NOMSG(m_v.size() == m_params.p_words());
  ------------------
  |  |   77|  18.1k|   do {                                                                     \
  |  |   78|  18.1k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   79|  18.1k|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (79:10): [True: 0, False: 18.1k]
  |  |  ------------------
  |  |   80|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   81|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   82|      0|      }                                                                     \
  |  |   83|  18.1k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (83:12): [Folded, False: 18.1k]
  |  |  ------------------
  ------------------
  229|  18.1k|}
_ZN5Botan14Montgomery_Int3oneERKNS_17Montgomery_ParamsE:
  231|  2.59k|Montgomery_Int Montgomery_Int::one(const Montgomery_Params& params) {
  232|  2.59k|   return Montgomery_Int(params, params.R1(), false);
  233|  2.59k|}
_ZN5Botan14Montgomery_IntC2ERKNS_17Montgomery_ParamsERKNS_6BigIntEb:
  242|  5.18k|      m_params(params), m_v(m_params.p_words()) {
  243|  5.18k|   BOTAN_ARG_CHECK(v.signum() >= 0 && v < m_params.p(), "Input out of range");
  ------------------
  |  |   35|  5.18k|   do {                                                          \
  |  |   36|  5.18k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */              \
  |  |   37|  10.3k|      if(!(expr)) {                                              \
  |  |  ------------------
  |  |  |  Branch (37:12): [True: 5.18k, False: 0]
  |  |  |  Branch (37:12): [True: 5.18k, False: 0]
  |  |  ------------------
  |  |   38|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */     \
  |  |   39|      0|         Botan::throw_invalid_argument(msg, __func__, __FILE__); \
  |  |   40|      0|      }                                                          \
  |  |   41|  5.18k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 5.18k]
  |  |  ------------------
  ------------------
  244|       |
  245|  5.18k|   const size_t p_size = m_params.p_words();
  246|       |
  247|  5.18k|   auto v_span = v._as_span();
  248|       |
  249|  5.18k|   if(v_span.size() > p_size) {
  ------------------
  |  Branch (249:7): [True: 5.18k, False: 0]
  ------------------
  250|       |      // Safe to truncate the span since we already checked v < p
  251|  5.18k|      v_span = v_span.first(p_size);
  252|  5.18k|   }
  253|       |
  254|  5.18k|   BOTAN_ASSERT_NOMSG(m_v.size() >= v_span.size());
  ------------------
  |  |   77|  5.18k|   do {                                                                     \
  |  |   78|  5.18k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   79|  5.18k|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (79:10): [True: 0, False: 5.18k]
  |  |  ------------------
  |  |   80|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   81|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   82|      0|      }                                                                     \
  |  |   83|  5.18k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (83:12): [Folded, False: 5.18k]
  |  |  ------------------
  ------------------
  255|       |
  256|  5.18k|   copy_mem(std::span{m_v}.first(v_span.size()), v_span);
  257|       |
  258|  5.18k|   if(redc_needed) {
  ------------------
  |  Branch (258:7): [True: 2.59k, False: 2.59k]
  ------------------
  259|  2.59k|      secure_vector<word> ws;
  260|  2.59k|      this->mul_by(m_params.R2()._as_span().first(p_size), ws);
  261|  2.59k|   }
  262|  5.18k|}
_ZN5Botan14Montgomery_IntC2ERKNS_17Montgomery_ParamsENSt3__14spanIKmLm18446744073709551615EEE:
  265|     43|      m_params(params), m_v(words.begin(), words.end()) {
  266|     43|   BOTAN_ARG_CHECK(m_v.size() == m_params.p_words(), "Invalid input span");
  ------------------
  |  |   35|     43|   do {                                                          \
  |  |   36|     43|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */              \
  |  |   37|     43|      if(!(expr)) {                                              \
  |  |  ------------------
  |  |  |  Branch (37:10): [True: 0, False: 43]
  |  |  ------------------
  |  |   38|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */     \
  |  |   39|      0|         Botan::throw_invalid_argument(msg, __func__, __FILE__); \
  |  |   40|      0|      }                                                          \
  |  |   41|     43|   } while(0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 43]
  |  |  ------------------
  ------------------
  267|     43|}
_ZNK5Botan14Montgomery_Int5valueEv:
  273|  2.59k|BigInt Montgomery_Int::value() const {
  274|  2.59k|   secure_vector<word> ws(m_params.p_words());
  275|       |
  276|  2.59k|   secure_vector<word> z = m_v;
  277|  2.59k|   z.resize(2 * m_params.p_words());  // zero extend
  278|       |
  279|  2.59k|   bigint_monty_redc_inplace(
  280|  2.59k|      z.data(), m_params.p()._data(), m_params.p_words(), m_params.p_dash(), ws.data(), ws.size());
  281|       |
  282|  2.59k|   return BigInt::_from_words(z);
  283|  2.59k|}
_ZNK5Botan14Montgomery_Int3mulERKS0_RNSt3__16vectorImNS_16secure_allocatorImEEEE:
  320|  18.1k|Montgomery_Int Montgomery_Int::mul(const Montgomery_Int& other, secure_vector<word>& ws) const {
  321|  18.1k|   BOTAN_STATE_CHECK(other.m_params == m_params);
  ------------------
  |  |   51|  18.1k|   do {                                                         \
  |  |   52|  18.1k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */             \
  |  |   53|  18.1k|      if(!(expr)) {                                             \
  |  |  ------------------
  |  |  |  Branch (53:10): [True: 0, False: 18.1k]
  |  |  ------------------
  |  |   54|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */    \
  |  |   55|      0|         Botan::throw_invalid_state(#expr, __func__, __FILE__); \
  |  |   56|      0|      }                                                         \
  |  |   57|  18.1k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (57:12): [Folded, False: 18.1k]
  |  |  ------------------
  ------------------
  322|       |
  323|  18.1k|   const size_t p_size = m_params.p_words();
  324|  18.1k|   BOTAN_ASSERT_NOMSG(m_v.size() == p_size && other.m_v.size() == p_size);
  ------------------
  |  |   77|  18.1k|   do {                                                                     \
  |  |   78|  18.1k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   79|  36.2k|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (79:12): [True: 18.1k, False: 0]
  |  |  |  Branch (79:12): [True: 18.1k, False: 0]
  |  |  ------------------
  |  |   80|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   81|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   82|      0|      }                                                                     \
  |  |   83|  18.1k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (83:12): [Folded, False: 18.1k]
  |  |  ------------------
  ------------------
  325|       |
  326|  18.1k|   if(ws.size() < 2 * p_size) {
  ------------------
  |  Branch (326:7): [True: 0, False: 18.1k]
  ------------------
  327|      0|      ws.resize(2 * p_size);
  328|      0|   }
  329|       |
  330|  18.1k|   secure_vector<word> z(2 * p_size);
  331|       |
  332|  18.1k|   bigint_mul(z.data(), z.size(), m_v.data(), p_size, p_size, other.m_v.data(), p_size, p_size, ws.data(), ws.size());
  333|       |
  334|  18.1k|   bigint_monty_redc_inplace(z.data(), m_params.p()._data(), p_size, m_params.p_dash(), ws.data(), ws.size());
  335|  18.1k|   z.resize(p_size);  // truncate off high zero words
  336|       |
  337|  18.1k|   return Montgomery_Int(m_params, std::move(z));
  338|  18.1k|}
_ZN5Botan14Montgomery_Int6mul_byERKS0_RNSt3__16vectorImNS_16secure_allocatorImEEEE:
  340|  81.4k|Montgomery_Int& Montgomery_Int::mul_by(const Montgomery_Int& other, secure_vector<word>& ws) {
  341|  81.4k|   BOTAN_STATE_CHECK(other.m_params == m_params);
  ------------------
  |  |   51|  81.4k|   do {                                                         \
  |  |   52|  81.4k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */             \
  |  |   53|  81.4k|      if(!(expr)) {                                             \
  |  |  ------------------
  |  |  |  Branch (53:10): [True: 0, False: 81.4k]
  |  |  ------------------
  |  |   54|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */    \
  |  |   55|      0|         Botan::throw_invalid_state(#expr, __func__, __FILE__); \
  |  |   56|      0|      }                                                         \
  |  |   57|  81.4k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (57:12): [Folded, False: 81.4k]
  |  |  ------------------
  ------------------
  342|  81.4k|   return this->mul_by(std::span{other.m_v}, ws);
  343|  81.4k|}
_ZN5Botan14Montgomery_Int6mul_byENSt3__14spanIKmLm18446744073709551615EEERNS1_6vectorImNS_16secure_allocatorImEEEE:
  345|  86.7k|Montgomery_Int& Montgomery_Int::mul_by(std::span<const word> other, secure_vector<word>& ws) {
  346|  86.7k|   const size_t p_size = m_params.p_words();
  347|  86.7k|   BOTAN_ASSERT_NOMSG(m_v.size() == p_size && other.size() == p_size);
  ------------------
  |  |   77|  86.7k|   do {                                                                     \
  |  |   78|  86.7k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   79|   173k|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (79:12): [True: 86.7k, False: 0]
  |  |  |  Branch (79:12): [True: 86.7k, False: 0]
  |  |  ------------------
  |  |   80|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   81|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   82|      0|      }                                                                     \
  |  |   83|  86.7k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (83:12): [Folded, False: 86.7k]
  |  |  ------------------
  ------------------
  348|       |
  349|  86.7k|   if(ws.size() < 2 * p_size) {
  ------------------
  |  Branch (349:7): [True: 2.59k, False: 84.1k]
  ------------------
  350|  2.59k|      ws.resize(2 * p_size);
  351|  2.59k|   }
  352|       |
  353|  86.7k|   auto do_mul_by = [&](std::span<word> z) {
  354|  86.7k|      bigint_mul(z.data(), z.size(), m_v.data(), p_size, p_size, other.data(), p_size, p_size, ws.data(), ws.size());
  355|       |
  356|  86.7k|      bigint_monty_redc_inplace(z.data(), m_params.p()._data(), p_size, m_params.p_dash(), ws.data(), ws.size());
  357|       |
  358|  86.7k|      copy_mem(m_v, z.first(p_size));
  359|  86.7k|   };
  360|       |
  361|  86.7k|   if(p_size <= MontgomeryUseStackLimit) {
  ------------------
  |  Branch (361:7): [True: 86.7k, False: 0]
  ------------------
  362|  86.7k|      std::array<word, 2 * MontgomeryUseStackLimit> z{};
  363|  86.7k|      do_mul_by(z);
  364|  86.7k|   } else {
  365|      0|      secure_vector<word> z(2 * p_size);
  366|      0|      do_mul_by(z);
  367|      0|   }
  368|       |
  369|  86.7k|   return (*this);
  370|  86.7k|}
_ZN5Botan14Montgomery_Int19square_this_n_timesERNSt3__16vectorImNS_16secure_allocatorImEEEEm:
  372|   107k|Montgomery_Int& Montgomery_Int::square_this_n_times(secure_vector<word>& ws, size_t n) {
  373|   107k|   const size_t p_size = m_params.p_words();
  374|   107k|   BOTAN_ASSERT_NOMSG(m_v.size() == p_size);
  ------------------
  |  |   77|   107k|   do {                                                                     \
  |  |   78|   107k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   79|   107k|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (79:10): [True: 0, False: 107k]
  |  |  ------------------
  |  |   80|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   81|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   82|      0|      }                                                                     \
  |  |   83|   107k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (83:12): [Folded, False: 107k]
  |  |  ------------------
  ------------------
  375|       |
  376|   107k|   if(ws.size() < 2 * p_size) {
  ------------------
  |  Branch (376:7): [True: 0, False: 107k]
  ------------------
  377|      0|      ws.resize(2 * p_size);
  378|      0|   }
  379|       |
  380|   107k|   auto do_sqr_n = [&](std::span<word> z) {
  381|   107k|      for(size_t i = 0; i != n; ++i) {
  382|   107k|         bigint_sqr(z.data(), 2 * p_size, m_v.data(), p_size, p_size, ws.data(), ws.size());
  383|       |
  384|   107k|         bigint_monty_redc_inplace(z.data(), m_params.p()._data(), p_size, m_params.p_dash(), ws.data(), ws.size());
  385|       |
  386|   107k|         copy_mem(m_v, std::span{z}.first(p_size));
  387|   107k|      }
  388|   107k|   };
  389|       |
  390|   107k|   if(p_size <= MontgomeryUseStackLimit) {
  ------------------
  |  Branch (390:7): [True: 107k, False: 0]
  ------------------
  391|   107k|      std::array<word, 2 * MontgomeryUseStackLimit> z{};
  392|   107k|      do_sqr_n(z);
  393|   107k|   } else {
  394|      0|      secure_vector<word> z(2 * p_size);
  395|      0|      do_sqr_n(z);
  396|      0|   }
  397|       |
  398|   107k|   return (*this);
  399|   107k|}
_ZNK5Botan14Montgomery_Int6squareERNSt3__16vectorImNS_16secure_allocatorImEEEE:
  401|  18.1k|Montgomery_Int Montgomery_Int::square(secure_vector<word>& ws) const {
  402|  18.1k|   auto z = (*this);
  403|  18.1k|   z.square_this_n_times(ws, 1);
  404|  18.1k|   return z;
  405|  18.1k|}
monty.cpp:_ZZN5Botan14Montgomery_Int6mul_byENSt3__14spanIKmLm18446744073709551615EEERNS1_6vectorImNS_16secure_allocatorImEEEEENK3$_0clENS2_ImLm18446744073709551615EEE:
  353|  86.7k|   auto do_mul_by = [&](std::span<word> z) {
  354|  86.7k|      bigint_mul(z.data(), z.size(), m_v.data(), p_size, p_size, other.data(), p_size, p_size, ws.data(), ws.size());
  355|       |
  356|  86.7k|      bigint_monty_redc_inplace(z.data(), m_params.p()._data(), p_size, m_params.p_dash(), ws.data(), ws.size());
  357|       |
  358|  86.7k|      copy_mem(m_v, z.first(p_size));
  359|  86.7k|   };
monty.cpp:_ZZN5Botan14Montgomery_Int19square_this_n_timesERNSt3__16vectorImNS_16secure_allocatorImEEEEmENK3$_0clENS1_4spanImLm18446744073709551615EEE:
  380|   107k|   auto do_sqr_n = [&](std::span<word> z) {
  381|   484k|      for(size_t i = 0; i != n; ++i) {
  ------------------
  |  Branch (381:25): [True: 376k, False: 107k]
  ------------------
  382|   376k|         bigint_sqr(z.data(), 2 * p_size, m_v.data(), p_size, p_size, ws.data(), ws.size());
  383|       |
  384|   376k|         bigint_monty_redc_inplace(z.data(), m_params.p()._data(), p_size, m_params.p_dash(), ws.data(), ws.size());
  385|       |
  386|   376k|         copy_mem(m_v, std::span{z}.first(p_size));
  387|   376k|      }
  388|   107k|   };

_ZN5Botan31Montgomery_Exponentiation_StateC2ERKNS_14Montgomery_IntEmb:
   36|  2.59k|      m_params(g._params()), m_window_bits(window_bits == 0 ? 4 : window_bits) {
  ------------------
  |  Branch (36:44): [True: 0, False: 2.59k]
  ------------------
   37|  2.59k|   if(m_window_bits < 1 || m_window_bits > 12) {  // really even 8 is too large ...
  ------------------
  |  Branch (37:7): [True: 0, False: 2.59k]
  |  Branch (37:28): [True: 0, False: 2.59k]
  ------------------
   38|      0|      throw Invalid_Argument("Invalid window bits for Montgomery exponentiation");
   39|      0|   }
   40|       |
   41|  2.59k|   const size_t window_size = (static_cast<size_t>(1) << m_window_bits);
   42|       |
   43|  2.59k|   m_g.reserve(window_size);
   44|       |
   45|  2.59k|   m_g.push_back(Montgomery_Int::one(m_params));
   46|       |
   47|  2.59k|   m_g.push_back(g);
   48|       |
   49|  2.59k|   secure_vector<word> ws(2 * m_params.p_words());
   50|       |
   51|  38.8k|   for(size_t i = 2; i != window_size; ++i) {
  ------------------
  |  Branch (51:22): [True: 36.2k, False: 2.59k]
  ------------------
   52|  36.2k|      if(i % 2 == 0) {
  ------------------
  |  Branch (52:10): [True: 18.1k, False: 18.1k]
  ------------------
   53|  18.1k|         m_g.push_back(m_g[i / 2].square(ws));
   54|  18.1k|      } else {
   55|  18.1k|         m_g.push_back(m_g[1].mul(m_g[i - 1], ws));
   56|  18.1k|      }
   57|  36.2k|   }
   58|       |
   59|  2.59k|   if(const_time) {
  ------------------
  |  Branch (59:7): [True: 43, False: 2.54k]
  ------------------
   60|     43|      CT::poison_range(m_g);
   61|     43|   }
   62|  2.59k|}
_ZNK5Botan31Montgomery_Exponentiation_State14exponentiationERKNS_6BigIntEm:
   91|     43|Montgomery_Int Montgomery_Exponentiation_State::exponentiation(const BigInt& scalar, size_t max_k_bits) const {
   92|     43|   BOTAN_ARG_CHECK(scalar.signum() >= 0, "Invalid scalar for Montgomery exponentiation");
  ------------------
  |  |   35|     43|   do {                                                          \
  |  |   36|     43|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */              \
  |  |   37|     43|      if(!(expr)) {                                              \
  |  |  ------------------
  |  |  |  Branch (37:10): [True: 0, False: 43]
  |  |  ------------------
  |  |   38|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */     \
  |  |   39|      0|         Botan::throw_invalid_argument(msg, __func__, __FILE__); \
  |  |   40|      0|      }                                                          \
  |  |   41|     43|   } while(0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 43]
  |  |  ------------------
  ------------------
   93|     43|   BOTAN_DEBUG_ASSERT(scalar.bits() <= max_k_bits);
  ------------------
  |  |  130|     43|      do { /* NOLINT(*-avoid-do-while) */ \
  |  |  131|     43|      } while(0)
  |  |  ------------------
  |  |  |  Branch (131:15): [Folded, False: 43]
  |  |  ------------------
  ------------------
   94|       |   // TODO add a const-time implementation of above assert and use it in release builds
   95|       |
   96|     43|   const size_t exp_nibbles = (max_k_bits + m_window_bits - 1) / m_window_bits;
   97|       |
   98|     43|   if(exp_nibbles == 0) {
  ------------------
  |  Branch (98:7): [True: 0, False: 43]
  ------------------
   99|      0|      return Montgomery_Int::one(m_params);
  100|      0|   }
  101|       |
  102|     43|   secure_vector<word> e_bits(m_params.p_words());
  103|     43|   secure_vector<word> ws(2 * m_params.p_words());
  104|       |
  105|     43|   const_time_lookup(e_bits, m_g, scalar.get_substring(m_window_bits * (exp_nibbles - 1), m_window_bits));
  106|     43|   Montgomery_Int x(m_params, std::span{e_bits});
  107|       |
  108|  2.75k|   for(size_t i = exp_nibbles - 1; i > 0; --i) {
  ------------------
  |  Branch (108:36): [True: 2.70k, False: 43]
  ------------------
  109|  2.70k|      x.square_this_n_times(ws, m_window_bits);
  110|  2.70k|      const_time_lookup(e_bits, m_g, scalar.get_substring(m_window_bits * (i - 1), m_window_bits));
  111|  2.70k|      x.mul_by(e_bits, ws);
  112|  2.70k|   }
  113|       |
  114|     43|   CT::unpoison(x);
  115|     43|   return x;
  116|     43|}
_ZNK5Botan31Montgomery_Exponentiation_State22exponentiation_vartimeERKNS_6BigIntE:
  118|  2.54k|Montgomery_Int Montgomery_Exponentiation_State::exponentiation_vartime(const BigInt& scalar) const {
  119|  2.54k|   const size_t exp_nibbles = (scalar.bits() + m_window_bits - 1) / m_window_bits;
  120|       |
  121|  2.54k|   secure_vector<word> ws(2 * m_params.p_words());
  122|       |
  123|  2.54k|   if(exp_nibbles == 0) {
  ------------------
  |  Branch (123:7): [True: 0, False: 2.54k]
  ------------------
  124|      0|      return Montgomery_Int::one(m_params);
  125|      0|   }
  126|       |
  127|  2.54k|   Montgomery_Int x = m_g[scalar.get_substring(m_window_bits * (exp_nibbles - 1), m_window_bits)];
  128|       |
  129|  89.4k|   for(size_t i = exp_nibbles - 1; i > 0; --i) {
  ------------------
  |  Branch (129:36): [True: 86.9k, False: 2.54k]
  ------------------
  130|  86.9k|      x.square_this_n_times(ws, m_window_bits);
  131|       |
  132|  86.9k|      const uint32_t nibble = scalar.get_substring(m_window_bits * (i - 1), m_window_bits);
  133|  86.9k|      if(nibble > 0) {
  ------------------
  |  Branch (133:10): [True: 81.4k, False: 5.51k]
  ------------------
  134|  81.4k|         x.mul_by(m_g[nibble], ws);
  135|  81.4k|      }
  136|  86.9k|   }
  137|       |
  138|  2.54k|   CT::unpoison(x);
  139|  2.54k|   return x;
  140|  2.54k|}
_ZN5Botan16monty_precomputeERKNS_14Montgomery_IntEmb:
  144|  2.59k|                                                                        bool const_time) {
  145|  2.59k|   return std::make_shared<const Montgomery_Exponentiation_State>(g, window_bits, const_time);
  146|  2.59k|}
_ZN5Botan16monty_precomputeERKNS_17Montgomery_ParamsERKNS_6BigIntEmb:
  151|  2.59k|                                                                        bool const_time) {
  152|  2.59k|   BOTAN_ARG_CHECK(g.signum() >= 0 && g < params.p(), "Montgomery exponentiation base integer out of range");
  ------------------
  |  |   35|  2.59k|   do {                                                          \
  |  |   36|  2.59k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */              \
  |  |   37|  5.18k|      if(!(expr)) {                                              \
  |  |  ------------------
  |  |  |  Branch (37:12): [True: 2.59k, False: 0]
  |  |  |  Branch (37:12): [True: 2.59k, False: 0]
  |  |  ------------------
  |  |   38|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */     \
  |  |   39|      0|         Botan::throw_invalid_argument(msg, __func__, __FILE__); \
  |  |   40|      0|      }                                                          \
  |  |   41|  2.59k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 2.59k]
  |  |  ------------------
  ------------------
  153|  2.59k|   const Montgomery_Int monty_g(params, g);
  154|  2.59k|   return monty_precompute(monty_g, window_bits, const_time);
  155|  2.59k|}
_ZN5Botan13monty_executeERKNS_31Montgomery_Exponentiation_StateERKNS_6BigIntEm:
  159|     43|                             size_t max_k_bits) {
  160|     43|   return precomputed_state.exponentiation(k, max_k_bits);
  161|     43|}
_ZN5Botan21monty_execute_vartimeERKNS_31Montgomery_Exponentiation_StateERKNS_6BigIntE:
  163|  2.54k|Montgomery_Int monty_execute_vartime(const Montgomery_Exponentiation_State& precomputed_state, const BigInt& k) {
  164|  2.54k|   return precomputed_state.exponentiation_vartime(k);
  165|  2.54k|}
monty_exp.cpp:_ZN5Botan12_GLOBAL__N_117const_time_lookupERNSt3__16vectorImNS_16secure_allocatorImEEEERKNS2_INS_14Montgomery_IntENS1_9allocatorIS7_EEEEm:
   66|  2.75k|void const_time_lookup(secure_vector<word>& output, const std::vector<Montgomery_Int>& g, size_t nibble) {
   67|  2.75k|   BOTAN_ASSERT_NOMSG(g.size() % 2 == 0);  // actually a power of 2
  ------------------
  |  |   77|  2.75k|   do {                                                                     \
  |  |   78|  2.75k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   79|  2.75k|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (79:10): [True: 0, False: 2.75k]
  |  |  ------------------
  |  |   80|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   81|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   82|      0|      }                                                                     \
  |  |   83|  2.75k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (83:12): [Folded, False: 2.75k]
  |  |  ------------------
  ------------------
   68|       |
   69|  2.75k|   const size_t words = output.size();
   70|       |
   71|  2.75k|   clear_mem(output.data(), output.size());
   72|       |
   73|  24.7k|   for(size_t i = 0; i != g.size(); i += 2) {
  ------------------
  |  Branch (73:22): [True: 22.0k, False: 2.75k]
  ------------------
   74|  22.0k|      const secure_vector<word>& vec_0 = g[i].repr();
   75|  22.0k|      const secure_vector<word>& vec_1 = g[i + 1].repr();
   76|       |
   77|  22.0k|      BOTAN_ASSERT_NOMSG(vec_0.size() >= words && vec_1.size() >= words);
  ------------------
  |  |   77|  22.0k|   do {                                                                     \
  |  |   78|  22.0k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   79|  44.0k|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (79:12): [True: 22.0k, False: 0]
  |  |  |  Branch (79:12): [True: 22.0k, False: 0]
  |  |  ------------------
  |  |   80|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   81|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   82|      0|      }                                                                     \
  |  |   83|  22.0k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (83:12): [Folded, False: 22.0k]
  |  |  ------------------
  ------------------
   78|       |
   79|  22.0k|      const auto mask_0 = CT::Mask<word>::is_equal(nibble, i);
   80|  22.0k|      const auto mask_1 = CT::Mask<word>::is_equal(nibble, i + 1);
   81|       |
   82|   110k|      for(size_t w = 0; w != words; ++w) {
  ------------------
  |  Branch (82:25): [True: 88.0k, False: 22.0k]
  ------------------
   83|  88.0k|         output[w] |= mask_0.if_set_return(vec_0[w]);
   84|  88.0k|         output[w] |= mask_1.if_set_return(vec_1[w]);
   85|  88.0k|      }
   86|  22.0k|   }
   87|  2.75k|}

_ZN5Botan17sqrt_modulo_primeERKNS_6BigIntES2_:
   27|  1.37k|BigInt sqrt_modulo_prime(const BigInt& a, const BigInt& p) {
   28|  1.37k|   BOTAN_ARG_CHECK(p > 1, "invalid prime");
  ------------------
  |  |   35|  1.37k|   do {                                                          \
  |  |   36|  1.37k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */              \
  |  |   37|  1.37k|      if(!(expr)) {                                              \
  |  |  ------------------
  |  |  |  Branch (37:10): [True: 0, False: 1.37k]
  |  |  ------------------
  |  |   38|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */     \
  |  |   39|      0|         Botan::throw_invalid_argument(msg, __func__, __FILE__); \
  |  |   40|      0|      }                                                          \
  |  |   41|  1.37k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 1.37k]
  |  |  ------------------
  ------------------
   29|  1.37k|   BOTAN_ARG_CHECK(a < p, "value to solve for must be less than p");
  ------------------
  |  |   35|  1.37k|   do {                                                          \
  |  |   36|  1.37k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */              \
  |  |   37|  1.37k|      if(!(expr)) {                                              \
  |  |  ------------------
  |  |  |  Branch (37:10): [True: 1, False: 1.37k]
  |  |  ------------------
  |  |   38|      1|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */     \
  |  |   39|      1|         Botan::throw_invalid_argument(msg, __func__, __FILE__); \
  |  |   40|      1|      }                                                          \
  |  |   41|  1.37k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 1.37k]
  |  |  ------------------
  ------------------
   30|  1.37k|   BOTAN_ARG_CHECK(a >= 0, "value to solve for must not be negative");
  ------------------
  |  |   35|  1.37k|   do {                                                          \
  |  |   36|  1.37k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */              \
  |  |   37|  1.37k|      if(!(expr)) {                                              \
  |  |  ------------------
  |  |  |  Branch (37:10): [True: 0, False: 1.37k]
  |  |  ------------------
  |  |   38|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */     \
  |  |   39|      0|         Botan::throw_invalid_argument(msg, __func__, __FILE__); \
  |  |   40|      0|      }                                                          \
  |  |   41|  1.37k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 1.37k]
  |  |  ------------------
  ------------------
   31|       |
   32|       |   // some very easy cases
   33|  1.37k|   if(p == 2 || a <= 1) {
  ------------------
  |  Branch (33:7): [True: 1, False: 1.37k]
  |  Branch (33:17): [True: 2, False: 1.37k]
  ------------------
   34|      2|      return a;
   35|      2|   }
   36|       |
   37|  1.37k|   BOTAN_ARG_CHECK(p.is_odd(), "invalid prime");
  ------------------
  |  |   35|  1.37k|   do {                                                          \
  |  |   36|  1.37k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */              \
  |  |   37|  1.37k|      if(!(expr)) {                                              \
  |  |  ------------------
  |  |  |  Branch (37:10): [True: 0, False: 1.37k]
  |  |  ------------------
  |  |   38|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */     \
  |  |   39|      0|         Botan::throw_invalid_argument(msg, __func__, __FILE__); \
  |  |   40|      0|      }                                                          \
  |  |   41|  1.37k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 1.37k]
  |  |  ------------------
  ------------------
   38|       |
   39|  1.37k|   if(jacobi(a, p) != 1) {  // not a quadratic residue
  ------------------
  |  Branch (39:7): [True: 625, False: 747]
  ------------------
   40|    625|      return BigInt::from_s32(-1);
   41|    625|   }
   42|       |
   43|    747|   auto mod_p = Barrett_Reduction::for_public_modulus(p);
   44|    747|   const Montgomery_Params monty_p(p, mod_p);
   45|       |
   46|       |   // If p == 3 (mod 4) there is a simple solution
   47|    747|   if(p % 4 == 3) {
  ------------------
  |  Branch (47:7): [True: 0, False: 747]
  ------------------
   48|      0|      return monty_exp_vartime(monty_p, a, ((p + 1) >> 2)).value();
   49|      0|   }
   50|       |
   51|       |   // Otherwise we have to use Shanks-Tonelli
   52|    747|   size_t s = low_zero_bits(p - 1);
   53|    747|   BigInt q = p >> s;
   54|       |
   55|    747|   q -= 1;
   56|    747|   q >>= 1;
   57|       |
   58|    747|   BigInt r = monty_exp_vartime(monty_p, a, q).value();
   59|    747|   BigInt n = mod_p.multiply(a, mod_p.square(r));
   60|    747|   r = mod_p.multiply(r, a);
   61|       |
   62|    747|   if(n == 1) {
  ------------------
  |  Branch (62:7): [True: 90, False: 657]
  ------------------
   63|     90|      return r;
   64|     90|   }
   65|       |
   66|       |   // find random quadratic nonresidue z
   67|    657|   word z = 2;
   68|  1.31k|   for(;;) {
   69|  1.31k|      if(jacobi(BigInt::from_word(z), p) == -1) {  // found one
  ------------------
  |  Branch (69:10): [True: 656, False: 656]
  ------------------
   70|    656|         break;
   71|    656|      }
   72|       |
   73|    656|      z += 1;  // try next z
   74|       |
   75|       |      /*
   76|       |      * The expected number of tests to find a non-residue modulo a
   77|       |      * prime is 2. If we have not found one after 256 then almost
   78|       |      * certainly we have been given a non-prime p.
   79|       |      */
   80|    656|      if(z >= 256) {
  ------------------
  |  Branch (80:10): [True: 0, False: 656]
  ------------------
   81|      0|         return BigInt::from_s32(-1);
   82|      0|      }
   83|    656|   }
   84|       |
   85|    657|   BigInt c = monty_exp_vartime(monty_p, BigInt::from_word(z), (q << 1) + 1).value();
   86|       |
   87|  1.80k|   while(n > 1) {
  ------------------
  |  Branch (87:10): [True: 1.14k, False: 657]
  ------------------
   88|  1.14k|      q = n;
   89|       |
   90|  1.14k|      size_t i = 0;
   91|  3.44k|      while(q != 1) {
  ------------------
  |  Branch (91:13): [True: 2.29k, False: 1.14k]
  ------------------
   92|  2.29k|         q = mod_p.square(q);
   93|  2.29k|         ++i;
   94|       |
   95|  2.29k|         if(i >= s) {
  ------------------
  |  Branch (95:13): [True: 0, False: 2.29k]
  ------------------
   96|      0|            return BigInt::from_s32(-1);
   97|      0|         }
   98|  2.29k|      }
   99|       |
  100|  1.14k|      BOTAN_ASSERT_NOMSG(s >= (i + 1));  // No underflow!
  ------------------
  |  |   77|  1.14k|   do {                                                                     \
  |  |   78|  1.14k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   79|  1.14k|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (79:10): [True: 0, False: 1.14k]
  |  |  ------------------
  |  |   80|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   81|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   82|      0|      }                                                                     \
  |  |   83|  1.14k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (83:12): [Folded, False: 1.14k]
  |  |  ------------------
  ------------------
  101|  1.14k|      c = monty_exp_vartime(monty_p, c, BigInt::power_of_2(s - i - 1)).value();
  102|  1.14k|      r = mod_p.multiply(r, c);
  103|  1.14k|      c = mod_p.square(c);
  104|  1.14k|      n = mod_p.multiply(n, c);
  105|       |
  106|       |      // s decreases as the algorithm proceeds
  107|  1.14k|      BOTAN_ASSERT_NOMSG(s >= i);
  ------------------
  |  |   77|  1.14k|   do {                                                                     \
  |  |   78|  1.14k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   79|  1.14k|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (79:10): [True: 0, False: 1.14k]
  |  |  ------------------
  |  |   80|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   81|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   82|      0|      }                                                                     \
  |  |   83|  1.14k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (83:12): [Folded, False: 1.14k]
  |  |  ------------------
  ------------------
  108|  1.14k|      s = i;
  109|  1.14k|   }
  110|       |
  111|    657|   return r;
  112|    657|}
_ZN5Botan6jacobiENS_6BigIntES0_:
  119|  2.68k|int32_t jacobi(BigInt a, BigInt n) {
  120|  2.68k|   BOTAN_ARG_CHECK(n.is_odd() && n >= 3, "Argument n must be an odd integer >= 3");
  ------------------
  |  |   35|  2.68k|   do {                                                          \
  |  |   36|  2.68k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */              \
  |  |   37|  5.37k|      if(!(expr)) {                                              \
  |  |  ------------------
  |  |  |  Branch (37:12): [True: 2.68k, False: 0]
  |  |  |  Branch (37:12): [True: 2.68k, False: 0]
  |  |  ------------------
  |  |   38|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */     \
  |  |   39|      0|         Botan::throw_invalid_argument(msg, __func__, __FILE__); \
  |  |   40|      0|      }                                                          \
  |  |   41|  2.68k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 2.68k]
  |  |  ------------------
  ------------------
  121|       |
  122|  2.68k|   if(a < 0 || a >= n) {
  ------------------
  |  Branch (122:7): [True: 2, False: 2.68k]
  |  Branch (122:16): [True: 0, False: 2.68k]
  ------------------
  123|      2|      a %= n;
  124|      2|   }
  125|       |
  126|  2.68k|   if(a == 0) {
  ------------------
  |  Branch (126:7): [True: 0, False: 2.68k]
  ------------------
  127|      0|      return 0;
  128|      0|   }
  129|  2.68k|   if(a == 1) {
  ------------------
  |  Branch (129:7): [True: 0, False: 2.68k]
  ------------------
  130|      0|      return 1;
  131|      0|   }
  132|       |
  133|  2.68k|   int32_t s = 1;
  134|       |
  135|  46.9k|   for(;;) {
  136|  46.9k|      const size_t e = low_zero_bits(a);
  137|  46.9k|      a >>= e;
  138|  46.9k|      const word n_mod_8 = n.word_at(0) % 8;
  139|  46.9k|      const word n_mod_4 = n_mod_8 % 4;
  140|       |
  141|  46.9k|      if(e % 2 == 1 && (n_mod_8 == 3 || n_mod_8 == 5)) {
  ------------------
  |  Branch (141:10): [True: 17.6k, False: 29.3k]
  |  Branch (141:25): [True: 4.74k, False: 12.8k]
  |  Branch (141:41): [True: 3.96k, False: 8.92k]
  ------------------
  142|  8.71k|         s = -s;
  143|  8.71k|      }
  144|       |
  145|  46.9k|      if(n_mod_4 == 3 && a % 4 == 3) {
  ------------------
  |  Branch (145:10): [True: 22.7k, False: 24.2k]
  |  Branch (145:26): [True: 10.6k, False: 12.0k]
  ------------------
  146|  10.6k|         s = -s;
  147|  10.6k|      }
  148|       |
  149|       |      /*
  150|       |      * The HAC presentation of the algorithm uses recursion, which is not
  151|       |      * desirable or necessary.
  152|       |      *
  153|       |      * Instead we loop accumulating the product of the various jacobi()
  154|       |      * subcomputations into s, until we reach algorithm termination, which
  155|       |      * occurs in one of two ways.
  156|       |      *
  157|       |      * If a == 1 then the recursion has completed; we can return the value of s.
  158|       |      *
  159|       |      * Otherwise, after swapping and reducing, check for a == 0 [this value is
  160|       |      * called `n1` in HAC's presentation]. This would imply that jacobi(n1,a1)
  161|       |      * would have the value 0, due to Line 1 in HAC 2.149, in which case the
  162|       |      * entire product is zero, and we can immediately return that result.
  163|       |      */
  164|       |
  165|  46.9k|      if(a == 1) {
  ------------------
  |  Branch (165:10): [True: 2.68k, False: 44.3k]
  ------------------
  166|  2.68k|         return s;
  167|  2.68k|      }
  168|       |
  169|  44.3k|      std::swap(a, n);
  170|       |
  171|  44.3k|      BOTAN_ASSERT_NOMSG(n.is_odd());
  ------------------
  |  |   77|  44.3k|   do {                                                                     \
  |  |   78|  44.3k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   79|  44.3k|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (79:10): [True: 0, False: 44.3k]
  |  |  ------------------
  |  |   80|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   81|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   82|      0|      }                                                                     \
  |  |   83|  44.3k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (83:12): [Folded, False: 44.3k]
  |  |  ------------------
  ------------------
  172|       |
  173|  44.3k|      a %= n;
  174|       |
  175|  44.3k|      if(a == 0) {
  ------------------
  |  Branch (175:10): [True: 0, False: 44.3k]
  ------------------
  176|      0|         return 0;
  177|      0|      }
  178|  44.3k|   }
  179|  2.68k|}
_ZN5Botan13low_zero_bitsERKNS_6BigIntE:
  194|  47.7k|size_t low_zero_bits(const BigInt& n) {
  195|  47.7k|   size_t low_zero = 0;
  196|       |
  197|  47.7k|   auto seen_nonempty_word = CT::Mask<word>::cleared();
  198|       |
  199|   419k|   for(size_t i = 0; i != n.size(); ++i) {
  ------------------
  |  Branch (199:22): [True: 372k, False: 47.7k]
  ------------------
  200|   372k|      const word x = n.word_at(i);
  201|       |
  202|       |      // ctz(0) will return sizeof(word)
  203|   372k|      const size_t tz_x = ctz(x);
  204|       |
  205|       |      // if x > 0 we want to count tz_x in total but not any
  206|       |      // further words, so set the mask after the addition
  207|   372k|      low_zero += seen_nonempty_word.if_not_set_return(tz_x);
  208|       |
  209|   372k|      seen_nonempty_word |= CT::Mask<word>::expand(x);
  210|   372k|   }
  211|       |
  212|       |   // if we saw no words with x > 0 then n == 0 and the value we have
  213|       |   // computed is meaningless. Instead return BigInt::zero() in that case.
  214|  47.7k|   return static_cast<size_t>(seen_nonempty_word.if_set_return(low_zero));
  215|  47.7k|}

_ZN5Botan23is_lucas_probable_primeERKNS_6BigIntERKNS_17Barrett_ReductionE:
   18|      1|bool is_lucas_probable_prime(const BigInt& C, const Barrett_Reduction& mod_C) {
   19|      1|   BOTAN_ARG_CHECK(C.signum() >= 0, "Argument must be non-negative");
  ------------------
  |  |   35|      1|   do {                                                          \
  |  |   36|      1|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */              \
  |  |   37|      1|      if(!(expr)) {                                              \
  |  |  ------------------
  |  |  |  Branch (37:10): [True: 0, False: 1]
  |  |  ------------------
  |  |   38|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */     \
  |  |   39|      0|         Botan::throw_invalid_argument(msg, __func__, __FILE__); \
  |  |   40|      0|      }                                                          \
  |  |   41|      1|   } while(0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 1]
  |  |  ------------------
  ------------------
   20|       |
   21|      1|   if(C == 2 || C == 3 || C == 5 || C == 7 || C == 11 || C == 13) {
  ------------------
  |  Branch (21:7): [True: 0, False: 1]
  |  Branch (21:17): [True: 0, False: 1]
  |  Branch (21:27): [True: 0, False: 1]
  |  Branch (21:37): [True: 0, False: 1]
  |  Branch (21:47): [True: 0, False: 1]
  |  Branch (21:58): [True: 0, False: 1]
  ------------------
   22|      0|      return true;
   23|      0|   }
   24|       |
   25|      1|   if(C <= 1 || C.is_even()) {
  ------------------
  |  Branch (25:7): [True: 0, False: 1]
  |  Branch (25:17): [True: 0, False: 1]
  ------------------
   26|      0|      return false;
   27|      0|   }
   28|       |
   29|      1|   BigInt D = BigInt::from_word(5);
   30|       |
   31|      5|   for(;;) {
   32|      5|      const int32_t j = jacobi(D, C);
   33|      5|      if(j == 0) {
  ------------------
  |  Branch (33:10): [True: 0, False: 5]
  ------------------
   34|      0|         return false;
   35|      0|      }
   36|       |
   37|      5|      if(j == -1) {
  ------------------
  |  Branch (37:10): [True: 1, False: 4]
  ------------------
   38|      1|         break;
   39|      1|      }
   40|       |
   41|       |      // Check 5, -7, 9, -11, 13, -15, 17, ...
   42|      4|      if(D.signum() < 0) {
  ------------------
  |  Branch (42:10): [True: 2, False: 2]
  ------------------
   43|      2|         D.flip_sign();
   44|      2|         D += 2;
   45|      2|      } else {
   46|      2|         D += 2;
   47|      2|         D.flip_sign();
   48|      2|      }
   49|       |
   50|      4|      if(D == 17 && is_perfect_square(C).signum() != 0) {
  ------------------
  |  Branch (50:10): [True: 0, False: 4]
  |  Branch (50:10): [True: 0, False: 4]
  |  Branch (50:21): [True: 0, False: 0]
  ------------------
   51|      0|         return false;
   52|      0|      }
   53|      4|   }
   54|       |
   55|      1|   if(D.signum() < 0) {
  ------------------
  |  Branch (55:7): [True: 0, False: 1]
  ------------------
   56|      0|      D += C;
   57|      0|   }
   58|       |
   59|      1|   const BigInt K = C + 1;
   60|      1|   const size_t K_bits = K.bits() - 1;
   61|       |
   62|      1|   BigInt U = BigInt::one();
   63|      1|   BigInt V = BigInt::one();
   64|       |
   65|      1|   BigInt Ut;
   66|      1|   BigInt Vt;
   67|      1|   BigInt U2;
   68|      1|   BigInt V2;
   69|       |
   70|    256|   for(size_t i = 0; i != K_bits; ++i) {
  ------------------
  |  Branch (70:22): [True: 255, False: 1]
  ------------------
   71|    255|      const bool k_bit = K.get_bit(K_bits - 1 - i);
   72|       |
   73|    255|      Ut = mod_C.multiply(U, V);
   74|       |
   75|    255|      Vt = mod_C.reduce(mod_C.square(V) + mod_C.multiply(D, mod_C.square(U)));
   76|    255|      Vt.ct_cond_add(Vt.is_odd(), C);
   77|    255|      Vt >>= 1;
   78|    255|      Vt = mod_C.reduce(Vt);
   79|       |
   80|    255|      U = Ut;
   81|    255|      V = Vt;
   82|       |
   83|    255|      U2 = mod_C.reduce(Ut + Vt);
   84|    255|      U2.ct_cond_add(U2.is_odd(), C);
   85|    255|      U2 >>= 1;
   86|       |
   87|    255|      V2 = mod_C.reduce(Vt + mod_C.multiply(Ut, D));
   88|    255|      V2.ct_cond_add(V2.is_odd(), C);
   89|    255|      V2 >>= 1;
   90|       |
   91|    255|      U.ct_cond_assign(k_bit, U2);
   92|    255|      V.ct_cond_assign(k_bit, V2);
   93|    255|   }
   94|       |
   95|      1|   return (U == 0);
   96|      1|}
_ZN5Botan24passes_miller_rabin_testERKNS_6BigIntERKNS_17Barrett_ReductionERKNS_17Montgomery_ParamsES2_:
  113|     43|                              const BigInt& a) {
  114|     43|   if(n < 3 || n.is_even()) {
  ------------------
  |  Branch (114:7): [True: 0, False: 43]
  |  Branch (114:16): [True: 0, False: 43]
  ------------------
  115|      0|      return false;
  116|      0|   }
  117|       |
  118|     43|   BOTAN_ASSERT_NOMSG(n > 1);
  ------------------
  |  |   77|     43|   do {                                                                     \
  |  |   78|     43|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   79|     43|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (79:10): [True: 0, False: 43]
  |  |  ------------------
  |  |   80|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   81|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   82|      0|      }                                                                     \
  |  |   83|     43|   } while(0)
  |  |  ------------------
  |  |  |  Branch (83:12): [Folded, False: 43]
  |  |  ------------------
  ------------------
  119|       |
  120|     43|   const BigInt n_minus_1 = n - 1;
  121|       |   /*
  122|       |   * This unpoison is not ideal but realistically there is no way to
  123|       |   * hide the number of loop iterations (below). The main user of
  124|       |   * secret primes is RSA and we always generate RSA primes such that
  125|       |   * p == 3 (mod 4), which means s is always 1.
  126|       |   */
  127|     43|   const size_t s = CT::driveby_unpoison(low_zero_bits(n_minus_1));
  128|     43|   const BigInt nm1_s = n_minus_1 >> s;
  129|     43|   const size_t n_bits = n.bits();
  130|       |
  131|     43|   const size_t powm_window = 4;
  132|       |
  133|     43|   auto powm_a_n = monty_precompute(monty_n, a, powm_window);
  134|       |
  135|     43|   BigInt y = monty_execute(*powm_a_n, nm1_s, n_bits).value();
  136|       |
  137|     43|   if(y == 1 || y == n_minus_1) {
  ------------------
  |  Branch (137:7): [True: 3, False: 40]
  |  Branch (137:17): [True: 0, False: 40]
  ------------------
  138|      3|      return true;
  139|      3|   }
  140|       |
  141|    103|   for(size_t i = 1; i != s; ++i) {
  ------------------
  |  Branch (141:22): [True: 89, False: 14]
  ------------------
  142|     89|      y = mod_n.square(y);
  143|       |
  144|     89|      if(y == 1) {  // found a non-trivial square root
  ------------------
  |  Branch (144:10): [True: 0, False: 89]
  ------------------
  145|      0|         return false;
  146|      0|      }
  147|       |
  148|       |      /*
  149|       |      -1 is the trivial square root of unity, so ``a`` is not a
  150|       |      witness for this number - give up
  151|       |      */
  152|     89|      if(y == n_minus_1) {
  ------------------
  |  Branch (152:10): [True: 26, False: 63]
  ------------------
  153|     26|         return true;
  154|     26|      }
  155|     89|   }
  156|       |
  157|     14|   return false;
  158|     40|}
_ZN5Botan30is_miller_rabin_probable_primeERKNS_6BigIntERKNS_17Barrett_ReductionERKNS_17Montgomery_ParamsERNS_21RandomNumberGeneratorEm:
  164|     15|                                    size_t test_iterations) {
  165|     15|   if(n < 3 || n.is_even()) {
  ------------------
  |  Branch (165:7): [True: 0, False: 15]
  |  Branch (165:16): [True: 0, False: 15]
  ------------------
  166|      0|      return false;
  167|      0|   }
  168|       |
  169|     44|   for(size_t i = 0; i != test_iterations; ++i) {
  ------------------
  |  Branch (169:22): [True: 43, False: 1]
  ------------------
  170|     43|      const BigInt a = BigInt::random_integer(rng, BigInt::from_word(2), n);
  171|       |
  172|     43|      if(!passes_miller_rabin_test(n, mod_n, monty_n, a)) {
  ------------------
  |  Branch (172:10): [True: 14, False: 29]
  ------------------
  173|     14|         return false;
  174|     14|      }
  175|     43|   }
  176|       |
  177|       |   // Failed to find a counterexample
  178|      1|   return true;
  179|     15|}
_ZN5Botan28miller_rabin_test_iterationsEmmb:
  181|      1|size_t miller_rabin_test_iterations(size_t n_bits, size_t prob, bool random) {
  182|      1|   const size_t base = (prob + 2) / 2;  // worst case 4^-t error rate
  183|       |
  184|       |   /*
  185|       |   * If the candidate prime was maliciously constructed, we can't rely
  186|       |   * on arguments based on p being random.
  187|       |   */
  188|      1|   if(!random) {
  ------------------
  |  Branch (188:7): [True: 0, False: 1]
  ------------------
  189|      0|      return base;
  190|      0|   }
  191|       |
  192|       |   /*
  193|       |   * For randomly chosen numbers we can use the estimates from
  194|       |   * http://www.math.dartmouth.edu/~carlp/PDF/paper88.pdf
  195|       |   *
  196|       |   * These values are derived from the inequality for p(k,t) given on
  197|       |   * the second page.
  198|       |   */
  199|      1|   if(prob <= 128) {
  ------------------
  |  Branch (199:7): [True: 1, False: 0]
  ------------------
  200|      1|      if(n_bits >= 1536) {
  ------------------
  |  Branch (200:10): [True: 0, False: 1]
  ------------------
  201|      0|         return 4;  // < 2^-133
  202|      0|      }
  203|      1|      if(n_bits >= 1024) {
  ------------------
  |  Branch (203:10): [True: 0, False: 1]
  ------------------
  204|      0|         return 6;  // < 2^-133
  205|      0|      }
  206|      1|      if(n_bits >= 512) {
  ------------------
  |  Branch (206:10): [True: 0, False: 1]
  ------------------
  207|      0|         return 12;  // < 2^-129
  208|      0|      }
  209|      1|      if(n_bits >= 256) {
  ------------------
  |  Branch (209:10): [True: 1, False: 0]
  ------------------
  210|      1|         return 29;  // < 2^-128
  211|      1|      }
  212|      1|   }
  213|       |
  214|       |   /*
  215|       |   If the user desires a smaller error probability than we have
  216|       |   precomputed error estimates for, just fall back to using the worst
  217|       |   case error rate.
  218|       |   */
  219|      0|   return base;
  220|      1|}

_ZN5Botan10ChaCha_RNGC2ENSt3__14spanIKhLm18446744073709551615EEE:
   20|      1|ChaCha_RNG::ChaCha_RNG(std::span<const uint8_t> seed) {
   21|      1|   m_hmac = MessageAuthenticationCode::create_or_throw("HMAC(SHA-256)");
   22|      1|   m_chacha = StreamCipher::create_or_throw("ChaCha(20)");
   23|      1|   clear();
   24|      1|   add_entropy(seed);
   25|      1|}
_ZN5Botan10ChaCha_RNG11clear_stateEv:
   50|      1|void ChaCha_RNG::clear_state() {
   51|      1|   m_hmac->set_key(std::vector<uint8_t>(m_hmac->output_length(), 0x00));
   52|      1|   m_chacha->set_key(m_hmac->final());
   53|      1|}
_ZN5Botan10ChaCha_RNG15generate_outputENSt3__14spanIhLm18446744073709551615EEENS2_IKhLm18446744073709551615EEE:
   55|     53|void ChaCha_RNG::generate_output(std::span<uint8_t> output, std::span<const uint8_t> input) {
   56|     53|   BOTAN_ASSERT_NOMSG(!output.empty());
  ------------------
  |  |   77|     53|   do {                                                                     \
  |  |   78|     53|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   79|     53|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (79:10): [True: 0, False: 53]
  |  |  ------------------
  |  |   80|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   81|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   82|      0|      }                                                                     \
  |  |   83|     53|   } while(0)
  |  |  ------------------
  |  |  |  Branch (83:12): [Folded, False: 53]
  |  |  ------------------
  ------------------
   57|       |
   58|     53|   if(!input.empty()) {
  ------------------
  |  Branch (58:7): [True: 0, False: 53]
  ------------------
   59|      0|      update(input);
   60|      0|   }
   61|       |
   62|     53|   m_chacha->write_keystream(output);
   63|     53|}
_ZN5Botan10ChaCha_RNG6updateENSt3__14spanIKhLm18446744073709551615EEE:
   65|      1|void ChaCha_RNG::update(std::span<const uint8_t> input) {
   66|      1|   m_hmac->update(input);
   67|      1|   m_chacha->set_key(m_hmac->final());
   68|      1|   const auto mac_key = m_chacha->keystream_bytes(m_hmac->output_length());
   69|      1|   m_hmac->set_key(mac_key);
   70|      1|}
_ZNK5Botan10ChaCha_RNG14security_levelEv:
   72|      1|size_t ChaCha_RNG::security_level() const {
   73|      1|   return 256;
   74|      1|}

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

_ZN5Botan6ChaChaC2Em:
   85|      1|ChaCha::ChaCha(size_t rounds) : m_rounds(rounds) {
   86|      1|   BOTAN_ARG_CHECK(m_rounds == 8 || m_rounds == 12 || m_rounds == 20, "ChaCha only supports 8, 12 or 20 rounds");
  ------------------
  |  |   35|      1|   do {                                                          \
  |  |   36|      1|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */              \
  |  |   37|      4|      if(!(expr)) {                                              \
  |  |  ------------------
  |  |  |  Branch (37:12): [True: 0, False: 1]
  |  |  |  Branch (37:12): [True: 0, False: 1]
  |  |  |  Branch (37:12): [True: 1, False: 0]
  |  |  ------------------
  |  |   38|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */     \
  |  |   39|      0|         Botan::throw_invalid_argument(msg, __func__, __FILE__); \
  |  |   40|      0|      }                                                          \
  |  |   41|      1|   } while(0)
  |  |  ------------------
  |  |  |  Branch (41:12): [Folded, False: 1]
  |  |  ------------------
  ------------------
   87|      1|}
_ZN5Botan6ChaCha11parallelismEv:
   89|      2|size_t ChaCha::parallelism() {
   90|      2|#if defined(BOTAN_HAS_CHACHA_AVX512)
   91|      2|   if(CPUID::has(CPUID::Feature::AVX512)) {
  ------------------
  |  Branch (91:7): [True: 0, False: 2]
  ------------------
   92|      0|      return 16;
   93|      0|   }
   94|      2|#endif
   95|       |
   96|      2|#if defined(BOTAN_HAS_CHACHA_AVX2)
   97|      2|   if(CPUID::has(CPUID::Feature::AVX2)) {
  ------------------
  |  Branch (97:7): [True: 2, False: 0]
  ------------------
   98|      2|      return 8;
   99|      2|   }
  100|      0|#endif
  101|       |
  102|      0|   return 4;
  103|      2|}
_ZN5Botan6ChaCha6chachaEPhmPjm:
  127|      5|void ChaCha::chacha(uint8_t output[], size_t output_blocks, uint32_t state[16], size_t rounds) {
  128|      5|   BOTAN_ASSERT(rounds % 2 == 0, "Valid rounds");
  ------------------
  |  |   64|      5|   do {                                                                                 \
  |  |   65|      5|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                                     \
  |  |   66|      5|      if(!(expr)) {                                                                     \
  |  |  ------------------
  |  |  |  Branch (66:10): [True: 0, False: 5]
  |  |  ------------------
  |  |   67|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                            \
  |  |   68|      0|         Botan::assertion_failure(#expr, assertion_made, __func__, __FILE__, __LINE__); \
  |  |   69|      0|      }                                                                                 \
  |  |   70|      5|   } while(0)
  |  |  ------------------
  |  |  |  Branch (70:12): [Folded, False: 5]
  |  |  ------------------
  ------------------
  129|       |
  130|      5|#if defined(BOTAN_HAS_CHACHA_AVX512)
  131|      5|   if(CPUID::has(CPUID::Feature::AVX512)) {
  ------------------
  |  Branch (131:7): [True: 0, False: 5]
  ------------------
  132|      0|      while(output_blocks >= 16) {
  ------------------
  |  Branch (132:13): [True: 0, False: 0]
  ------------------
  133|      0|         ChaCha::chacha_avx512_x16(output, state, rounds);
  134|      0|         output += 16 * 64;
  135|      0|         output_blocks -= 16;
  136|      0|      }
  137|      0|   }
  138|      5|#endif
  139|       |
  140|      5|#if defined(BOTAN_HAS_CHACHA_AVX2)
  141|      5|   if(CPUID::has(CPUID::Feature::AVX2)) {
  ------------------
  |  Branch (141:7): [True: 5, False: 0]
  ------------------
  142|     10|      while(output_blocks >= 8) {
  ------------------
  |  Branch (142:13): [True: 5, False: 5]
  ------------------
  143|      5|         ChaCha::chacha_avx2_x8(output, state, rounds);
  144|      5|         output += 8 * 64;
  145|      5|         output_blocks -= 8;
  146|      5|      }
  147|      5|   }
  148|      5|#endif
  149|       |
  150|      5|#if defined(BOTAN_HAS_CHACHA_SIMD32)
  151|      5|   if(CPUID::has(CPUID::Feature::SIMD_4X32)) {
  ------------------
  |  Branch (151:7): [True: 5, False: 0]
  ------------------
  152|      5|      while(output_blocks >= 4) {
  ------------------
  |  Branch (152:13): [True: 0, False: 5]
  ------------------
  153|      0|         ChaCha::chacha_simd32_x4(output, state, rounds);
  154|      0|         output += 4 * 64;
  155|      0|         output_blocks -= 4;
  156|      0|      }
  157|      5|   }
  158|      5|#endif
  159|       |
  160|       |   // TODO interleave rounds
  161|      5|   for(size_t i = 0; i != output_blocks; ++i) {
  ------------------
  |  Branch (161:22): [True: 0, False: 5]
  ------------------
  162|      0|      uint32_t x00 = state[0];
  163|      0|      uint32_t x01 = state[1];
  164|      0|      uint32_t x02 = state[2];
  165|      0|      uint32_t x03 = state[3];
  166|      0|      uint32_t x04 = state[4];
  167|      0|      uint32_t x05 = state[5];
  168|      0|      uint32_t x06 = state[6];
  169|      0|      uint32_t x07 = state[7];
  170|      0|      uint32_t x08 = state[8];
  171|      0|      uint32_t x09 = state[9];
  172|      0|      uint32_t x10 = state[10];
  173|      0|      uint32_t x11 = state[11];
  174|      0|      uint32_t x12 = state[12];
  175|      0|      uint32_t x13 = state[13];
  176|      0|      uint32_t x14 = state[14];
  177|      0|      uint32_t x15 = state[15];
  178|       |
  179|      0|      for(size_t r = 0; r != rounds / 2; ++r) {
  ------------------
  |  Branch (179:25): [True: 0, False: 0]
  ------------------
  180|      0|         chacha_quarter_round(x00, x04, x08, x12);
  181|      0|         chacha_quarter_round(x01, x05, x09, x13);
  182|      0|         chacha_quarter_round(x02, x06, x10, x14);
  183|      0|         chacha_quarter_round(x03, x07, x11, x15);
  184|       |
  185|      0|         chacha_quarter_round(x00, x05, x10, x15);
  186|      0|         chacha_quarter_round(x01, x06, x11, x12);
  187|      0|         chacha_quarter_round(x02, x07, x08, x13);
  188|      0|         chacha_quarter_round(x03, x04, x09, x14);
  189|      0|      }
  190|       |
  191|      0|      x00 += state[0];
  192|      0|      x01 += state[1];
  193|      0|      x02 += state[2];
  194|      0|      x03 += state[3];
  195|      0|      x04 += state[4];
  196|      0|      x05 += state[5];
  197|      0|      x06 += state[6];
  198|      0|      x07 += state[7];
  199|      0|      x08 += state[8];
  200|      0|      x09 += state[9];
  201|      0|      x10 += state[10];
  202|      0|      x11 += state[11];
  203|      0|      x12 += state[12];
  204|      0|      x13 += state[13];
  205|      0|      x14 += state[14];
  206|      0|      x15 += state[15];
  207|       |
  208|      0|      store_le(x00, output + 64 * i + 4 * 0);
  209|      0|      store_le(x01, output + 64 * i + 4 * 1);
  210|      0|      store_le(x02, output + 64 * i + 4 * 2);
  211|      0|      store_le(x03, output + 64 * i + 4 * 3);
  212|      0|      store_le(x04, output + 64 * i + 4 * 4);
  213|      0|      store_le(x05, output + 64 * i + 4 * 5);
  214|      0|      store_le(x06, output + 64 * i + 4 * 6);
  215|      0|      store_le(x07, output + 64 * i + 4 * 7);
  216|      0|      store_le(x08, output + 64 * i + 4 * 8);
  217|      0|      store_le(x09, output + 64 * i + 4 * 9);
  218|      0|      store_le(x10, output + 64 * i + 4 * 10);
  219|      0|      store_le(x11, output + 64 * i + 4 * 11);
  220|      0|      store_le(x12, output + 64 * i + 4 * 12);
  221|      0|      store_le(x13, output + 64 * i + 4 * 13);
  222|      0|      store_le(x14, output + 64 * i + 4 * 14);
  223|      0|      store_le(x15, output + 64 * i + 4 * 15);
  224|       |
  225|      0|      state[12]++;
  226|      0|      if(state[12] == 0) {
  ------------------
  |  Branch (226:10): [True: 0, False: 0]
  ------------------
  227|      0|         state[13] += 1;
  228|      0|      }
  229|      0|   }
  230|      5|}
_ZN5Botan6ChaCha18generate_keystreamEPhm:
  255|     54|void ChaCha::generate_keystream(uint8_t out[], size_t length) {
  256|     54|   assert_key_material_set();
  257|       |
  258|     57|   while(length >= m_buffer.size() - m_position) {
  ------------------
  |  Branch (258:10): [True: 3, False: 54]
  ------------------
  259|      3|      const size_t available = m_buffer.size() - m_position;
  260|       |
  261|       |      // TODO: this could write directly to the output buffer
  262|       |      // instead of bouncing it through m_buffer first
  263|      3|      copy_mem(out, &m_buffer[m_position], available);
  264|      3|      chacha(m_buffer.data(), m_buffer.size() / 64, m_state.data(), m_rounds);
  265|       |
  266|      3|      length -= available;
  267|      3|      out += available;
  268|      3|      m_position = 0;
  269|      3|   }
  270|       |
  271|     54|   copy_mem(out, &m_buffer[m_position], length);
  272|       |
  273|     54|   m_position += length;
  274|     54|}
_ZN5Botan6ChaCha16initialize_stateEv:
  276|      2|void ChaCha::initialize_state() {
  277|      2|   static const uint32_t TAU[] = {0x61707865, 0x3120646e, 0x79622d36, 0x6b206574};
  278|       |
  279|      2|   static const uint32_t SIGMA[] = {0x61707865, 0x3320646e, 0x79622d32, 0x6b206574};
  280|       |
  281|      2|   m_state[4] = m_key[0];
  282|      2|   m_state[5] = m_key[1];
  283|      2|   m_state[6] = m_key[2];
  284|      2|   m_state[7] = m_key[3];
  285|       |
  286|      2|   if(m_key.size() == 4) {
  ------------------
  |  Branch (286:7): [True: 0, False: 2]
  ------------------
  287|      0|      m_state[0] = TAU[0];
  288|      0|      m_state[1] = TAU[1];
  289|      0|      m_state[2] = TAU[2];
  290|      0|      m_state[3] = TAU[3];
  291|       |
  292|      0|      m_state[8] = m_key[0];
  293|      0|      m_state[9] = m_key[1];
  294|      0|      m_state[10] = m_key[2];
  295|      0|      m_state[11] = m_key[3];
  296|      2|   } else {
  297|      2|      m_state[0] = SIGMA[0];
  298|      2|      m_state[1] = SIGMA[1];
  299|      2|      m_state[2] = SIGMA[2];
  300|      2|      m_state[3] = SIGMA[3];
  301|       |
  302|      2|      m_state[8] = m_key[4];
  303|      2|      m_state[9] = m_key[5];
  304|      2|      m_state[10] = m_key[6];
  305|      2|      m_state[11] = m_key[7];
  306|      2|   }
  307|       |
  308|      2|   m_state[12] = 0;
  309|      2|   m_state[13] = 0;
  310|      2|   m_state[14] = 0;
  311|      2|   m_state[15] = 0;
  312|       |
  313|      2|   m_position = 0;
  314|      2|}
_ZNK5Botan6ChaCha19has_keying_materialEv:
  316|     56|bool ChaCha::has_keying_material() const {
  317|     56|   return !m_state.empty();
  318|     56|}
_ZN5Botan6ChaCha12key_scheduleENSt3__14spanIKhLm18446744073709551615EEE:
  327|      2|void ChaCha::key_schedule(std::span<const uint8_t> key) {
  328|      2|   m_key.resize(key.size() / 4);
  329|      2|   load_le<uint32_t>(m_key.data(), key.data(), m_key.size());
  330|       |
  331|      2|   m_state.resize(16);
  332|       |
  333|      2|   const size_t chacha_block = 64;
  334|      2|   m_buffer.resize(parallelism() * chacha_block);
  335|       |
  336|      2|   set_iv(nullptr, 0);
  337|      2|}
_ZNK5Botan6ChaCha8key_specEv:
  343|      2|Key_Length_Specification ChaCha::key_spec() const {
  344|      2|   return Key_Length_Specification(16, 32, 16);
  345|      2|}
_ZNK5Botan6ChaCha15valid_iv_lengthEm:
  351|      2|bool ChaCha::valid_iv_length(size_t iv_len) const {
  352|      2|   return (iv_len == 0 || iv_len == 8 || iv_len == 12 || iv_len == 24);
  ------------------
  |  Branch (352:12): [True: 2, False: 0]
  |  Branch (352:27): [True: 0, False: 0]
  |  Branch (352:42): [True: 0, False: 0]
  |  Branch (352:58): [True: 0, False: 0]
  ------------------
  353|      2|}
_ZN5Botan6ChaCha12set_iv_bytesEPKhm:
  355|      2|void ChaCha::set_iv_bytes(const uint8_t iv[], size_t length) {
  356|      2|   assert_key_material_set();
  357|       |
  358|      2|   if(!valid_iv_length(length)) {
  ------------------
  |  Branch (358:7): [True: 0, False: 2]
  ------------------
  359|      0|      throw Invalid_IV_Length(name(), length);
  360|      0|   }
  361|       |
  362|      2|   initialize_state();
  363|       |
  364|      2|   if(length == 0) {
  ------------------
  |  Branch (364:7): [True: 2, False: 0]
  ------------------
  365|       |      // Treat zero length IV same as an all-zero IV
  366|      2|      m_state[14] = 0;
  367|      2|      m_state[15] = 0;
  368|      2|   } else if(length == 8) {
  ------------------
  |  Branch (368:14): [True: 0, False: 0]
  ------------------
  369|      0|      m_state[14] = load_le<uint32_t>(iv, 0);
  370|      0|      m_state[15] = load_le<uint32_t>(iv, 1);
  371|      0|   } else if(length == 12) {
  ------------------
  |  Branch (371:14): [True: 0, False: 0]
  ------------------
  372|      0|      m_state[13] = load_le<uint32_t>(iv, 0);
  373|      0|      m_state[14] = load_le<uint32_t>(iv, 1);
  374|      0|      m_state[15] = load_le<uint32_t>(iv, 2);
  375|      0|   } else if(length == 24) {
  ------------------
  |  Branch (375:14): [True: 0, False: 0]
  ------------------
  376|      0|      m_state[12] = load_le<uint32_t>(iv, 0);
  377|      0|      m_state[13] = load_le<uint32_t>(iv, 1);
  378|      0|      m_state[14] = load_le<uint32_t>(iv, 2);
  379|      0|      m_state[15] = load_le<uint32_t>(iv, 3);
  380|       |
  381|      0|      secure_vector<uint32_t> hc(8);
  382|      0|      hchacha(hc.data(), m_state.data(), m_rounds);
  383|       |
  384|      0|      m_state[4] = hc[0];
  385|      0|      m_state[5] = hc[1];
  386|      0|      m_state[6] = hc[2];
  387|      0|      m_state[7] = hc[3];
  388|      0|      m_state[8] = hc[4];
  389|      0|      m_state[9] = hc[5];
  390|      0|      m_state[10] = hc[6];
  391|      0|      m_state[11] = hc[7];
  392|      0|      m_state[12] = 0;
  393|      0|      m_state[13] = 0;
  394|      0|      m_state[14] = load_le<uint32_t>(iv, 4);
  395|      0|      m_state[15] = load_le<uint32_t>(iv, 5);
  396|      0|   }
  397|       |
  398|      2|   chacha(m_buffer.data(), m_buffer.size() / 64, m_state.data(), m_rounds);
  399|      2|   m_position = 0;
  400|      2|}

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

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

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

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

_ZN5Botan5CPUID10CPUID_DataC2Ev:
   80|      1|CPUID::CPUID_Data::CPUID_Data() {
   81|       |   // NOLINTBEGIN(*-prefer-member-initializer)
   82|      1|#if defined(BOTAN_HAS_CPUID_DETECTION)
   83|      1|   m_processor_features = detect_cpu_features(~cleared_cpuid_bits());
   84|       |#else
   85|       |   m_processor_features = 0;
   86|       |#endif
   87|       |   // NOLINTEND(*-prefer-member-initializer)
   88|      1|}
cpuid.cpp:_ZN5Botan12_GLOBAL__N_118cleared_cpuid_bitsEv:
   59|      1|uint32_t cleared_cpuid_bits() {
   60|      1|   uint32_t cleared = 0;
   61|       |
   62|      1|   #if defined(BOTAN_HAS_OS_UTILS)
   63|      1|   std::string clear_cpuid_env;
   64|      1|   if(OS::read_env_variable(clear_cpuid_env, "BOTAN_CLEAR_CPUID")) {
  ------------------
  |  Branch (64:7): [True: 0, False: 1]
  ------------------
   65|      0|      for(const auto& cpuid : split_on(clear_cpuid_env, ',')) {
  ------------------
  |  Branch (65:29): [True: 0, False: 0]
  ------------------
   66|      0|         if(auto bit = CPUID::bit_from_string(cpuid)) {
  ------------------
  |  Branch (66:18): [True: 0, False: 0]
  ------------------
   67|      0|            cleared |= bit->as_u32();
   68|      0|         }
   69|      0|      }
   70|      0|   }
   71|      1|   #endif
   72|       |
   73|      1|   return cleared;
   74|      1|}

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

_ZN5Botan9ExceptionC2ENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
   71|      1|Exception::Exception(std::string_view msg) : m_msg(msg) {}
_ZN5Botan16Invalid_ArgumentC2ENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
   77|      1|Invalid_Argument::Invalid_Argument(std::string_view msg) : Exception(msg) {}

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

_ZN5Botan2OS14get_process_idEv:
   76|     53|uint32_t OS::get_process_id() {
   77|     53|#if defined(BOTAN_TARGET_OS_HAS_POSIX1)
   78|     53|   return ::getpid();
   79|       |#elif defined(BOTAN_TARGET_OS_HAS_WIN32)
   80|       |   return ::GetCurrentProcessId();
   81|       |#elif defined(BOTAN_TARGET_OS_IS_LLVM) || defined(BOTAN_TARGET_OS_IS_NONE)
   82|       |   return 0;  // truly no meaningful value
   83|       |#else
   84|       |   #error "Missing get_process_id"
   85|       |#endif
   86|     53|}
_ZN5Botan2OS17read_env_variableERNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS1_17basic_string_viewIcS4_EE:
  448|      1|bool OS::read_env_variable(std::string& value_out, std::string_view name_view) {
  449|      1|   value_out = "";
  450|       |
  451|      1|   if(running_in_privileged_state()) {
  ------------------
  |  Branch (451:7): [True: 0, False: 1]
  ------------------
  452|      0|      return false;
  453|      0|   }
  454|       |
  455|       |#if defined(BOTAN_TARGET_OS_HAS_WIN32) && \
  456|       |   (defined(BOTAN_BUILD_COMPILER_IS_MSVC) || defined(BOTAN_BUILD_COMPILER_IS_CLANGCL))
  457|       |   const std::string name(name_view);
  458|       |   char val[128] = {0};
  459|       |   size_t req_size = 0;
  460|       |   if(getenv_s(&req_size, val, sizeof(val), name.c_str()) == 0) {
  461|       |      // Microsoft's implementation always writes a terminating \0,
  462|       |      // and includes it in the reported length of the environment variable
  463|       |      // if a value exists.
  464|       |      if(req_size > 0 && val[req_size - 1] == '\0') {
  465|       |         value_out = std::string(val);
  466|       |      } else {
  467|       |         value_out = std::string(val, req_size);
  468|       |      }
  469|       |      return true;
  470|       |   }
  471|       |#else
  472|      1|   const std::string name(name_view);
  473|      1|   if(const char* val = std::getenv(name.c_str())) {
  ------------------
  |  Branch (473:19): [True: 0, False: 1]
  ------------------
  474|      0|      value_out = val;
  475|      0|      return true;
  476|      0|   }
  477|      1|#endif
  478|       |
  479|      1|   return false;
  480|      1|}
os_utils.cpp:_ZN5Botan12_GLOBAL__N_110get_auxvalENSt3__18optionalImEE:
  118|      1|std::optional<unsigned long> get_auxval(std::optional<unsigned long> id) {
  119|      1|   if(id) {
  ------------------
  |  Branch (119:7): [True: 1, False: 0]
  ------------------
  120|      1|#if defined(BOTAN_TARGET_OS_HAS_GETAUXVAL)
  121|      1|      return ::getauxval(*id);
  122|       |#elif defined(BOTAN_TARGET_OS_HAS_ELF_AUX_INFO)
  123|       |      unsigned long auxinfo = 0;
  124|       |      if(::elf_aux_info(static_cast<int>(*id), &auxinfo, sizeof(auxinfo)) == 0) {
  125|       |         return auxinfo;
  126|       |      }
  127|       |#endif
  128|      1|   }
  129|       |
  130|      0|   return {};
  131|      1|}
os_utils.cpp:_ZN5Botan12_GLOBAL__N_127running_in_privileged_stateEv:
  152|      1|bool running_in_privileged_state() {
  153|      1|#if defined(AT_SECURE)
  154|      1|   if(auto at_secure = get_auxval(AT_SECURE)) {
  ------------------
  |  Branch (154:12): [True: 1, False: 0]
  ------------------
  155|      1|      return at_secure != 0;
  156|      1|   }
  157|      0|#endif
  158|       |
  159|      0|#if defined(BOTAN_TARGET_OS_HAS_POSIX1)
  160|      0|   return (::getuid() != ::geteuid()) || (::getgid() != ::getegid());
  ------------------
  |  Branch (160:11): [True: 0, False: 0]
  |  Branch (160:42): [True: 0, False: 0]
  ------------------
  161|       |#else
  162|       |   return false;
  163|       |#endif
  164|      1|}

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

_ZN5Botan9SCAN_NameC2ENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
   58|      2|SCAN_Name::SCAN_Name(std::string_view algo_spec) : m_orig_algo_spec(algo_spec) {
   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(const char c : algo_spec) {
  ------------------
  |  Branch (69:21): [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|}

