Skip to content

Commit 329de94

Browse files
moving sha256 class out of namespace
1 parent df68388 commit 329de94

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

src/sha256/SHA256.h

+19-19
Original file line numberDiff line numberDiff line change
@@ -27,27 +27,27 @@ namespace arduino { namespace sha256 {
2727
::acu_sha256(input, ilen, output);
2828
}
2929

30-
class SHA256 {
31-
public:
30+
}} // arduino::sha256
3231

33-
static constexpr uint32_t HASH_SIZE = SHA256_DIGEST_SIZE;
32+
class SHA256 {
33+
public:
3434

35-
inline void begin() {
36-
return arduino::sha256::begin(&_ctx);
37-
}
38-
inline void update(uint8_t const * data, uint32_t const len) {
39-
return arduino::sha256::update(&_ctx, data, len);
40-
}
41-
inline void finalize(uint8_t * hash) {
42-
return arduino::sha256::finalize(&_ctx, hash);
43-
}
44-
static inline void sha256(uint8_t const * data, uint32_t const len, uint8_t * hash) {
45-
return arduino::sha256::sha256(data, len, hash);
46-
}
35+
static constexpr uint32_t HASH_SIZE = SHA256_DIGEST_SIZE;
4736

48-
private:
37+
inline void begin() {
38+
return arduino::sha256::begin(&_ctx);
39+
}
40+
inline void update(uint8_t const * data, uint32_t const len) {
41+
return arduino::sha256::update(&_ctx, data, len);
42+
}
43+
inline void finalize(uint8_t * hash) {
44+
return arduino::sha256::finalize(&_ctx, hash);
45+
}
46+
static inline void sha256(uint8_t const * data, uint32_t const len, uint8_t * hash) {
47+
return arduino::sha256::sha256(data, len, hash);
48+
}
4949

50-
acu_sha256_ctx _ctx;
51-
};
50+
private:
5251

53-
}} // arduino::sha256
52+
acu_sha256_ctx _ctx;
53+
};

0 commit comments

Comments
 (0)