@@ -6,6 +6,7 @@ use crate::{
6
6
MAX_SECRET_LEN ,
7
7
MIN_SECRET_LEN ,
8
8
Error ,
9
+ Result ,
9
10
interpolate:: interpolate,
10
11
} ;
11
12
@@ -16,7 +17,7 @@ fn create_digest(random_data: &[u8], shared_secret: &[u8]) -> [u8; 32] {
16
17
hmac_sha256 ( random_data, shared_secret)
17
18
}
18
19
19
- fn validate_parameters ( threshold : usize , share_count : usize , secret_length : usize ) -> Result < ( ) , Error > {
20
+ fn validate_parameters ( threshold : usize , share_count : usize , secret_length : usize ) -> Result < ( ) > {
20
21
if share_count > MAX_SHARE_COUNT {
21
22
return Err ( Error :: TooManyShares ) ;
22
23
} else if threshold < 1 || threshold > share_count {
@@ -73,7 +74,7 @@ pub fn split_secret(
73
74
share_count : usize ,
74
75
secret : & [ u8 ] ,
75
76
random_generator : & mut impl RandomNumberGenerator
76
- ) -> Result < Vec < Vec < u8 > > , Error > {
77
+ ) -> Result < Vec < Vec < u8 > > > {
77
78
validate_parameters ( threshold, share_count, secret. len ( ) ) ?;
78
79
79
80
if threshold == 1 {
@@ -158,7 +159,7 @@ pub fn split_secret(
158
159
///
159
160
/// assert_eq!(secret, b"my secret belongs to me.");
160
161
/// ```
161
- pub fn recover_secret < T > ( indexes : & [ usize ] , shares : & [ T ] ) -> Result < Vec < u8 > , Error >
162
+ pub fn recover_secret < T > ( indexes : & [ usize ] , shares : & [ T ] ) -> Result < Vec < u8 > >
162
163
where T : AsRef < [ u8 ] >
163
164
{
164
165
let threshold = shares. len ( ) ;
0 commit comments