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

randombit / botan / 16293079084

15 Jul 2025 12:20PM UTC coverage: 90.627% (+0.003%) from 90.624%
16293079084

push

github

web-flow
Merge pull request #4990 from randombit/jack/string-and-span

Improve string<->span conversions

99640 of 109945 relevant lines covered (90.63%)

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

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

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