Skip to content

Commit 21b31ef

Browse files
committed
Deserialize opening proof
1 parent cea7b8e commit 21b31ef

2 files changed

Lines changed: 31 additions & 3 deletions

File tree

operator/mina/lib/src/pickles_preproc/preprocess.rs

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
use kimchi::{circuits::wires::COLUMNS, mina_curves::pasta::Pallas, poly_commitment::PolyComm};
22

33
use crate::pickles_preproc::{
4-
state_proof::Commitments,
5-
type_aliases::{WrapECPoint, WrapProverCommitments},
4+
state_proof::{Bulletproof, Commitments},
5+
type_aliases::{WrapECPoint, WrapOpeningProof, WrapProverCommitments, WrapScalar},
66
};
77

88
use super::{
@@ -47,6 +47,34 @@ pub fn deserialize_state_proof(
4747
lookup,
4848
};
4949

50+
let Bulletproof {
51+
challenge_polynomial_commitment: hex_sg,
52+
delta: hex_delta,
53+
lr: hex_lr,
54+
z_1: hex_z_1,
55+
z_2: hex_z_2,
56+
} = state_proof.proof.bulletproof;
57+
let sg = WrapECPoint::try_from(hex_sg)?.0;
58+
let delta = WrapECPoint::try_from(hex_delta)?.0;
59+
let lr = hex_lr
60+
.into_iter()
61+
.map(|(hex_p1, hex_p2)| -> Result<(Pallas, Pallas), String> {
62+
let p1 = WrapECPoint::try_from(hex_p1)?.0;
63+
let p2 = WrapECPoint::try_from(hex_p2)?.0;
64+
Ok((p1, p2))
65+
})
66+
.collect::<Result<_, _>>()?;
67+
let z1 = WrapScalar::try_from(hex_z_1)?.0;
68+
let z2 = WrapScalar::try_from(hex_z_2)?.0;
69+
70+
let _opening_proof = WrapOpeningProof {
71+
sg,
72+
delta,
73+
lr,
74+
z1,
75+
z2,
76+
};
77+
5078
/*
5179
let prover_proof = WrapProverProof {
5280
commitments,

operator/mina/lib/src/pickles_preproc/state_proof.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ pub struct Proof {
2626
pub struct Bulletproof {
2727
pub challenge_polynomial_commitment: HexPointCoordinates,
2828
pub delta: HexPointCoordinates,
29-
pub lr: [[HexPointCoordinates; 2]; 15],
29+
pub lr: Vec<(HexPointCoordinates, HexPointCoordinates)>,
3030
pub z_1: HexScalar,
3131
pub z_2: HexScalar,
3232
}

0 commit comments

Comments
 (0)