Skip to content

Commit 403e6a3

Browse files
committed
removed all trailing spaces in all header files
1 parent d50f00c commit 403e6a3

File tree

181 files changed

+4407
-4233
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

181 files changed

+4407
-4233
lines changed

klib/crypt/base32.hpp

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
namespace klib::crypt {
1111
/**
1212
* @brief Base32
13-
*
13+
*
1414
* @note implemented using: https://datatracker.ietf.org/doc/html/rfc4648#section-6
1515
*/
1616
class base32 {
@@ -20,12 +20,12 @@ namespace klib::crypt {
2020

2121
/**
2222
* @brief Checks if a character is a valid base32 character
23-
*
23+
*
2424
* @details valid characters are: A-Z and 2-7
25-
*
26-
* @param ch
27-
* @return true
28-
* @return false
25+
*
26+
* @param ch
27+
* @return true
28+
* @return false
2929
*/
3030
constexpr static bool is_valid_character(const char ch) {
3131
// check if above highest valid character
@@ -36,7 +36,7 @@ namespace klib::crypt {
3636
// check if below lowest valid number
3737
if (ch < '2') {
3838
return false;
39-
}
39+
}
4040

4141
// check if between the valid numbers and the lowest
4242
// valid character
@@ -50,11 +50,11 @@ namespace klib::crypt {
5050

5151
/**
5252
* @brief Convert a base32 character to a 5 bit value
53-
*
53+
*
5454
* @warning does not check if character are valid
55-
*
56-
* @param ch
57-
* @return constexpr uint8_t
55+
*
56+
* @param ch
57+
* @return constexpr uint8_t
5858
*/
5959
constexpr static uint8_t character_to_value(const char ch) {
6060
if (ch >= 'A' && ch <= 'Z') {
@@ -67,11 +67,11 @@ namespace klib::crypt {
6767
public:
6868
/**
6969
* @brief Decode a base32 string
70-
*
71-
* @param input
70+
*
71+
* @param input
7272
* @param output
73-
* @param size
74-
* @return uint32_t amount of bytes written in
73+
* @param size
74+
* @return uint32_t amount of bytes written in
7575
* output (0 if invalid)
7676
*/
7777
constexpr static uint32_t decode(const char *const input, const std::span<uint8_t> output) {
@@ -83,7 +83,7 @@ namespace klib::crypt {
8383
// check the length
8484
if (((length % 8) != 0) || (!length)) {
8585
return false;
86-
}
86+
}
8787

8888
// check if the output size fits
8989
if ((((length * 5) + 7) / 8) > output.size()) {
@@ -99,7 +99,7 @@ namespace klib::crypt {
9999
// amount of bytes processed
100100
uint32_t processed = 0;
101101

102-
// check if every character is a valid character. The last
102+
// check if every character is a valid character. The last
103103
// characters can be '=' instead of valid characters as this is
104104
// the value used as padding
105105
for (uint32_t i = 0; i < length; i++) {
@@ -113,7 +113,7 @@ namespace klib::crypt {
113113
return false;
114114
}
115115

116-
// check if we have a valid character after we detected
116+
// check if we have a valid character after we detected
117117
// padding
118118
if (valid && padding_started) {
119119
return false;

klib/crypt/hmac.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
namespace klib::crypt {
99
/**
1010
* @brief Hmac implementation
11-
*
12-
* @tparam T
11+
*
12+
* @tparam T
1313
*/
1414
template <typename T>
1515
class hmac {
@@ -34,7 +34,7 @@ namespace klib::crypt {
3434
return buffer;
3535
}
3636

37-
public:
37+
public:
3838
static auto hash(const uint8_t *const key, const uint32_t k_length, const uint8_t *const message, const uint32_t m_length) {
3939
// compute the block sized key
4040
const auto block_key = compute_block_sized_key(key, k_length);

klib/crypt/hotp.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
namespace klib::crypt {
1111
/**
1212
* @brief Hotp implementation
13-
*
14-
* @tparam T
15-
* @tparam Digits
13+
*
14+
* @tparam T
15+
* @tparam Digits
1616
*/
1717
template <typename T, uint32_t Digits = 6>
1818
class hotp {

klib/crypt/sha1.hpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
namespace klib::crypt {
1010
/**
1111
* @brief Sha1 hash. C++ implementation inspired by [novan-ve/ft_ssl](https://github.com/novan-ve/ft_ssl)
12-
*
12+
*
1313
*/
1414
class sha1 {
1515
public:
@@ -102,26 +102,26 @@ namespace klib::crypt {
102102
public:
103103
/**
104104
* @brief Construct a new sha1 object
105-
*
105+
*
106106
*/
107107
sha1() {}
108108

109109
/**
110110
* @brief Construct a new sha1 object and call update on the data
111-
*
112-
* @param data
113-
* @param length
111+
*
112+
* @param data
113+
* @param length
114114
*/
115115
sha1(const uint8_t *const data, const uint32_t length) {
116116
update(data, length);
117117
}
118118

119119
/**
120-
* @brief Update the internal structure with the provided
120+
* @brief Update the internal structure with the provided
121121
* data
122-
*
123-
* @param data
124-
* @param length
122+
*
123+
* @param data
124+
* @param length
125125
*/
126126
void update(const uint8_t *const data, const uint32_t length) {
127127
uint32_t input[16];
@@ -141,10 +141,10 @@ namespace klib::crypt {
141141
}
142142

143143
/**
144-
* @brief Finalize the hash. After this function is called update
144+
* @brief Finalize the hash. After this function is called update
145145
* should not be called anymore
146-
*
147-
* @return digest
146+
*
147+
* @return digest
148148
*/
149149
std::array<uint8_t, digest_size> finalize() {
150150
const uint64_t offset = size % block_size;
@@ -167,7 +167,7 @@ namespace klib::crypt {
167167
input[15] = (uint32_t)(ssize >> 32);
168168

169169
// the buffer is full calculate now
170-
calc(input);
170+
calc(input);
171171

172172
// copy the hash to the digest
173173
std::array<uint8_t, digest_size> ret;
@@ -184,4 +184,4 @@ namespace klib::crypt {
184184
};
185185
}
186186

187-
#endif
187+
#endif

klib/crypt/totp.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
namespace klib::crypt {
99
/**
1010
* @brief Totp implementation for one time passwords
11-
*
12-
* @tparam T
13-
* @tparam Digits
11+
*
12+
* @tparam T
13+
* @tparam Digits
1414
*/
1515
template <typename T, uint32_t Digits = 6>
1616
class totp {

klib/delay.hpp

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,20 @@
1313
namespace klib::detail {
1414
/**
1515
* @brief Flag for waiting until a timer is triggered
16-
*
17-
* @tparam Timer
16+
*
17+
* @tparam Timer
1818
*/
1919
template <typename Timer>
2020
static volatile bool done = false;
2121

2222
/**
23-
* @brief Delay using a hardware timer. Max wait
24-
* time is 1 second.
25-
*
23+
* @brief Delay using a hardware timer. Max wait
24+
* time is 1 second.
25+
*
2626
* @warning Input is not checked.
27-
*
27+
*
2828
* @tparam Timer
29-
* @param time
29+
* @param time
3030
*/
3131
template <typename Timer, bool LowPowerSleep>
3232
static void timer_delay_impl(const time::us time) {
@@ -62,12 +62,12 @@ namespace klib::detail {
6262
}
6363

6464
/**
65-
* @brief Delay using the systick timer. Timing accuracy depends
65+
* @brief Delay using the systick timer. Timing accuracy depends
6666
* on the cpu accuracy.
67-
*
68-
* @tparam Timer
69-
* @tparam T
70-
* @param time
67+
*
68+
* @tparam Timer
69+
* @tparam T
70+
* @param time
7171
*/
7272
template <typename Timer, bool LowPowerSleep>
7373
static void systick_delay_impl(const time::us time) {
@@ -86,21 +86,21 @@ namespace klib::detail {
8686
}
8787
}
8888

89-
// wait until the counter goes over the count we
90-
// had before
89+
// wait until the counter goes over the count we
90+
// had before
9191
while (Timer::template get_runtime<time::us>() < target) {
92-
// wait and do nothing. We cannot use the low power sleep here as
92+
// wait and do nothing. We cannot use the low power sleep here as
9393
// no interrupt will trigger
9494
}
9595
}
9696

9797
/**
9898
* @brief Do a busy wait for time amount of microseconds
99-
*
100-
* @warning is a rough estimation based on the cpu clock and the
99+
*
100+
* @warning is a rough estimation based on the cpu clock and the
101101
* amount of instructions used in a loop with optimization -Os
102-
*
103-
* @param time
102+
*
103+
* @param time
104104
*/
105105
static void __attribute__((__optimize__("-Os"))) busy_delay_impl(const time::us time) {
106106
// get the cpu speed
@@ -120,23 +120,23 @@ namespace klib::detail {
120120

121121
namespace klib {
122122
/**
123-
* @brief Type that should be used for a loop that does
123+
* @brief Type that should be used for a loop that does
124124
* a busy wait.
125-
*
126-
* @warning this a aproximation. for accurate timing a
125+
*
126+
* @warning this a aproximation. for accurate timing a
127127
* timer should be used
128-
*
128+
*
129129
*/
130130
struct busy_wait {};
131131

132132
/**
133133
* @brief Delay using a hardware timer. The systick timer
134134
* has its own implementation that limits the accuracy to
135135
* 1 micro second
136-
*
137-
* @tparam Timer
138-
* @tparam T
139-
* @param time
136+
*
137+
* @tparam Timer
138+
* @tparam T
139+
* @param time
140140
*/
141141
template <
142142
typename Timer = io::systick<>,
@@ -151,7 +151,7 @@ namespace klib {
151151
Timer::get_runtime();
152152
};
153153

154-
// delay in 1 second intervals as some timers
154+
// delay in 1 second intervals as some timers
155155
// do not support frequencies below 1hz
156156
for (uint32_t i = 0; i < sec.value; i++) {
157157
if constexpr (std::is_same_v<Timer, klib::busy_wait>) {

0 commit comments

Comments
 (0)