png-chunk-framing

Verify PNG chunk parsing, serialization, and CRC32 correctness with Lean 4 and lean-zip.

1|Updated Apr 14, 2026
One-click install
npx skills add https://github.com/fmhall/lean-png --skill png-chunk-framing
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: png-chunk-framing
Source: https://github.com/fmhall/lean-png/tree/main/.claude/skills/png-chunk-framing
Command: npx skills add https://github.com/fmhall/lean-png --skill png-chunk-framing

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires lean, lean-zip, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill assists in the implementation and verification of properties related to PNG chunk parsing, serialization, and CRC32 validation, enhancing the reliability of PNG handling.

Core Features & Use Cases

  • PNG Chunk Parsing: Offers guidance on implementing or proving properties about PNG chunk parsing and serialization.
  • CRC32 Validation: Integrates CRC32 validation for ensuring data integrity.
  • Use Case: It is beneficial for developers working on formally verified PNG decoders or for anyone needing to ensure the correctness of PNG chunk handling in their applications.

Quick Start

Utilize the png-chunk-framing skill to validate the CRC32 of a PNG chunk with the type 'IHDR' and data 'example_data'.

Frequently Asked Questions about png-chunk-framing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I verify PNG chunk parsing and serialization correctness?

CRC32 validation ensures PNG chunk data integrity by detecting corruption during parsing or serialization. It is needed whenever you are implementing or verifying a PNG decoder to confirm that file chunks have not been altered or damaged.

Do I need Lean 4 to formally verify CRC32 validation for PNG files?

Formal verification in Lean 4 offers mathematical proofs of correctness for PNG chunk parsing and CRC32 validation, guaranteeing reliability. Standard testing only checks specific cases, whereas formal methods prove your serialization logic handles all possible valid PNG chunk structures.

What's the best way to validate a PNG chunk with a specific type like IHDR?

The best way to validate a specific PNG chunk like IHDR is to verify its CRC32 checksum against the chunk type and data. You can use formal verification to prove that your parsing logic correctly extracts and validates the IHDR chunk structure and data integrity.

Does formal verification of PNG chunk handling work with existing decoders?

Formal verification of PNG chunk handling can be integrated with existing decoder implementations to prove their correctness. By verifying properties related to parsing, serialization, and CRC32 validation, you enhance the reliability of your current PNG file processing logic.