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§
- Integrity
Violation Error - 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.