Expand description
CipherPlugin trait — the Rust-side counterpart of the symmetric
cipher v0 wire protocol.
Plugin authors implement this trait on their cipher state type, then
apply #[plugin_interface(name = "cipher", version = 0)] to the impl
block. The macro emits the eight canonical cfmp_cipher_* FFI symbols,
one per trait method.
Method → symbol mapping (see crates/confium-core/src/ffi/cipher.rs
for the loader-side wire types):
| trait method | FFI symbol | purpose |
|---|---|---|
CipherPlugin::create_with_key | cfmp_cipher_create | construct a new instance |
CipherPlugin::block_size | cfmp_cipher_block_size | block size in bytes |
CipherPlugin::key_size | cfmp_cipher_key_size | key length in bytes |
CipherPlugin::iv_size | cfmp_cipher_iv_size | nonce/IV length in bytes |
CipherPlugin::update | cfmp_cipher_update | encrypt/decrypt a chunk |
CipherPlugin::finalize | cfmp_cipher_finalize | flush remaining output |
CipherPlugin::reset | cfmp_cipher_reset | reset to initial state |
Drop | cfmp_cipher_destroy | reclaim the boxed state |
Traits§
- Cipher
Plugin - Trait implemented by symmetric cipher plugins. The macro-generated
cfmp_cipher_createcallsCipherPlugin::create_with_key; all other symbols dispatch throughOpaqueHandle::<Self>::borrow_rawand the corresponding trait method.
Functions§
- insufficient_
buffer - Convenience used by macro-generated code to surface a buffer-too-small
condition as a
PluginErrorwithout repeating the boilerplate at every call site.