pub enum PrimitivesError {
Show 22 variants
InvalidPrivateKey(String),
InvalidPublicKey(String),
InvalidSignature(String),
InvalidWif(String),
ChecksumMismatch,
PointNotOnCurve,
InvalidKeyLength {
expected: usize,
got: usize,
},
EncryptionError(String),
DecryptionError(String),
InvalidHex(String),
InvalidHash(String),
InvalidBase58(String),
InsufficientShares {
threshold: usize,
got: usize,
},
InvalidThreshold(String),
DuplicateShare,
VarIntTooLarge,
UnexpectedEof,
HexDecode(FromHexError),
EllipticCurve(Error),
Ecdsa(Error),
Aead,
Other(String),
}Expand description
Unified error type for all primitives operations.
Covers errors from hashing, EC operations, encryption, encoding, and key management.
Variants§
InvalidPrivateKey(String)
Invalid private key data.
InvalidPublicKey(String)
Invalid public key data.
InvalidSignature(String)
Invalid signature data.
InvalidWif(String)
Malformed WIF-encoded key.
ChecksumMismatch
Base58Check checksum did not match.
PointNotOnCurve
EC point is not on the secp256k1 curve.
InvalidKeyLength
Key length does not match the expected size.
EncryptionError(String)
AES-GCM encryption failed.
DecryptionError(String)
AES-GCM decryption or authentication failed.
InvalidHex(String)
Invalid hexadecimal string.
InvalidHash(String)
Invalid hash value.
InvalidBase58(String)
Invalid Base58 encoding.
Not enough Shamir shares to reconstruct the secret.
InvalidThreshold(String)
Shamir threshold value is invalid.
Duplicate Shamir share index.
VarIntTooLarge
Variable-length integer exceeds maximum size.
UnexpectedEof
Unexpected end of input data.
HexDecode(FromHexError)
Hex decoding error.
EllipticCurve(Error)
Elliptic curve error (from k256).
Ecdsa(Error)
ECDSA signature error (from k256/signature).
Aead
AEAD (AES-GCM) error.
Other(String)
Catch-all error.
Trait Implementations§
Source§impl Debug for PrimitivesError
impl Debug for PrimitivesError
Source§impl Display for PrimitivesError
impl Display for PrimitivesError
Source§impl Error for PrimitivesError
impl Error for PrimitivesError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()