Implement a C interop regression test for passphrase hashing (crypt.h)
- Type: test
- Status: done
- Closed 2026-06-29 (board cleanup):
test/test_c_crypt.paswired inMakefile:1214with pass-assertion (commit0d695bfc). Left stuck at in-progress. - Track: C (C frontend interop testing)
- Owner: Antigravity
- Opened: 2026-06-28
Motivation
To verify the robustness and correctness of PXX's auto-import capability against standard system libraries, we need a regression test for the passphrase hashing library (crypt.h in libcrypt).
This test will exercise:
- Complex struct mapping (
struct crypt_data). - Macro constant mapping (
CRYPT_OUTPUT_SIZE,CRYPT_MAX_PASSPHRASE_SIZE). - Calling thread-safe and non-thread-safe SysV C functions (
crypt,crypt_r). - Reinterpreting and passing pointers to strings and structures.
Scope
- Test implementation:
- Create
test/test_c_crypt.pas. - Use
uses crypt;to auto-import the header. - Define test cases for standard SHA-512 crypt hashing (
$6$salt$). - Verify that thread-safe hashing (
crypt_r) correctly writes output into thecrypt_datarecord structure.
- Create
- Integration:
- Wire the test into
test/regression suite or execute it directly to verify.
- Wire the test into
Acceptance
test/test_c_crypt.pascompiles successfully.- Running the compiled binary performs passphrase hashing, asserts correct outcomes, and exits with status 0.
Log
- 2026-06-28 — ticket opened and taken.