summaryrefslogtreecommitdiffstats
path: root/apps/plugins/crypt_firmware.c
diff options
context:
space:
mode:
authorJames Buren <braewoods+rb@braewoods.net>2020-11-21 17:58:01 +0000
committerWilliam Wilgus <me.theuser@yahoo.com>2020-11-22 05:12:04 +0000
commit6b3b4df6f64f1523b76d5f4f26c568ffc208a899 (patch)
treee3a0f2fe2562baf140655718288e92839b7474fa /apps/plugins/crypt_firmware.c
parent2eb191a3f408281fde2fbd0003f2bdd6c2234970 (diff)
downloadrockbox-6b3b4df6f64f1523b76d5f4f26c568ffc208a899.tar.gz
rockbox-6b3b4df6f64f1523b76d5f4f26c568ffc208a899.tar.bz2
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.c14
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 @@
*/
#include "plugin.h"
-
-
+#include "checksum.h"
static void aes_encrypt(void* data, uint32_t size)
{
@@ -133,17 +132,6 @@ static void put_uint32be(unsigned char* buf, uint32_t x)
buf[3] = x & 0xff;
}
-static uint32_t calc_checksum(uint32_t sum, unsigned char* buf, int len)
-{
- int i;
-
- for (i = 0; i < len ; i++) {
- sum += buf[i];
- }
-
- return sum;
-}
-
enum plugin_status plugin_start(const void* parameter)
{
int fd;