* Minor improvements * Fix `Debug` implementation * Fix de-serialization * Fix accidental usage of nightly * Fix MSRV warning * Replace macro with derive-where * Add `rust-version` into `Cargo.toml` * Move Serde trait implementation macro to `serialization` module * Add ability to test without a Ristretto backend * Improve docs * Fix testing multiple backends together * Implement `Ord` and `PartialOrd` * `no_std` by default * Remove unnecessary `doc_cfg` * Remove dev-dependency on self * Implement `Ord` and `PartialOrd` for `InternalError` * Remove base64 encoding for serde * Only take references * Remove unnecessary qualifications from super-trait times
42 lines
1.5 KiB
Rust
42 lines
1.5 KiB
Rust
// Copyright (c) Facebook, Inc. and its affiliates.
|
|
//
|
|
// This source code is licensed under both the MIT license found in the
|
|
// LICENSE-MIT file in the root directory of this source tree and the Apache
|
|
// License, Version 2.0 found in the LICENSE-APACHE file in the root directory
|
|
// of this source tree.
|
|
|
|
//! A list of error types which are produced during an execution of the protocol
|
|
#[cfg(feature = "std")]
|
|
use std::error::Error;
|
|
|
|
use displaydoc::Display;
|
|
|
|
/// Represents an error in the manipulation of internal cryptographic data
|
|
#[derive(Clone, Copy, Debug, Display, Eq, Hash, Ord, PartialEq, PartialOrd)]
|
|
pub enum InternalError {
|
|
/// Could not parse byte sequence for key
|
|
InvalidByteSequence,
|
|
/// Could not deserialize element, or deserialized to the identity element
|
|
PointError,
|
|
/// Computing the hash-to-curve function failed
|
|
HashToCurveError,
|
|
/// Failure to serialize or deserialize bytes
|
|
SerializationError,
|
|
/// Use of incompatible modes (base vs. verifiable)
|
|
IncompatibleModeError,
|
|
/**
|
|
* Internal error thrown when different-lengthed slices are supplied
|
|
* to the compute_composites() function.
|
|
*/
|
|
MismatchedLengthsForCompositeInputs,
|
|
/// In verifiable mode, occurs when the proof failed to verify
|
|
ProofVerificationError,
|
|
/// Encountered insufficient bytes when attempting to deserialize
|
|
SizeError,
|
|
/// Encountered a zero scalar
|
|
ZeroScalarError,
|
|
}
|
|
|
|
#[cfg(feature = "std")]
|
|
impl Error for InternalError {}
|