INNER CODE UNIT · C

__memcmp

dmitrystu/sboot_stm32 · src/checksum.c:120

static int __memcmp(const void *a, const void *b, size_t len) {
    const int8_t *x = a;
    const int8_t *y = b;
    for(size_t i = 0; i < len; i++){
        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;
    }

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…