-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Sane error handling and some simplification (ditch unwrap) * excessive code and entities were removed
- Loading branch information
Showing
4 changed files
with
256 additions
and
300 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,26 @@ | ||
use thiserror::Error; | ||
// Legacy definitions for errors which will be gone with arkworks upgrade to `>=0.4.0`. | ||
// `use ark_ec::hashing::HashToCurveError;` | ||
|
||
// use thiserror::Error; | ||
|
||
/// This is an error that could occur when running a cryptograhic primitive | ||
#[derive(Error, Debug, PartialEq)] | ||
pub enum CryptoError { | ||
#[error("Cannot hash to curve")] | ||
CannotHashToCurve, | ||
// #[derive(Error, Debug, PartialEq)] | ||
// pub enum CryptoError { | ||
// #[error("Cannot hash to curve")] | ||
// CannotHashToCurve, | ||
|
||
// #[error("Cannot encode a point not on the curve")] | ||
// PointNotOnCurve, | ||
// } | ||
|
||
#[error("Cannot encode a point not on the curve")] | ||
PointNotOnCurve, | ||
// Let's outline what errors will be in `~0.4.0` | ||
#[derive(Debug, Clone)] | ||
pub enum HashToCurveError { | ||
UnsupportedCurveError(String), | ||
MapToCurveError(String), | ||
/* let's add two more items to absorb everything | ||
in `crate::hash_to_curve` which is | ||
subject to deprecation */ | ||
Legacy, | ||
ReferenceTryAndIncrement, | ||
} |
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
Oops, something went wrong.