Use a unified error set for std/crypto/*
This ensures that errors are used consistently across all operations.
This commit is contained in:
34
lib/std/crypto/error.zig
Normal file
34
lib/std/crypto/error.zig
Normal file
@@ -0,0 +1,34 @@
|
||||
pub const Error = error{
|
||||
/// MAC verification failed - The tag doesn't verify for the given ciphertext and secret key
|
||||
AuthenticationFailed,
|
||||
|
||||
/// The requested output length is too long for the chosen algorithm
|
||||
OutputTooLong,
|
||||
|
||||
/// Finite field operation returned the identity element
|
||||
IdentityElement,
|
||||
|
||||
/// Encoded input cannot be decoded
|
||||
InvalidEncoding,
|
||||
|
||||
/// The signature does't verify for the given message and public key
|
||||
SignatureVerificationFailed,
|
||||
|
||||
/// Both a public and secret key have been provided, but they are incompatible
|
||||
KeyMismatch,
|
||||
|
||||
/// Encoded input is not in canonical form
|
||||
NonCanonical,
|
||||
|
||||
/// Square root has no solutions
|
||||
NotSquare,
|
||||
|
||||
/// Verification string doesn't match the provided password and parameters
|
||||
PasswordVerificationFailed,
|
||||
|
||||
/// Parameters would be insecure to use
|
||||
WeakParameters,
|
||||
|
||||
/// Public key would be insecure to use
|
||||
WeakPublicKey,
|
||||
};
|
||||
Reference in New Issue
Block a user