-
Notifications
You must be signed in to change notification settings - Fork 396
Expand file tree
/
Copy pathmod.rs
More file actions
36 lines (31 loc) · 845 Bytes
/
mod.rs
File metadata and controls
36 lines (31 loc) · 845 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
pub mod lib;
pub mod sp1_aggregator;
use sp1_aggregator::{AlignedSP1VerificationError, SP1ProofWithPubValuesAndElf};
pub enum ZKVMEngine {
SP1,
}
pub enum AlignedProof {
SP1(SP1ProofWithPubValuesAndElf),
}
impl AlignedProof {
pub fn hash(&self) -> [u8; 32] {
match self {
AlignedProof::SP1(proof) => proof.hash_vk_and_pub_inputs(),
}
}
}
#[derive(Debug)]
pub enum AlignedVerificationError {
Sp1(AlignedSP1VerificationError),
}
impl AlignedProof {
pub fn verify(&self) -> Result<(), AlignedVerificationError> {
match self {
AlignedProof::SP1(proof) => sp1_aggregator::verify(proof).map_err(
|arg0: sp1_aggregator::AlignedSP1VerificationError| {
AlignedVerificationError::Sp1(arg0)
},
),
}
}
}