/src/botan/src/lib/base/buf_comp.cpp
Line | Count | Source (jump to first uncovered line) |
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 | 0 | void Buffered_Computation::update_be(uint16_t val) { |
14 | 0 | uint8_t inb[sizeof(val)]; |
15 | 0 | store_be(val, inb); |
16 | 0 | add_data({inb, sizeof(inb)}); |
17 | 0 | } |
18 | | |
19 | 24.5k | void Buffered_Computation::update_be(uint32_t val) { |
20 | 24.5k | uint8_t inb[sizeof(val)]; |
21 | 24.5k | store_be(val, inb); |
22 | 24.5k | add_data({inb, sizeof(inb)}); |
23 | 24.5k | } |
24 | | |
25 | 0 | void Buffered_Computation::update_be(uint64_t val) { |
26 | 0 | uint8_t inb[sizeof(val)]; |
27 | 0 | store_be(val, inb); |
28 | 0 | add_data({inb, sizeof(inb)}); |
29 | 0 | } |
30 | | |
31 | 0 | void Buffered_Computation::update_le(uint16_t val) { |
32 | 0 | uint8_t inb[sizeof(val)]; |
33 | 0 | store_le(val, inb); |
34 | 0 | add_data({inb, sizeof(inb)}); |
35 | 0 | } |
36 | | |
37 | 131k | void Buffered_Computation::update_le(uint32_t val) { |
38 | 131k | uint8_t inb[sizeof(val)]; |
39 | 131k | store_le(val, inb); |
40 | 131k | add_data({inb, sizeof(inb)}); |
41 | 131k | } |
42 | | |
43 | 34.3k | void Buffered_Computation::update_le(uint64_t val) { |
44 | 34.3k | uint8_t inb[sizeof(val)]; |
45 | 34.3k | store_le(val, inb); |
46 | 34.3k | add_data({inb, sizeof(inb)}); |
47 | 34.3k | } |
48 | | |
49 | | } // namespace Botan |