INNER CODE UNIT · C

res

dmitrystu/sboot_stm32 · src/checksum.c:124

        int res = x[i] - y[i];
        if (res != 0) return res;
     }
    return 0;
}

const size_t checksum_length = sizeof(checksum_t);

size_t append_checksum(void *data, size_t len, size_t bsize) {
    checksum_t cs;
    uint8_t *buf = data;
    if (bsize < len + sizeof(checksum_t)) {
        return 0;
    }
    init_checksum(&cs);
    for (size_t i = 0; i < len; i++) {
        update_checksum(&cs, *buf);
        buf++;

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…