forked from len0rd/rockbox
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
This commit is contained in:
parent
2eb191a3f4
commit
6b3b4df6f6
4 changed files with 47 additions and 30 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue