Expand description
Mock plugin built entirely with the confium-api SDK proc-macros.
This is the proof-of-concept that the macro-generated FFI symbols load through the standard Confium plugin loader. The plugin implements two interfaces:
- A trivial XOR-fold hash: the digest is one byte, the XOR of every input byte. Fully deterministic and dependency-free.
- A trivial XOR-stream cipher: each input byte is XOR-folded with a
running key byte derived from the key material. The cipher is a
stand-in for a real symmetric cipher — it exercises the full
cfmp_cipher_*symbol set (create, block/key/iv size, update, finalize, reset, destroy) end to end.
The crate compiles to a cdylib so the loader can dlopen it.
The cfmp_* symbols are emitted by:
#[plugin_interface(name = "hash", version = 0)]on theimpl HashPlugin for XorHashblock (eightcfmp_hash_*symbols).#[plugin_interface(name = "cipher", version = 0)]on theimpl CipherPlugin for XorCipherblock (eightcfmp_cipher_*symbols).#[export(metadata(...))]on the plugin marker struct. Emits the lifecycle + metadata symbols. The interface list is auto-discovered from the#[plugin_interface]attributes above; no explicitinterfaces(...)argument is needed.
The integration test in tests/loader.rs loads this crate’s
cdylib artifact and runs an end-to-end hash and cipher through the
loader.
Structs§
- Plugin
- XorCipher
- Trivial XOR-stream cipher used as a mock. The “key schedule” is a single running byte derived by XOR-folding the supplied key; each input byte is XORed with that running byte. This is not secure cryptography — it exists only to exercise the full cipher FFI surface without pulling in a real cipher library.
- XorHash
- One-byte XOR-fold hash. State is a single accumulator byte.
Functions§
- cfmp_
cipher_ ⚠block_ size - cfmp_
cipher_ ⚠create - cfmp_
cipher_ ⚠destroy - cfmp_
cipher_ ⚠finalize - cfmp_
cipher_ ⚠iv_ size - cfmp_
cipher_ ⚠key_ size - cfmp_
cipher_ ⚠reset - cfmp_
cipher_ ⚠update - cfmp_
finalize - cfmp_
hash_ ⚠block_ size - cfmp_
hash_ ⚠clone - cfmp_
hash_ ⚠create - cfmp_
hash_ ⚠destroy - cfmp_
hash_ ⚠finalize - cfmp_
hash_ ⚠output_ size - cfmp_
hash_ ⚠reset - cfmp_
hash_ ⚠update - cfmp_
initialize - cfmp_
interface_ version - cfmp_
metadata - cfmp_
query_ interfaces