• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

randombit / botan / 16281495784

15 Jul 2025 01:06AM UTC coverage: 90.626% (+0.004%) from 90.622%
16281495784

Pull #4990

github

web-flow
Merge 5ed2f9c78 into e18675f45
Pull Request #4990: Improve string<->span conversions

99639 of 109945 relevant lines covered (90.63%)

12428551.29 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

86.49
/src/lib/base/buf_comp.cpp
1
/*
2
* (C) 2019 Jack Lloyd
3
*
4
* Botan is released under the Simplified BSD License (see license.txt)
5
*/
6

7
#include <botan/buf_comp.h>
8

9
#include <botan/internal/loadstor.h>
10
#include <botan/internal/mem_utils.h>
11

12
namespace Botan {
13

14
void Buffered_Computation::update(std::string_view str) {
12,635✔
15
   add_data(as_span_of_bytes(str));
12,635✔
16
}
12,635✔
17

18
void Buffered_Computation::update_be(uint16_t val) {
90✔
19
   uint8_t inb[sizeof(val)];
90✔
20
   store_be(val, inb);
90✔
21
   add_data({inb, sizeof(inb)});
90✔
22
}
90✔
23

24
void Buffered_Computation::update_be(uint32_t val) {
141,841✔
25
   uint8_t inb[sizeof(val)];
141,841✔
26
   store_be(val, inb);
141,841✔
27
   add_data({inb, sizeof(inb)});
141,841✔
28
}
141,841✔
29

30
void Buffered_Computation::update_be(uint64_t val) {
7,928✔
31
   uint8_t inb[sizeof(val)];
7,928✔
32
   store_be(val, inb);
7,928✔
33
   add_data({inb, sizeof(inb)});
7,928✔
34
}
7,928✔
35

36
void Buffered_Computation::update_le(uint16_t val) {
×
37
   uint8_t inb[sizeof(val)];
×
38
   store_le(val, inb);
×
39
   add_data({inb, sizeof(inb)});
×
40
}
×
41

42
void Buffered_Computation::update_le(uint32_t val) {
32,182✔
43
   uint8_t inb[sizeof(val)];
32,182✔
44
   store_le(val, inb);
32,182✔
45
   add_data({inb, sizeof(inb)});
32,182✔
46
}
32,182✔
47

48
void Buffered_Computation::update_le(uint64_t val) {
143,104✔
49
   uint8_t inb[sizeof(val)];
143,104✔
50
   store_le(val, inb);
143,104✔
51
   add_data({inb, sizeof(inb)});
143,104✔
52
}
143,104✔
53

54
void Buffered_Computation::final(std::span<uint8_t> out) {
196,471,643✔
55
   BOTAN_ARG_CHECK(out.size() >= output_length(), "provided output buffer has insufficient capacity");
196,471,643✔
56
   final_result(out);
196,471,643✔
57
}
196,471,643✔
58

59
}  // namespace Botan
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc