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

randombit / botan / 13257645065

11 Feb 2025 07:10AM UTC coverage: 91.65% (-0.009%) from 91.659%
13257645065

Pull #4647

github

web-flow
Merge b9f3a0603 into f372b5a9e
Pull Request #4647: Avoid using mem_ops.h or assert.h in public headers

94860 of 103502 relevant lines covered (91.65%)

11460675.71 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

11
namespace Botan {
12

13
void Buffered_Computation::update(std::string_view str) {
12,393✔
14
   add_data({cast_char_ptr_to_uint8(str.data()), str.size()});
12,393✔
15
}
12,393✔
16

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

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

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

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

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

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

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

58
}  // 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