mirror of
https://github.com/mii443/RustySecrets.git
synced 2025-08-22 16:25:32 +00:00
Fix wrong validation of threshold
Fortunately as both MIN_SHARES and MIN_THRESHOLD are both set to 2 in errors.rs, the typo had no impact on validation correctness.
This commit is contained in:
@ -83,7 +83,7 @@ pub(crate) fn validate_shares<S: IsShare>(shares: &Vec<S>) -> Result<(u8, usize)
|
||||
}
|
||||
|
||||
pub(crate) fn validate_share_count(threshold: u8, shares_count: u8) -> Result<(u8, u8)> {
|
||||
if threshold < MIN_SHARES {
|
||||
if threshold < MIN_THRESHOLD {
|
||||
bail!(ErrorKind::ThresholdTooSmall(threshold));
|
||||
}
|
||||
if shares_count > MAX_SHARES {
|
||||
|
Reference in New Issue
Block a user