ekzg_serialization/errors.rs
1/// Errors that can occur during deserialization of untrusted input from the public API
2/// or the trusted setup.
3#[derive(Debug)]
4pub enum Error {
5 /// Failed to deserialize a scalar value from the given bytes.
6 CouldNotDeserializeScalar {
7 /// Raw bytes attempted to deserialize.
8 bytes: Vec<u8>,
9 },
10 /// Failed to deserialize a G1 group point from the given bytes.
11 CouldNotDeserializeG1Point {
12 /// Raw bytes attempted to deserialize.
13 bytes: Vec<u8>,
14 },
15 /// Scalar had an incorrect byte length.
16 ScalarHasInvalidLength {
17 /// Raw bytes with incorrect length.
18 bytes: Vec<u8>,
19 /// Detected length of the bytes.
20 length: usize,
21 },
22 /// Blob had an incorrect byte length.
23 BlobHasInvalidLength {
24 /// Raw bytes with incorrect length.
25 bytes: Vec<u8>,
26 /// Detected length of the bytes.
27 length: usize,
28 },
29 /// G1 point had an incorrect byte length.
30 G1PointHasInvalidLength {
31 /// Raw bytes with incorrect length.
32 bytes: Vec<u8>,
33 /// Detected length of the bytes.
34 length: usize,
35 },
36}