diff options
author | James Buren <braewoods+rb@braewoods.net> | 2020-11-21 17:58:01 +0000 |
---|---|---|
committer | William Wilgus <me.theuser@yahoo.com> | 2020-11-22 05:12:04 +0000 |
commit | 6b3b4df6f64f1523b76d5f4f26c568ffc208a899 (patch) | |
tree | e3a0f2fe2562baf140655718288e92839b7474fa /apps/plugins/crypt_firmware.c | |
parent | 2eb191a3f408281fde2fbd0003f2bdd6c2234970 (diff) | |
download | rockbox-6b3b4df6f64f1523b76d5f4f26c568ffc208a899.tar.gz rockbox-6b3b4df6f64f1523b76d5f4f26c568ffc208a899.zip |
rockbox: move firmware checksum algorithms into a common header
Before this was just implemented inline wherever it was needed. Now
it is provided as 2 inline functions in a header called checksum.h.
There should be no differences in actual behavior.
Change-Id: I5d756cc01dc6225f5cc8b6af90911a3fc7b57cd5
Diffstat (limited to 'apps/plugins/crypt_firmware.c')
-rw-r--r-- | apps/plugins/crypt_firmware.c | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/apps/plugins/crypt_firmware.c b/apps/plugins/crypt_firmware.c index f9bdd4d031..14e9c2be96 100644 --- a/apps/plugins/crypt_firmware.c +++ b/apps/plugins/crypt_firmware.c | |||
@@ -36,8 +36,7 @@ | |||
36 | */ | 36 | */ |
37 | 37 | ||
38 | #include "plugin.h" | 38 | #include "plugin.h" |
39 | 39 | #include "checksum.h" | |
40 | |||
41 | 40 | ||
42 | static void aes_encrypt(void* data, uint32_t size) | 41 | static void aes_encrypt(void* data, uint32_t size) |
43 | { | 42 | { |
@@ -133,17 +132,6 @@ static void put_uint32be(unsigned char* buf, uint32_t x) | |||
133 | buf[3] = x & 0xff; | 132 | buf[3] = x & 0xff; |
134 | } | 133 | } |
135 | 134 | ||
136 | static uint32_t calc_checksum(uint32_t sum, unsigned char* buf, int len) | ||
137 | { | ||
138 | int i; | ||
139 | |||
140 | for (i = 0; i < len ; i++) { | ||
141 | sum += buf[i]; | ||
142 | } | ||
143 | |||
144 | return sum; | ||
145 | } | ||
146 | |||
147 | enum plugin_status plugin_start(const void* parameter) | 135 | enum plugin_status plugin_start(const void* parameter) |
148 | { | 136 | { |
149 | int fd; | 137 | int fd; |