2026-02-09 10:28:15 +02:00
|
|
|
use lb_groth16::fr_to_bytes;
|
|
|
|
|
use lb_key_management_system_service::{backend::preload::PreloadKMSBackendSettings, keys::Key};
|
2026-01-25 10:11:16 +02:00
|
|
|
use testing_framework_config::topology::configs::blend::GeneralBlendConfig;
|
2025-12-10 09:26:11 +01:00
|
|
|
|
2026-01-25 10:11:16 +02:00
|
|
|
pub fn create_kms_configs(blend_configs: &[GeneralBlendConfig]) -> Vec<PreloadKMSBackendSettings> {
|
|
|
|
|
blend_configs
|
2025-12-10 09:26:11 +01:00
|
|
|
.iter()
|
2026-01-25 10:11:16 +02:00
|
|
|
.map(|blend_conf| PreloadKMSBackendSettings {
|
2025-12-10 09:26:11 +01:00
|
|
|
keys: [
|
|
|
|
|
(
|
2025-12-13 05:59:28 +01:00
|
|
|
hex::encode(blend_conf.signer.public_key().to_bytes()),
|
|
|
|
|
Key::Ed25519(blend_conf.signer.clone()),
|
2025-12-10 09:26:11 +01:00
|
|
|
),
|
|
|
|
|
(
|
|
|
|
|
hex::encode(fr_to_bytes(
|
2025-12-13 05:59:28 +01:00
|
|
|
blend_conf.secret_zk_key.to_public_key().as_fr(),
|
2025-12-10 09:26:11 +01:00
|
|
|
)),
|
2025-12-13 05:59:28 +01:00
|
|
|
Key::Zk(blend_conf.secret_zk_key.clone()),
|
2025-12-10 09:26:11 +01:00
|
|
|
),
|
|
|
|
|
]
|
|
|
|
|
.into(),
|
|
|
|
|
})
|
|
|
|
|
.collect()
|
|
|
|
|
}
|