1use super::super::DifferentialPrivacyConfig;
4use std::time::Duration;
5
6#[derive(Debug, Clone)]
8pub struct FederatedPrivacyConfig {
9 pub base_config: DifferentialPrivacyConfig,
11
12 pub clients_per_round: usize,
14
15 pub total_clients: usize,
17
18 pub sampling_strategy: ClientSamplingStrategy,
20
21 pub secure_aggregation: SecureAggregationConfig,
23
24 pub amplification_config: AmplificationConfig,
26
27 pub cross_device_config: CrossDeviceConfig,
29
30 pub composition_method: FederatedCompositionMethod,
32
33 pub trust_model: TrustModel,
35
36 pub communication_privacy: CommunicationPrivacyConfig,
38}
39
40#[derive(Debug, Clone, Copy)]
42pub enum ClientSamplingStrategy {
43 UniformRandom,
45
46 Stratified,
48
49 ImportanceSampling,
51
52 PoissonSampling,
54
55 FairSampling,
57}
58
59#[derive(Debug, Clone)]
61pub struct SecureAggregationConfig {
62 pub enabled: bool,
64
65 pub min_clients: usize,
67
68 pub max_dropouts: usize,
70
71 pub masking_dimension: usize,
73
74 pub seed_sharing: SeedSharingMethod,
76
77 pub quantization_bits: Option<u8>,
79
80 pub aggregate_dp: bool,
82}
83
84#[derive(Debug, Clone)]
86pub struct AmplificationConfig {
87 pub enabled: bool,
89
90 pub subsampling_factor: f64,
92
93 pub shuffling_enabled: bool,
95
96 pub multi_round_amplification: bool,
98
99 pub heterogeneous_amplification: bool,
101}
102
103#[derive(Debug, Clone, Default)]
105pub struct CrossDeviceConfig {
106 pub user_level_privacy: bool,
108
109 pub device_clustering: bool,
111
112 pub temporal_privacy: bool,
114
115 pub geographic_privacy: bool,
117
118 pub demographic_privacy: bool,
120}
121
122#[derive(Debug, Clone, Copy, Default)]
124pub enum FederatedCompositionMethod {
125 Basic,
127
128 AdvancedComposition,
130
131 #[default]
133 FederatedMomentsAccountant,
134
135 RenyiDP,
137
138 ZCDP,
140}
141
142#[derive(Debug, Clone, Copy)]
144pub enum TrustModel {
145 HonestButCurious,
147
148 SemiHonest,
150
151 Byzantine,
153
154 Malicious,
156}
157
158#[derive(Debug, Clone)]
160pub struct CommunicationPrivacyConfig {
161 pub encryption_enabled: bool,
163
164 pub anonymous_channels: bool,
166
167 pub communication_noise: bool,
169
170 pub traffic_analysis_protection: bool,
172
173 pub threat_modeling: AdvancedThreatModelingConfig,
175
176 pub cross_silo_config: Option<CrossSiloFederatedConfig>,
178}
179
180#[derive(Debug, Clone, Default)]
182pub struct AdvancedThreatModelingConfig {
183 pub enabled: bool,
185
186 pub adversarial_capabilities: AdversarialCapabilities,
188
189 pub attack_surface_analysis: AttackSurfaceConfig,
191
192 pub threat_intelligence: ThreatIntelligenceConfig,
194
195 pub risk_assessment: RiskAssessmentConfig,
197
198 pub countermeasure_evaluation: CountermeasureEvaluationConfig,
200}
201
202#[derive(Debug, Clone)]
204pub struct AdversarialCapabilities {
205 pub computational_resources: ComputationalThreatLevel,
207
208 pub network_capabilities: NetworkThreatCapabilities,
210
211 pub data_capabilities: DataThreatCapabilities,
213
214 pub algorithmic_knowledge: AlgorithmicKnowledgeLevel,
216
217 pub collusion_potential: CollusionThreatLevel,
219
220 pub attack_persistence: AttackPersistenceLevel,
222}
223
224#[derive(Debug, Clone, Default)]
226pub struct AttackSurfaceConfig {
227 pub client_attack_vectors: ClientAttackVectors,
229
230 pub server_attack_vectors: ServerAttackVectors,
232
233 pub communication_vulnerabilities: CommunicationVulnerabilities,
235
236 pub aggregation_vulnerabilities: AggregationVulnerabilities,
238
239 pub privacy_mechanism_vulnerabilities: PrivacyMechanismVulnerabilities,
241}
242
243#[derive(Debug, Clone, Default)]
245pub struct ThreatIntelligenceConfig {
246 pub enabled: bool,
248
249 pub real_time_monitoring: bool,
251
252 pub signature_database: ThreatSignatureDatabase,
254
255 pub anomaly_detection: AnomalyDetectionConfig,
257
258 pub threat_correlation: ThreatCorrelationConfig,
260}
261
262#[derive(Debug, Clone)]
264pub struct RiskAssessmentConfig {
265 pub methodology: RiskAssessmentMethodology,
267
268 pub risk_tolerance: RiskToleranceLevels,
270
271 pub impact_assessment: ImpactAssessmentCriteria,
273
274 pub likelihood_estimation: LikelihoodEstimationMethods,
276
277 pub mitigation_strategies: RiskMitigationStrategies,
279}
280
281#[derive(Debug, Clone, Default)]
283pub struct EffectivenessMetrics {
284 pub detection_accuracy: f64,
286 pub false_positive_rate: f64,
288 pub false_negative_rate: f64,
290 pub response_times: Vec<f64>,
292}
293
294#[derive(Debug, Clone, Default)]
296pub struct CostBenefitAnalysisConfig {
297 pub implementation_costs: Vec<f64>,
299 pub operational_costs: Vec<f64>,
301 pub benefits: Vec<f64>,
303 pub roi_methods: Vec<String>,
305}
306
307#[derive(Debug, Clone, Default)]
309pub struct DynamicAdaptationConfig {
310 pub triggers: Vec<String>,
312 pub strategies: Vec<String>,
314 pub learning_rate: f64,
316 pub min_threshold: f64,
318}
319
320#[derive(Debug, Clone, Default)]
322pub struct CountermeasureOptimizationConfig {
323 pub algorithms: Vec<String>,
325 pub target_metrics: Vec<String>,
327 pub constraints: Vec<String>,
329 pub frequency: String,
331}
332
333#[derive(Debug, Clone, Default)]
335pub struct CountermeasureEvaluationConfig {
336 pub effectiveness_metrics: EffectivenessMetrics,
338
339 pub cost_benefit_analysis: CostBenefitAnalysisConfig,
341
342 pub dynamic_adaptation: DynamicAdaptationConfig,
344
345 pub optimization: CountermeasureOptimizationConfig,
347}
348
349#[derive(Debug, Clone)]
351pub struct DataMarketplaceConfig {
352 pub enabled: bool,
354 pub pricing_models: Vec<String>,
356 pub quality_metrics: Vec<String>,
358 pub access_controls: Vec<String>,
360}
361
362#[derive(Debug, Clone)]
364pub struct RegulatoryComplianceConfig {
365 pub regulations: Vec<String>,
367 pub compliance_checks: Vec<String>,
369 pub reporting_requirements: Vec<String>,
371 pub audit_trails: bool,
373}
374
375#[derive(Debug, Clone)]
377pub struct AuditAccountabilityConfig {
378 pub audit_logging: bool,
380 pub accountability_mechanisms: Vec<String>,
382 pub verification_methods: Vec<String>,
384 pub compliance_tracking: bool,
386}
387
388#[derive(Debug, Clone)]
390pub struct TrustEstablishmentMethods {
391 pub certification_authorities: Vec<String>,
393 pub reputation_systems: Vec<String>,
395 pub verification_protocols: Vec<String>,
397}
398
399#[derive(Debug, Clone)]
401pub struct TrustVerificationMechanisms {
402 pub methods: Vec<String>,
404 pub frequency: String,
406 pub thresholds: Vec<f64>,
408}
409
410#[derive(Debug, Clone)]
412pub struct OrganizationReputationSystem {
413 pub metrics: Vec<String>,
415 pub scoring_algorithms: Vec<String>,
417 pub update_frequencies: Vec<String>,
419}
420
421#[derive(Debug, Clone)]
423pub struct TrustLifecycleManagement {
424 pub establishment_phases: Vec<String>,
426 pub maintenance_procedures: Vec<String>,
428 pub recovery_mechanisms: Vec<String>,
430 pub degradation_triggers: Vec<String>,
432}
433
434#[derive(Debug, Clone)]
436pub struct DataGovernanceConfig {
437 pub classification: Vec<String>,
439 pub access_policies: Vec<String>,
441 pub quality_standards: Vec<String>,
443 pub retention_policies: Vec<String>,
445}
446
447#[derive(Debug, Clone)]
449pub struct PrivacyAgreementConfig {
450 pub templates: Vec<String>,
452 pub negotiation_protocols: Vec<String>,
454 pub enforcement_mechanisms: Vec<String>,
456 pub compliance_monitoring: bool,
458}
459
460#[derive(Debug, Clone)]
462pub struct DataClassificationConfig {
463 pub schemes: Vec<String>,
465 pub sensitivity_levels: Vec<String>,
467 pub labeling_rules: Vec<String>,
469}
470
471#[derive(Debug, Clone)]
473pub struct DataLineageConfig {
474 pub tracking_methods: Vec<String>,
476 pub provenance_recording: bool,
478 pub audit_trails: bool,
480}
481
482#[derive(Debug, Clone)]
484pub struct DataQualityAssuranceConfig {
485 pub metrics: Vec<String>,
487 pub validation_rules: Vec<String>,
489 pub monitoring_frequency: String,
491}
492
493#[derive(Debug, Clone)]
495pub struct DataRetentionPolicies {
496 pub retention_periods: Vec<String>,
498 pub disposal_methods: Vec<String>,
500 pub archive_policies: Vec<String>,
502}
503
504#[derive(Debug, Clone)]
506pub struct CrossSiloFederatedConfig {
507 pub enabled: bool,
509
510 pub organization_trust: OrganizationTrustConfig,
512
513 pub data_governance: DataGovernanceConfig,
515
516 pub privacy_agreements: PrivacyAgreementConfig,
518
519 pub data_marketplace: DataMarketplaceConfig,
521
522 pub regulatory_compliance: RegulatoryComplianceConfig,
524
525 pub audit_accountability: AuditAccountabilityConfig,
527}
528
529#[derive(Debug, Clone)]
531pub struct OrganizationTrustConfig {
532 pub trust_establishment: TrustEstablishmentMethods,
534
535 pub trust_verification: TrustVerificationMechanisms,
537
538 pub reputation_system: OrganizationReputationSystem,
540
541 pub trust_lifecycle: TrustLifecycleManagement,
543}
544
545#[derive(Debug, Clone, Copy)]
548pub enum ComputationalThreatLevel {
549 Limited, Moderate, Substantial, Unlimited, }
554
555#[derive(Debug, Clone, Default)]
556pub struct NetworkThreatCapabilities {
557 pub can_intercept: bool,
559 pub can_modify: bool,
561 pub can_inject: bool,
563 pub can_analyze_traffic: bool,
565 pub can_timing_attack: bool,
567 pub can_dos: bool,
569}
570
571#[derive(Debug, Clone, Default)]
572pub struct DataThreatCapabilities {
573 pub can_access_training_data: bool,
575 pub can_modify_training_data: bool,
577 pub can_inject_poisoned_data: bool,
579 pub can_membership_inference: bool,
581 pub can_extract_parameters: bool,
583 pub can_gradient_inversion: bool,
585}
586
587#[derive(Debug, Clone, Copy)]
588pub enum AlgorithmicKnowledgeLevel {
589 BlackBox, GrayBox, WhiteBox, Adaptive, }
594
595#[derive(Debug, Clone, Copy)]
596pub enum CollusionThreatLevel {
597 None, Limited, Substantial, Majority, }
602
603#[derive(Debug, Clone, Copy)]
604pub enum AttackPersistenceLevel {
605 OneTime, Intermittent, Persistent, Adaptive, }
610
611#[derive(Debug, Clone, Default)]
612pub struct ClientAttackVectors {
613 pub model_poisoning: bool,
615 pub data_poisoning: bool,
617 pub gradient_manipulation: bool,
619 pub local_model_extraction: bool,
621 pub client_impersonation: bool,
623}
624
625#[derive(Debug, Clone, Default)]
626pub struct ServerAttackVectors {
627 pub server_compromise: bool,
629 pub malicious_aggregation: bool,
631 pub backdoor_injection: bool,
633 pub budget_manipulation: bool,
635 pub client_discrimination: bool,
637}
638
639#[derive(Debug, Clone, Default)]
640pub struct CommunicationVulnerabilities {
641 pub mitm_attacks: bool,
643 pub eavesdropping: bool,
645 pub replay_attacks: bool,
647 pub message_injection: bool,
649 pub timing_analysis: bool,
651}
652
653#[derive(Debug, Clone, Default)]
654pub struct AggregationVulnerabilities {
655 pub secure_aggregation_bypass: bool,
657 pub aggregation_manipulation: bool,
659 pub statistical_attacks: bool,
661 pub reconstruction_attacks: bool,
663}
664
665#[derive(Debug, Clone, Default)]
666pub struct PrivacyMechanismVulnerabilities {
667 pub dp_parameter_inference: bool,
669 pub budget_exhaustion: bool,
671 pub composition_attacks: bool,
673 pub auxiliary_info_attacks: bool,
675}
676
677#[derive(Debug, Clone, Default)]
678pub struct ThreatSignatureDatabase {
679 pub attack_patterns: Vec<AttackPattern>,
681 pub threat_actors: Vec<ThreatActorProfile>,
683 pub vulnerability_signatures: Vec<VulnerabilitySignature>,
685}
686
687#[derive(Debug, Clone)]
688pub struct AttackPattern {
689 pub id: String,
691 pub description: String,
693 pub indicators: Vec<AttackIndicator>,
695 pub severity: ThreatSeverity,
697 pub mitigations: Vec<String>,
699}
700
701#[derive(Debug, Clone)]
702pub struct ThreatActorProfile {
703 pub id: String,
705 pub capabilities: AdversarialCapabilities,
707 pub attack_methods: Vec<String>,
709 pub targeting_preferences: Vec<String>,
711}
712
713#[derive(Debug, Clone)]
714pub struct VulnerabilitySignature {
715 pub id: String,
717 pub affected_components: Vec<String>,
719 pub exploitation_indicators: Vec<String>,
721 pub severity_score: f64,
723}
724
725#[derive(Debug, Clone)]
726pub struct AttackIndicator {
727 pub indicator_type: IndicatorType,
729 pub value: String,
731 pub confidence: f64,
733}
734
735#[derive(Debug, Clone, Copy)]
736pub enum IndicatorType {
737 NetworkTraffic,
738 GradientPattern,
739 ModelBehavior,
740 PerformanceAnomaly,
741 CommunicationPattern,
742}
743
744#[derive(Debug, Clone, Copy)]
745pub enum ThreatSeverity {
746 Low,
747 Medium,
748 High,
749 Critical,
750}
751
752#[derive(Debug, Clone)]
753pub struct AnomalyDetectionConfig {
754 pub algorithms: Vec<AnomalyDetectionAlgorithm>,
756 pub thresholds: AnomalyThresholds,
758 pub response_actions: AnomalyResponseActions,
760}
761
762#[derive(Debug, Clone, Copy)]
763pub enum AnomalyDetectionAlgorithm {
764 StatisticalBaseline,
765 MachineLearningBased,
766 DeepLearningBased,
767 EnsembleMethods,
768}
769
770#[derive(Debug, Clone)]
771pub struct AnomalyThresholds {
772 pub statistical_threshold: f64,
774 pub confidence_threshold: f64,
776 pub false_positive_rate: f64,
778}
779
780#[derive(Debug, Clone)]
781pub struct AnomalyResponseActions {
782 pub alert_generation: bool,
784 pub automatic_quarantine: bool,
786 pub enhanced_monitoring: bool,
788 pub incident_escalation: bool,
790}
791
792#[derive(Debug, Clone)]
793pub struct ThreatCorrelationConfig {
794 pub correlation_algorithms: Vec<CorrelationAlgorithm>,
796 pub temporal_window: Duration,
798 pub cross_client_correlation: bool,
800}
801
802#[derive(Debug, Clone, Copy)]
803pub enum CorrelationAlgorithm {
804 TemporalPatternMatching,
805 BehavioralProfiling,
806 GraphBasedAnalysis,
807 StatisticalCorrelation,
808}
809
810#[derive(Debug, Clone, Copy)]
811pub enum RiskAssessmentMethodology {
812 QualitativeAssessment,
813 QuantitativeAssessment,
814 SemiQuantitativeAssessment,
815 ScenarioBasedAssessment,
816}
817
818#[derive(Debug, Clone)]
819pub struct RiskToleranceLevels {
820 pub privacy_risk_tolerance: f64,
822 pub security_risk_tolerance: f64,
824 pub utility_risk_tolerance: f64,
826 pub operational_risk_tolerance: f64,
828}
829
830#[derive(Debug, Clone)]
831pub struct ImpactAssessmentCriteria {
832 pub confidentiality_impact: ImpactLevel,
834 pub integrity_impact: ImpactLevel,
836 pub availability_impact: ImpactLevel,
838 pub compliance_impact: ImpactLevel,
840}
841
842#[derive(Debug, Clone, Copy)]
843pub enum ImpactLevel {
844 Low,
845 Medium,
846 High,
847 Critical,
848}
849
850#[derive(Debug, Clone)]
851pub struct LikelihoodEstimationMethods {
852 pub historical_analysis: bool,
854 pub expert_judgment: bool,
856 pub threat_modeling: bool,
858 pub simulation_based: bool,
860}
861
862#[derive(Debug, Clone, Default)]
863pub struct RiskMitigationStrategies {
864 pub avoidance_strategies: Vec<String>,
866 pub mitigation_controls: Vec<String>,
868 pub transfer_mechanisms: Vec<String>,
870 pub acceptance_criteria: Vec<String>,
872}
873
874#[derive(Debug, Clone, Copy)]
876pub enum SeedSharingMethod {
877 ShamirSecretSharing,
879
880 ThresholdEncryption,
882
883 DistributedKeyGeneration,
885}
886
887#[derive(Debug, Clone, Copy)]
889pub enum ByzantineRobustMethod {
890 TrimmedMean { trim_ratio: f64 },
892
893 CoordinateWiseMedian,
895
896 Krum { f: usize },
898
899 MultiKrum { f: usize, m: usize },
901
902 Bulyan { f: usize },
904
905 CenteredClipping { tau: f64 },
907
908 FedAvgOutlierDetection { threshold: f64 },
910
911 ReputationWeighted { reputation_decay: f64 },
913}
914
915#[derive(Debug, Clone)]
917pub enum PersonalizationStrategy {
918 None,
920
921 FineTuning { local_epochs: usize },
923
924 MetaLearning { inner_lr: f64, outer_lr: f64 },
926
927 ClusteredFL { num_clusters: usize },
929
930 MultiTask { task_similarity_threshold: f64 },
932
933 PersonalizedLayers { personal_layer_indices: Vec<usize> },
935
936 ModelInterpolation { interpolation_weight: f64 },
938
939 Adaptive { adaptation_rate: f64 },
941}
942
943#[derive(Debug, Clone, Copy)]
945pub enum CompressionStrategy {
946 None,
948
949 Quantization { bits: u8 },
951
952 TopK { k: usize },
954
955 RandomSparsification { sparsity_ratio: f64 },
957
958 ErrorFeedback,
960
961 GradientMemory { memory_factor: f64 },
963
964 LowRank { rank: usize },
966
967 Structured { structure_type: StructureType },
969}
970
971#[derive(Debug, Clone, Copy)]
973pub enum StructureType {
974 Circulant,
975 Toeplitz,
976 Hankel,
977 BlockDiagonal,
978}
979
980#[derive(Debug, Clone, Copy)]
982pub enum ContinualLearningStrategy {
983 EWC { lambda: f64 },
985
986 MAS { lambda: f64 },
988
989 Progressive,
991
992 LwF { distillation_temperature: f64 },
994
995 GEM { memory_size: usize },
997
998 FedContinual { memory_budget: usize },
1000
1001 TaskAgnostic,
1003}
1004
1005#[derive(Debug, Clone)]
1007pub struct AdvancedFederatedConfig {
1008 pub byzantine_config: ByzantineRobustConfig,
1010
1011 pub personalization_config: PersonalizationConfig,
1013
1014 pub adaptive_budget_config: AdaptiveBudgetConfig,
1016
1017 pub communication_config: CommunicationConfig,
1019
1020 pub continual_learning_config: ContinualLearningConfig,
1022
1023 pub multi_level_privacy: MultiLevelPrivacyConfig,
1025}
1026
1027#[derive(Debug, Clone)]
1029pub struct ByzantineRobustConfig {
1030 pub method: ByzantineRobustMethod,
1032
1033 pub expected_byzantine_ratio: f64,
1035
1036 pub dynamic_detection: bool,
1038
1039 pub reputation_system: ReputationSystemConfig,
1041
1042 pub statistical_tests: StatisticalTestConfig,
1044}
1045
1046#[derive(Debug, Clone)]
1048pub struct PersonalizationConfig {
1049 pub strategy: PersonalizationStrategy,
1051
1052 pub local_adaptation: LocalAdaptationConfig,
1054
1055 pub clustering: ClusteringConfig,
1057
1058 pub meta_learning: MetaLearningConfig,
1060
1061 pub privacy_preserving: bool,
1063}
1064
1065#[derive(Debug, Clone)]
1067pub struct AdaptiveBudgetConfig {
1068 pub enabled: bool,
1070
1071 pub allocation_strategy: BudgetAllocationStrategy,
1073
1074 pub dynamic_privacy: DynamicPrivacyConfig,
1076
1077 pub importance_weighting: bool,
1079
1080 pub contextual_adjustment: ContextualAdjustmentConfig,
1082}
1083
1084#[derive(Debug, Clone)]
1086pub struct CommunicationConfig {
1087 pub compression: CompressionStrategy,
1089
1090 pub lazy_aggregation: LazyAggregationConfig,
1092
1093 pub federated_dropout: FederatedDropoutConfig,
1095
1096 pub async_updates: AsyncUpdateConfig,
1098
1099 pub bandwidth_adaptation: BandwidthAdaptationConfig,
1101}
1102
1103#[derive(Debug, Clone)]
1105pub struct ContinualLearningConfig {
1106 pub strategy: ContinualLearningStrategy,
1108
1109 pub memory_management: MemoryManagementConfig,
1111
1112 pub task_detection: TaskDetectionConfig,
1114
1115 pub knowledge_transfer: KnowledgeTransferConfig,
1117
1118 pub forgetting_prevention: ForgettingPreventionConfig,
1120}
1121
1122#[derive(Debug, Clone)]
1124pub struct MultiLevelPrivacyConfig {
1125 pub local_dp: LocalDPConfig,
1127
1128 pub global_dp: GlobalDPConfig,
1130
1131 pub user_level: UserLevelPrivacyConfig,
1133
1134 pub hierarchical: HierarchicalPrivacyConfig,
1136
1137 pub context_aware: ContextAwarePrivacyConfig,
1139}
1140
1141#[derive(Debug, Clone)]
1145pub struct ReputationSystemConfig {
1146 pub enabled: bool,
1147 pub initial_reputation: f64,
1148 pub reputation_decay: f64,
1149 pub min_reputation: f64,
1150 pub outlier_penalty: f64,
1151 pub contribution_bonus: f64,
1152}
1153
1154#[derive(Debug, Clone)]
1156pub struct StatisticalTestConfig {
1157 pub enabled: bool,
1158 pub test_type: StatisticalTestType,
1159 pub significancelevel: f64,
1160 pub window_size: usize,
1161 pub adaptive_threshold: bool,
1162}
1163
1164#[derive(Debug, Clone, Copy)]
1165pub enum StatisticalTestType {
1166 ZScore,
1167 ModifiedZScore,
1168 IQRTest,
1169 GrubbsTest,
1170 ChauventCriterion,
1171}
1172
1173#[derive(Debug, Clone)]
1175pub struct LocalAdaptationConfig {
1176 pub adaptation_rate: f64,
1177 pub local_epochs: usize,
1178 pub adaptation_frequency: usize,
1179 pub adaptation_method: AdaptationMethod,
1180 pub regularization_strength: f64,
1181}
1182
1183#[derive(Debug, Clone, Copy)]
1184pub enum AdaptationMethod {
1185 FineTuning,
1186 FeatureExtraction,
1187 LayerWiseAdaptation,
1188 AttentionBasedAdaptation,
1189}
1190
1191#[derive(Debug, Clone)]
1193pub struct ClusteringConfig {
1194 pub num_clusters: usize,
1195 pub clustering_method: ClusteringMethod,
1196 pub similarity_metric: SimilarityMetric,
1197 pub cluster_update_frequency: usize,
1198 pub privacy_preserving_clustering: bool,
1199}
1200
1201#[derive(Debug, Clone, Copy)]
1202pub enum ClusteringMethod {
1203 KMeans,
1204 DBSCAN,
1205 AgglomerativeClustering,
1206 SpectralClustering,
1207 PrivacyPreservingKMeans,
1208}
1209
1210#[derive(Debug, Clone, Copy)]
1211pub enum SimilarityMetric {
1212 CosineSimilarity,
1213 EuclideanDistance,
1214 ModelParameters,
1215 GradientSimilarity,
1216 LossLandscape,
1217}
1218
1219#[derive(Debug, Clone)]
1221pub struct MetaLearningConfig {
1222 pub inner_learning_rate: f64,
1223 pub outer_learning_rate: f64,
1224 pub inner_steps: usize,
1225 pub meta_batch_size: usize,
1226 pub adaptation_method: MetaAdaptationMethod,
1227}
1228
1229#[derive(Debug, Clone, Copy)]
1230pub enum MetaAdaptationMethod {
1231 MAML,
1232 Reptile,
1233 ProtoNets,
1234 RelationNets,
1235 FOMAML,
1236}
1237
1238#[derive(Debug, Clone, Copy)]
1240pub enum BudgetAllocationStrategy {
1241 Uniform,
1242 ProportionalToData,
1243 ProportionalToParticipation,
1244 UtilityBased,
1245 FairnessAware,
1246 AdaptiveAllocation,
1247}
1248
1249#[derive(Debug, Clone)]
1251pub struct DynamicPrivacyConfig {
1252 pub enabled: bool,
1253 pub adaptation_frequency: usize,
1254 pub privacy_sensitivity: f64,
1255 pub utility_weight: f64,
1256 pub fairness_weight: f64,
1257}
1258
1259#[derive(Debug, Clone)]
1261pub struct ContextualAdjustmentConfig {
1262 pub enabled: bool,
1263 pub context_factors: Vec<ContextFactor>,
1264 pub adjustment_sensitivity: f64,
1265 pub temporal_adaptation: bool,
1266}
1267
1268#[derive(Debug, Clone, Copy)]
1269pub enum ContextFactor {
1270 DataSensitivity,
1271 ClientTrustLevel,
1272 NetworkConditions,
1273 ModelAccuracy,
1274 ParticipationHistory,
1275}
1276
1277#[derive(Debug, Clone)]
1279pub struct LazyAggregationConfig {
1280 pub enabled: bool,
1281 pub aggregation_threshold: f64,
1282 pub staleness_tolerance: usize,
1283 pub gradient_similarity_threshold: f64,
1284}
1285
1286#[derive(Debug, Clone)]
1288pub struct FederatedDropoutConfig {
1289 pub enabled: bool,
1290 pub dropout_probability: f64,
1291 pub adaptive_dropout: bool,
1292 pub importance_sampling: bool,
1293}
1294
1295#[derive(Debug, Clone)]
1297pub struct AsyncUpdateConfig {
1298 pub enabled: bool,
1299 pub staleness_threshold: usize,
1300 pub mixing_coefficient: f64,
1301 pub buffering_strategy: BufferingStrategy,
1302}
1303
1304#[derive(Debug, Clone, Copy)]
1305pub enum BufferingStrategy {
1306 FIFO,
1307 LIFO,
1308 PriorityBased,
1309 AdaptiveMixing,
1310}
1311
1312#[derive(Debug, Clone, Default)]
1314pub struct BandwidthAdaptationConfig {
1315 pub enabled: bool,
1316 pub compression_adaptation: bool,
1317 pub transmission_scheduling: bool,
1318 pub quality_of_service: QoSConfig,
1319}
1320
1321#[derive(Debug, Clone)]
1323pub struct QoSConfig {
1324 pub priority_levels: usize,
1325 pub latency_targets: Vec<f64>,
1326 pub throughput_targets: Vec<f64>,
1327 pub fairness_constraints: bool,
1328}
1329
1330#[derive(Debug, Clone)]
1332pub struct MemoryManagementConfig {
1333 pub memory_budget: usize,
1334 pub eviction_strategy: EvictionStrategy,
1335 pub compression_enabled: bool,
1336 pub memory_adaptation: bool,
1337}
1338
1339#[derive(Debug, Clone, Copy)]
1340pub enum EvictionStrategy {
1341 LRU,
1342 LFU,
1343 FIFO,
1344 ImportanceBased,
1345 TemporalDecay,
1346}
1347
1348#[derive(Debug, Clone)]
1350pub struct TaskDetectionConfig {
1351 pub enabled: bool,
1352 pub detection_method: TaskDetectionMethod,
1353 pub sensitivity_threshold: f64,
1354 pub adaptation_delay: usize,
1355}
1356
1357#[derive(Debug, Clone, Copy)]
1358pub enum TaskDetectionMethod {
1359 GradientBased,
1360 LossBased,
1361 StatisticalTest,
1362 ChangePointDetection,
1363 EnsembleMethods,
1364}
1365
1366#[derive(Debug, Clone)]
1368pub struct KnowledgeTransferConfig {
1369 pub transfer_method: KnowledgeTransferMethod,
1370 pub transfer_strength: f64,
1371 pub selective_transfer: bool,
1372 pub privacy_preserving: bool,
1373}
1374
1375#[derive(Debug, Clone, Copy)]
1376pub enum KnowledgeTransferMethod {
1377 ParameterTransfer,
1378 FeatureTransfer,
1379 AttentionTransfer,
1380 DistillationBased,
1381 GradientBased,
1382}
1383
1384#[derive(Debug, Clone)]
1386pub struct ForgettingPreventionConfig {
1387 pub method: ForgettingPreventionMethod,
1388 pub regularization_strength: f64,
1389 pub memory_replay_ratio: f64,
1390 pub importance_estimation: ImportanceEstimationMethod,
1391}
1392
1393#[derive(Debug, Clone, Copy)]
1394pub enum ForgettingPreventionMethod {
1395 EWC,
1396 MAS,
1397 PackNet,
1398 ProgressiveNets,
1399 MemoryReplay,
1400}
1401
1402#[derive(Debug, Clone, Copy)]
1403pub enum ImportanceEstimationMethod {
1404 FisherInformation,
1405 GradientNorm,
1406 PathIntegral,
1407 AttentionWeights,
1408}
1409
1410#[derive(Debug, Clone)]
1412pub struct LocalDPConfig {
1413 pub enabled: bool,
1414 pub epsilon: f64,
1415 pub mechanism: LocalDPMechanism,
1416 pub data_preprocessing: DataPreprocessingConfig,
1417}
1418
1419#[derive(Debug, Clone, Copy)]
1420pub enum LocalDPMechanism {
1421 Randomized,
1422 Duchi,
1423 RAPPOR,
1424 PrivUnit,
1425 Harmony,
1426}
1427
1428#[derive(Debug, Clone)]
1430pub struct GlobalDPConfig {
1431 pub epsilon: f64,
1432 pub delta: f64,
1433 pub composition_method: CompositionMethod,
1434 pub amplification_analysis: bool,
1435}
1436
1437#[derive(Debug, Clone, Copy)]
1438pub enum CompositionMethod {
1439 Basic,
1440 Advanced,
1441 RDP,
1442 ZCDP,
1443 Moments,
1444}
1445
1446#[derive(Debug, Clone)]
1448pub struct UserLevelPrivacyConfig {
1449 pub enabled: bool,
1450 pub user_epsilon: f64,
1451 pub user_delta: f64,
1452 pub cross_device_correlation: bool,
1453 pub temporal_correlation: bool,
1454}
1455
1456#[derive(Debug, Clone)]
1458pub struct HierarchicalPrivacyConfig {
1459 pub levels: Vec<PrivacyLevel>,
1460 pub level_allocation: LevelAllocationStrategy,
1461 pub inter_level_composition: bool,
1462}
1463
1464#[derive(Debug, Clone)]
1465pub struct PrivacyLevel {
1466 pub name: String,
1467 pub epsilon: f64,
1468 pub delta: f64,
1469 pub scope: PrivacyScope,
1470}
1471
1472#[derive(Debug, Clone, Copy)]
1473pub enum PrivacyScope {
1474 Individual,
1475 Group,
1476 Organization,
1477 Global,
1478}
1479
1480#[derive(Debug, Clone, Copy)]
1481pub enum LevelAllocationStrategy {
1482 Uniform,
1483 ProportionalToSensitivity,
1484 OptimalAllocation,
1485 AdaptiveAllocation,
1486}
1487
1488#[derive(Debug, Clone)]
1490pub struct ContextAwarePrivacyConfig {
1491 pub enabled: bool,
1492 pub context_sensitivity: f64,
1493 pub dynamic_adjustment: bool,
1494 pub privacy_preferences: PrivacyPreferencesConfig,
1495}
1496
1497#[derive(Debug, Clone)]
1499pub struct PrivacyPreferencesConfig {
1500 pub user_controlled: bool,
1501 pub preference_learning: bool,
1502 pub default_privacy_level: PrivacyLevel,
1503 pub granular_control: bool,
1504}
1505
1506#[derive(Debug, Clone)]
1508pub struct DataPreprocessingConfig {
1509 pub normalization: bool,
1510 pub discretization: bool,
1511 pub dimensionality_reduction: bool,
1512 pub feature_selection: bool,
1513}
1514
1515impl Default for FederatedPrivacyConfig {
1518 fn default() -> Self {
1519 Self {
1520 base_config: DifferentialPrivacyConfig::default(),
1521 clients_per_round: 100,
1522 total_clients: 1000,
1523 sampling_strategy: ClientSamplingStrategy::UniformRandom,
1524 secure_aggregation: SecureAggregationConfig::default(),
1525 amplification_config: AmplificationConfig::default(),
1526 cross_device_config: CrossDeviceConfig::default(),
1527 composition_method: FederatedCompositionMethod::FederatedMomentsAccountant,
1528 trust_model: TrustModel::HonestButCurious,
1529 communication_privacy: CommunicationPrivacyConfig::default(),
1530 }
1531 }
1532}
1533
1534impl Default for SecureAggregationConfig {
1535 fn default() -> Self {
1536 Self {
1537 enabled: false,
1538 min_clients: 10,
1539 max_dropouts: 5,
1540 masking_dimension: 1000,
1541 seed_sharing: SeedSharingMethod::ShamirSecretSharing,
1542 quantization_bits: None,
1543 aggregate_dp: true,
1544 }
1545 }
1546}
1547
1548impl Default for AmplificationConfig {
1549 fn default() -> Self {
1550 Self {
1551 enabled: true,
1552 subsampling_factor: 1.0,
1553 shuffling_enabled: false,
1554 multi_round_amplification: true,
1555 heterogeneous_amplification: false,
1556 }
1557 }
1558}
1559
1560impl Default for CommunicationPrivacyConfig {
1561 fn default() -> Self {
1562 Self {
1563 encryption_enabled: true,
1564 anonymous_channels: false,
1565 communication_noise: false,
1566 traffic_analysis_protection: false,
1567 threat_modeling: AdvancedThreatModelingConfig::default(),
1568 cross_silo_config: None,
1569 }
1570 }
1571}
1572
1573impl Default for AdversarialCapabilities {
1574 fn default() -> Self {
1575 Self {
1576 computational_resources: ComputationalThreatLevel::Limited,
1577 network_capabilities: NetworkThreatCapabilities::default(),
1578 data_capabilities: DataThreatCapabilities::default(),
1579 algorithmic_knowledge: AlgorithmicKnowledgeLevel::BlackBox,
1580 collusion_potential: CollusionThreatLevel::None,
1581 attack_persistence: AttackPersistenceLevel::OneTime,
1582 }
1583 }
1584}
1585
1586impl Default for AnomalyDetectionConfig {
1587 fn default() -> Self {
1588 Self {
1589 algorithms: vec![AnomalyDetectionAlgorithm::StatisticalBaseline],
1590 thresholds: AnomalyThresholds::default(),
1591 response_actions: AnomalyResponseActions::default(),
1592 }
1593 }
1594}
1595
1596impl Default for AnomalyThresholds {
1597 fn default() -> Self {
1598 Self {
1599 statistical_threshold: 0.95,
1600 confidence_threshold: 0.8,
1601 false_positive_rate: 0.05,
1602 }
1603 }
1604}
1605
1606impl Default for AnomalyResponseActions {
1607 fn default() -> Self {
1608 Self {
1609 alert_generation: true,
1610 automatic_quarantine: false,
1611 enhanced_monitoring: true,
1612 incident_escalation: false,
1613 }
1614 }
1615}
1616
1617impl Default for ThreatCorrelationConfig {
1618 fn default() -> Self {
1619 Self {
1620 correlation_algorithms: vec![CorrelationAlgorithm::StatisticalCorrelation],
1621 temporal_window: Duration::from_secs(3600), cross_client_correlation: false,
1623 }
1624 }
1625}
1626
1627impl Default for RiskAssessmentConfig {
1628 fn default() -> Self {
1629 Self {
1630 methodology: RiskAssessmentMethodology::QualitativeAssessment,
1631 risk_tolerance: RiskToleranceLevels::default(),
1632 impact_assessment: ImpactAssessmentCriteria::default(),
1633 likelihood_estimation: LikelihoodEstimationMethods::default(),
1634 mitigation_strategies: RiskMitigationStrategies::default(),
1635 }
1636 }
1637}
1638
1639impl Default for RiskToleranceLevels {
1640 fn default() -> Self {
1641 Self {
1642 privacy_risk_tolerance: 0.1,
1643 security_risk_tolerance: 0.05,
1644 utility_risk_tolerance: 0.2,
1645 operational_risk_tolerance: 0.15,
1646 }
1647 }
1648}
1649
1650impl Default for ImpactAssessmentCriteria {
1651 fn default() -> Self {
1652 Self {
1653 confidentiality_impact: ImpactLevel::Medium,
1654 integrity_impact: ImpactLevel::High,
1655 availability_impact: ImpactLevel::Medium,
1656 compliance_impact: ImpactLevel::High,
1657 }
1658 }
1659}
1660
1661impl Default for LikelihoodEstimationMethods {
1662 fn default() -> Self {
1663 Self {
1664 historical_analysis: true,
1665 expert_judgment: true,
1666 threat_modeling: false,
1667 simulation_based: false,
1668 }
1669 }
1670}
1671
1672impl Default for ReputationSystemConfig {
1673 fn default() -> Self {
1674 Self {
1675 enabled: false,
1676 initial_reputation: 1.0,
1677 reputation_decay: 0.95,
1678 min_reputation: 0.1,
1679 outlier_penalty: 0.1,
1680 contribution_bonus: 0.05,
1681 }
1682 }
1683}
1684
1685impl Default for StatisticalTestConfig {
1686 fn default() -> Self {
1687 Self {
1688 enabled: false,
1689 test_type: StatisticalTestType::ZScore,
1690 significancelevel: 0.05,
1691 window_size: 10,
1692 adaptive_threshold: false,
1693 }
1694 }
1695}
1696
1697impl Default for LocalAdaptationConfig {
1698 fn default() -> Self {
1699 Self {
1700 adaptation_rate: 0.01,
1701 local_epochs: 1,
1702 adaptation_frequency: 1,
1703 adaptation_method: AdaptationMethod::FineTuning,
1704 regularization_strength: 0.01,
1705 }
1706 }
1707}
1708
1709impl Default for ClusteringConfig {
1710 fn default() -> Self {
1711 Self {
1712 num_clusters: 5,
1713 clustering_method: ClusteringMethod::KMeans,
1714 similarity_metric: SimilarityMetric::CosineSimilarity,
1715 cluster_update_frequency: 10,
1716 privacy_preserving_clustering: false,
1717 }
1718 }
1719}
1720
1721impl Default for MetaLearningConfig {
1722 fn default() -> Self {
1723 Self {
1724 inner_learning_rate: 0.01,
1725 outer_learning_rate: 0.001,
1726 inner_steps: 5,
1727 meta_batch_size: 32,
1728 adaptation_method: MetaAdaptationMethod::MAML,
1729 }
1730 }
1731}
1732
1733impl Default for DynamicPrivacyConfig {
1734 fn default() -> Self {
1735 Self {
1736 enabled: false,
1737 adaptation_frequency: 10,
1738 privacy_sensitivity: 1.0,
1739 utility_weight: 0.5,
1740 fairness_weight: 0.3,
1741 }
1742 }
1743}
1744
1745impl Default for ContextualAdjustmentConfig {
1746 fn default() -> Self {
1747 Self {
1748 enabled: false,
1749 context_factors: vec![ContextFactor::DataSensitivity],
1750 adjustment_sensitivity: 0.1,
1751 temporal_adaptation: false,
1752 }
1753 }
1754}
1755
1756impl Default for LazyAggregationConfig {
1757 fn default() -> Self {
1758 Self {
1759 enabled: false,
1760 aggregation_threshold: 0.9,
1761 staleness_tolerance: 5,
1762 gradient_similarity_threshold: 0.8,
1763 }
1764 }
1765}
1766
1767impl Default for FederatedDropoutConfig {
1768 fn default() -> Self {
1769 Self {
1770 enabled: false,
1771 dropout_probability: 0.1,
1772 adaptive_dropout: false,
1773 importance_sampling: false,
1774 }
1775 }
1776}
1777
1778impl Default for AsyncUpdateConfig {
1779 fn default() -> Self {
1780 Self {
1781 enabled: false,
1782 staleness_threshold: 10,
1783 mixing_coefficient: 0.9,
1784 buffering_strategy: BufferingStrategy::FIFO,
1785 }
1786 }
1787}
1788
1789impl Default for QoSConfig {
1790 fn default() -> Self {
1791 Self {
1792 priority_levels: 3,
1793 latency_targets: vec![100.0, 200.0, 500.0],
1794 throughput_targets: vec![10.0, 5.0, 1.0],
1795 fairness_constraints: true,
1796 }
1797 }
1798}
1799
1800impl Default for MemoryManagementConfig {
1801 fn default() -> Self {
1802 Self {
1803 memory_budget: 1000,
1804 eviction_strategy: EvictionStrategy::LRU,
1805 compression_enabled: false,
1806 memory_adaptation: false,
1807 }
1808 }
1809}
1810
1811impl Default for TaskDetectionConfig {
1812 fn default() -> Self {
1813 Self {
1814 enabled: false,
1815 detection_method: TaskDetectionMethod::GradientBased,
1816 sensitivity_threshold: 0.1,
1817 adaptation_delay: 5,
1818 }
1819 }
1820}
1821
1822impl Default for KnowledgeTransferConfig {
1823 fn default() -> Self {
1824 Self {
1825 transfer_method: KnowledgeTransferMethod::ParameterTransfer,
1826 transfer_strength: 0.5,
1827 selective_transfer: false,
1828 privacy_preserving: true,
1829 }
1830 }
1831}
1832
1833impl Default for ForgettingPreventionConfig {
1834 fn default() -> Self {
1835 Self {
1836 method: ForgettingPreventionMethod::EWC,
1837 regularization_strength: 0.1,
1838 memory_replay_ratio: 0.1,
1839 importance_estimation: ImportanceEstimationMethod::FisherInformation,
1840 }
1841 }
1842}
1843
1844impl Default for AdaptiveBudgetConfig {
1845 fn default() -> Self {
1846 Self {
1847 enabled: false,
1848 allocation_strategy: BudgetAllocationStrategy::Uniform,
1849 dynamic_privacy: DynamicPrivacyConfig::default(),
1850 importance_weighting: false,
1851 contextual_adjustment: ContextualAdjustmentConfig::default(),
1852 }
1853 }
1854}