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

randombit / botan / 13274522654

11 Feb 2025 11:26PM UTC coverage: 91.645% (-0.007%) from 91.652%
13274522654

push

github

web-flow
Merge pull request #4647 from randombit/jack/internal-assert-and-mem-ops

Avoid using mem_ops.h or assert.h in public headers

94854 of 103501 relevant lines covered (91.65%)

11334975.77 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,508✔
24
   uint8_t inb[sizeof(val)];
141,508✔
25
   store_be(val, inb);
141,508✔
26
   add_data({inb, sizeof(inb)});
141,508✔
27
}
141,508✔
28

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