core_utils/key_recovery/mod.rs
1/// Upper bound on the number of peers supported for the MXE key recovery.
2/// The block length n of the Reed-Solomon code is at most N.
3pub const MXE_KEY_RECOVERY_N: usize = 100;
4
5/// Upper bound on the message length k of the Reed-Solomon code.
6/// If an adversary controls k or more peers then he can reconstruct the key shares.
7/// If the number of controlled peers is greater than (d-1)/2 then the adversary can
8/// sabotage the key recovery and the peers will never get caught.
9pub const MXE_KEY_RECOVERY_K: usize = (MXE_KEY_RECOVERY_N - 1) / 3 + 1;
10
11/// Upper bound on the distance d of the Reed-Solomon code.
12/// The key recovery can identify and correct up to (d-1)/2 corrupt peers.
13/// If n mod 3 = 0 then k = (d-1)/2, i.e., if an adversary controls k peers then
14/// the key is recoverable (the corrupt peers can be identified), but the MXE is
15/// expected to be compromised.
16pub const MXE_KEY_RECOVERY_D: usize = MXE_KEY_RECOVERY_N - MXE_KEY_RECOVERY_K + 1;
17
18pub enum KeyRecoveryError {
19 InvalidInput(String),
20 FailedRecovery(String),
21}
22
23pub mod compute_errors;