mirror of
https://github.com/luxfi/fhe.git
synced 2026-07-26 23:16:08 +00:00
LP-137-FHE-TYPING. New package github.com/luxfi/fhe/types wrapping every FHE buffer with the metadata required for safe dispatch: - FHEScheme (uint32 enum): TFHE, FHEW, CKKS, BFV, BGV. - FHECiphertextHeader (144-byte struct): ParamsHash, KeyID, CircuitID, Scheme, Level, N, ModulusCount, Domain, Reserved. Digest() returns SHA-256 of canonical 144-byte little-endian encoding; deterministic across runs. MatchesContext() rejects N + Domain mismatch. - FHEPrecompileArtifact (232-byte struct): seven 32-byte digest fields (ParamsHash, KeyRoot, InputCiphertextRoot, OutputCiphertextRoot, CircuitRoot, ThresholdTranscriptRoot, AttestationRoot) + OpCount + FailedCount. Digest() is the contribution to fchain_fhe_root. IsThreshold / IsAttested flag-helpers on the *Root fields. Layout byte-stable with the C++ mirror at luxcpp/fhe/include/lux/fhe/types. Cross-language byte image tests verify both struct types. 14 Go tests pass.