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
48
49
50
51
52
53
54
55
//! `AeadPlugin` trait — the Rust-side counterpart of the AEAD v0 wire
//! protocol.
//!
//! Plugin authors implement this trait on their AEAD state type, then
//! apply `#[plugin_interface(name = "aead", version = 0)]` to the impl
//! block.
//!
//! Method → symbol mapping (see `crates/confium-core/src/ffi/aead.rs`
//! for the loader-side wire types):
//!
//! | trait method | FFI symbol | purpose |
//! |--------------|------------|---------|
//! | [`AeadPlugin::create_with_key`] | `cfmp_aead_create` | construct a new instance |
//! | [`AeadPlugin::set_nonce`] | `cfmp_aead_set_nonce` | set the nonce |
//! | [`AeadPlugin::associated_data_update`] | `cfmp_aead_associated_data_update` | absorb associated data |
//! | [`AeadPlugin::encrypt_update`] | `cfmp_aead_encrypt_update` | encrypt a chunk |
//! | [`AeadPlugin::decrypt_update`] | `cfmp_aead_decrypt_update` | decrypt a chunk |
//! | [`AeadPlugin::finalize`] | `cfmp_aead_finalize` | emit the tag |
//! | [`AeadPlugin::verify_tag`] | `cfmp_aead_verify_tag` | verify the tag |
//! | `Drop` | `cfmp_aead_destroy` | reclaim the boxed state |
use cratePluginResult;
use crateOptionView;
/// Trait implemented by AEAD plugins.