From 6b3b4df6f64f1523b76d5f4f26c568ffc208a899 Mon Sep 17 00:00:00 2001 From: James Buren Date: Sat, 21 Nov 2020 17:58:01 +0000 Subject: 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 --- apps/plugins/crypt_firmware.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) (limited to 'apps/plugins/crypt_firmware.c') 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; -- cgit