1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//! `KdfPlugin` trait — the Rust-side counterpart of the KDF v0 wire
//! protocol.
//!
//! Plugin authors implement this trait on their KDF state type, then
//! apply `#[plugin_interface(name = "kdf", version = 0)]` to the impl
//! block.
//!
//! Method → symbol mapping (see `crates/confium-core/src/ffi/kdf.rs`
//! for the loader-side wire types):
//!
//! | trait method | FFI symbol | purpose |
//! |--------------|------------|---------|
//! | [`KdfPlugin::create`] | `cfmp_kdf_create` | construct a new instance |
//! | [`KdfPlugin::set_salt`] | `cfmp_kdf_set_salt` | set the salt |
//! | [`KdfPlugin::set_iterations`] | `cfmp_kdf_set_iterations` | set iteration count |
//! | [`KdfPlugin::set_memory_cost`] | `cfmp_kdf_set_memory_cost` | set memory cost |
//! | [`KdfPlugin::set_parallelism`] | `cfmp_kdf_set_parallelism` | set parallelism |
//! | [`KdfPlugin::set_hash`] | `cfmp_kdf_set_hash` | set hash algorithm |
//! | [`KdfPlugin::derive`] | `cfmp_kdf_derive` | derive key material |
//! | `Drop` | `cfmp_kdf_destroy` | reclaim the boxed state |
use cratePluginResult;
use crateOptionView;
/// Trait implemented by KDF plugins.