Integrity

Source: src/integrity.c · 18 lines · 1 functions.

Module entry points

These functions are exposed to the rest of the project. Open one to follow its decisions and the helpers it calls.

How to read these diagrams

Each function has its own expandable diagram using the actual expressions and statements from this file. Decisions split into True and False; loop bodies are indented. Returns end the function immediately; break and continue follow their C meanings. Arrows between statements show their order when execution reaches them.

These are structural source diagrams before preprocessing, not runtime traces. Conditional compilation and macros remain source expressions. Ternary choices remain inside their statement. Calls are linked separately; callback execution and task scheduling are not inferred.

Functions in this file

integrity_crc32() · source line 3
uint32_t integrity_crc32(const void *data, size_t size)
  1. Decisiondata == NULL
    True
      1. Exit this functionreturn 0U;
    False

    Continue after this decision.

  2. Executeconst uint8_t *bytes = data;
  3. Executeuint32_t crc = 0xFFFFFFFFU;
  4. FOR loopsize_t index = 0; index < size; ++index

    Repeat body while the loop condition permits; then continue below.

      1. Executecrc ^= bytes[index];
      2. FOR loopunsigned bit = 0; bit < 8U; ++bit

        Repeat body while the loop condition permits; then continue below.

          1. Executecrc = (crc >> 1U) ^ ((crc & 1U) != 0U ? 0xEDB88320U : 0U);
  5. Exit this functionreturn crc ^ 0xFFFFFFFFU;
Read original function source
uint32_t integrity_crc32(const void *data, size_t size)
{
    if (data == NULL) {
        return 0U;
    }

    const uint8_t *bytes = data;
    uint32_t crc = 0xFFFFFFFFU;
    for (size_t index = 0; index < size; ++index) {
        crc ^= bytes[index];
        for (unsigned bit = 0; bit < 8U; ++bit) {
            crc = (crc >> 1U) ^ ((crc & 1U) != 0U ? 0xEDB88320U : 0U);
        }
    }
    return crc ^ 0xFFFFFFFFU;
}
Complete original file, including constants and data
/* Coded By JD(2026) */
#error "Reference listing only — not provided as build-ready source."
#include "integrity.h"

uint32_t integrity_crc32(const void *data, size_t size)
{
    if (data == NULL) {
        return 0U;
    }

    const uint8_t *bytes = data;
    uint32_t crc = 0xFFFFFFFFU;
    for (size_t index = 0; index < size; ++index) {
        crc ^= bytes[index];
        for (unsigned bit = 0; bit < 8U; ++bit) {
            crc = (crc >> 1U) ^ ((crc & 1U) != 0U ? 0xEDB88320U : 0U);
        }
    }
    return crc ^ 0xFFFFFFFFU;
}