Skip to content

Commit

Permalink
[SQUASH] Tim round 2
Browse files Browse the repository at this point in the history
  • Loading branch information
cjpatton committed Apr 7, 2021
1 parent 91b02b0 commit ae8cc97
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@ impl<F: FieldElement> Client<F> {
let copy_data = |share_data: &mut [F]| {
share_data[..].clone_from_slice(data);
};
self.encode_with(copy_data)
.or_else(|err| Err(ClientError::Encrypt(err)))
Ok(self.encode_with(copy_data)?)
}

/// Construct a pair of encrypted shares using a initilization function.
Expand Down
2 changes: 1 addition & 1 deletion src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ impl<F: FieldElement> Server<F> {
fn deserialize_share(&self, encrypted_share: &[u8]) -> Result<Vec<F>, ServerError> {
let share = decrypt_share(encrypted_share, &self.private_key)?;
Ok(if self.is_first_server {
deserialize(&share).or_else(|err| Err(ServerError::Serialize(err)))?
deserialize(&share)?
} else {
let len = proof_length(self.dimension);
extract_share_from_seed(len, &share)
Expand Down

0 comments on commit ae8cc97

Please sign in to comment.