pub enum CryptoError {
Show 17 variants
KdfExpandInvalidPrkLen,
KdfExpandInvalidOutputLen,
KdfUnsupported,
KemDeriveKeyPair,
KemMalformedSkX,
KemMalformedPkX,
KemOpUnsupported,
KemUnsupported,
AeadInvalidKey,
AeadInvalidNonce,
AeadInvalidCt,
AeadSeal,
AeadOpen,
AeadUnsupported,
InsufficientRandomness,
Unspecified,
Custom(Box<dyn Error + Send + Sync + 'static>),
}Expand description
Errors thrown by implementations.
Variants§
KdfExpandInvalidPrkLen
Expand() failed due to invalid PRK length.
This error is returned when:
- For HKDF-Expand, the PRK length MUST be at least
Nhbytes.
KdfExpandInvalidOutputLen
Expand() failed due to invalid output length.
This error is returned when:
- For HKDF-Expand, the requested output length MUST NOT exceed the
maximum allowed length (255 *
Nh).
KdfUnsupported
The KDF algorithm is unknown or unsupported by the crypto backend.
KemDeriveKeyPair
Failed to derive a key pair from the input keying material.
This error is returned when:
- Failed to generate valid private key from the input keying material in 255 iterations.
KemMalformedSkX
The skX is malformed and cannot be used as a private key for the KEM.
KemMalformedPkX
The pkX is malformed and cannot be used as a public key for the KEM.
KemOpUnsupported
The operation is not supported by the KEM algorithm.
This error is returned when the KEM algorithm does not support
the requested operation, e.g., Encap or Decap.
KemUnsupported
The KEM algorithm is unknown or unsupported by the crypto backend.
AeadInvalidKey
Invalid key for the AEAD algorithm.
AeadInvalidNonce
Invalid nonce for the AEAD algorithm.
AeadInvalidCt
The cipher text ct is invalid for the AEAD algorithm.
This error is returned when:
- The cipher text length is less than the tag length.
AeadSeal
Error sealing an AEAD cipher text.
AeadOpen
Error opening an AEAD cipher text.
AeadUnsupported
Unknown or unsupported AEAD algorithm.
InsufficientRandomness
Insufficient randomness to perform the operation.
This error is rarely returned.
Unspecified
Unspecified error
Custom(Box<dyn Error + Send + Sync + 'static>)
A crypto library error.