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

randombit / botan / 13217016155

08 Feb 2025 03:35PM UTC coverage: 91.656% (-0.008%) from 91.664%
13217016155

Pull #4647

github

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

94830 of 103463 relevant lines covered (91.66%)

11225521.0 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) {
72✔
18
   uint8_t inb[sizeof(val)];
72✔
19
   store_be(val, inb);
72✔
20
   add_data({inb, sizeof(inb)});
72✔
21
}
72✔
22

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

29
void Buffered_Computation::update_be(uint64_t val) {
7,929✔
30
   uint8_t inb[sizeof(val)];
7,929✔
31
   store_be(val, inb);
7,929✔
32
   add_data({inb, sizeof(inb)});
7,929✔
33
}
7,929✔
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) {
197,159,396✔
54
   BOTAN_ARG_CHECK(out.size() >= output_length(), "provided output buffer has insufficient capacity");
197,159,396✔
55
   final_result(out);
197,159,396✔
56
}
197,159,396✔
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