SOL-XPILE-001 // xpile
Legacy C CRC32 Kernel to Safe Rust
Lift a pointer-arithmetic C CRC32 routine into bounds-checked, zero-unsafe Rust with bit-exact RFC 1952 test vectors.
Measured delta: 0 unsafe blocks; bit-exact RFC 1952 CRC32 vector 0xCBF43926
Before (Failing Anti-Pattern)
unsigned int crc_raw(unsigned char *p, int n) {
unsigned int c = 0; while (n--) c ^= *p++; return c; // raw ptr UB
}
After (Verified Code)
unsigned int crc32_step(unsigned int crc, unsigned int byte) {
crc = crc ^ byte;
return crc >> 1;
}
Verification Contract
schema: xpile.contract.v1 source_lang: c99 target_lang: rust forbid_unsafe: true rfc_vector: "123456789 -> 0xCBF43926"
Verified CLI Command & Output
$ xpile transpile crc32.c --target rust // xpile-generated from C module crc32