Commit 2e2cd7f 1 parent 6cd60e2 commit 2e2cd7f Copy full SHA for 2e2cd7f
File tree 2 files changed +12
-9
lines changed
2 files changed +12
-9
lines changed Original file line number Diff line number Diff line change 1
- use crate :: { serialization :: SerializationError , CellID } ;
1
+ use crate :: CellID ;
2
2
3
3
/// Errors that can occur while calling a method in the Prover API
4
4
#[ derive( Debug ) ]
@@ -45,3 +45,13 @@ pub enum VerifierError {
45
45
proofs_len : usize ,
46
46
} ,
47
47
}
48
+
49
+ /// Errors that can occur during deserialization of untrusted input from the public API
50
+ #[ derive( Debug ) ]
51
+ pub enum SerializationError {
52
+ CouldNotDeserializeScalar { bytes : Vec < u8 > } ,
53
+ CouldNotDeserializeG1Point { bytes : Vec < u8 > } ,
54
+ ScalarHasInvalidLength { bytes : Vec < u8 > , length : usize } ,
55
+ BlobHasInvalidLength { bytes : Vec < u8 > , length : usize } ,
56
+ G1PointHasInvalidLength { bytes : Vec < u8 > , length : usize } ,
57
+ }
Original file line number Diff line number Diff line change @@ -3,14 +3,7 @@ use crate::constants::{
3
3
} ;
4
4
use bls12_381:: { G1Point , Scalar } ;
5
5
6
- #[ derive( Debug ) ]
7
- pub enum SerializationError {
8
- CouldNotDeserializeScalar { bytes : Vec < u8 > } ,
9
- CouldNotDeserializeG1Point { bytes : Vec < u8 > } ,
10
- ScalarHasInvalidLength { bytes : Vec < u8 > , length : usize } ,
11
- BlobHasInvalidLength { bytes : Vec < u8 > , length : usize } ,
12
- G1PointHasInvalidLength { bytes : Vec < u8 > , length : usize } ,
13
- }
6
+ pub use crate :: errors:: SerializationError ;
14
7
15
8
fn deserialize_bytes_to_scalars ( bytes : & [ u8 ] ) -> Result < Vec < Scalar > , SerializationError > {
16
9
// Check that the bytes are a multiple of the scalar size
You can’t perform that action at this time.
0 commit comments