-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Michael Lodder <[email protected]>
- Loading branch information
1 parent
af50481
commit 626bcdb
Showing
6 changed files
with
74 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
use thiserror::Error; | ||
|
||
/// Errors produced by the Paillier scheme | ||
#[derive(Debug, Error)] | ||
pub enum PaillierError { | ||
/// Postcard deserialization error | ||
#[error("Invalid serialized bytes: {0}")] | ||
PostcardError(#[from] postcard::Error), | ||
/// Invalid proof size | ||
#[error("Invalid proof size: {0}")] | ||
InvalidProofSize(usize), | ||
/// Invalid encryption key | ||
#[error("Invalid encryption key")] | ||
InvalidEncryptionKey, | ||
/// Invalid encryption inputs | ||
#[error("Invalid encryption inputs")] | ||
InvalidEncryptionInputs, | ||
/// Invalid ciphertext add inputs | ||
#[error("Invalid ciphertext add inputs")] | ||
InvalidCipherTextAddInputs, | ||
/// Invalid ciphertext multiply inputs | ||
#[error("Invalid ciphertext multiply inputs")] | ||
InvalidCipherTextMulInputs, | ||
/// Invalid ciphertext | ||
#[error("Invalid ciphertext, unable to decrypt")] | ||
InvalidCiphertext, | ||
} | ||
|
||
/// Paillier results | ||
pub type PaillierResult<T> = Result<T, PaillierError>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters