Skip to main content

Module integrity

Module integrity 

Source
Expand description

Structural Integrity — Zero-trust module self-checksumming.

Replaces coreason_runtime/execution_plane/integrity.py.

Enforces the zero-trust structural integrity of the runtime by providing self-checksumming capabilities. Mathematically hashes source content at runtime to detect “Fork-and-Patch” attacks where critical cryptographic components (like the license verifier) might have been tampered with.

Zero Waste: SHA-256 delegated to sha2 (MIT/Apache-2.0). Ed25519 signature verification delegated to ed25519-dalek (BSD-3-Clause). Memory-mapped file I/O delegated to memmap2 (MIT/Apache-2.0). Thread-safe caching delegated to dashmap (MIT).

Structs§

IntegrityViolationError
Raised when structural integrity verification fails.

Functions§

assert_module_integrity
Full module integrity check with caching.
check_cache
Check if a module has already been verified (cache hit).
clear_cache
Clear the entire verification cache.
update_cache
Store a successful verification result in the cache.
verify_file_hash
Verify a file’s SHA-256 hash using memory-mapped I/O.
verify_module_integrity
Verify source code integrity via SHA-256 checksum.
verify_signature
Verify an Ed25519 signature over a message.