forked from privacy-scaling-explorations/zkevm-circuits
-
Notifications
You must be signed in to change notification settings - Fork 391
/
Copy pathavail.rs
105 lines (90 loc) · 2.89 KB
/
avail.rs
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
use super::AssignedBlobDataExport;
use crate::{BatchData, RlcConfig};
use eth_types::{H256, U256};
use halo2_base::{gates::range::RangeConfig, AssignedValue, Context};
use halo2_ecc::bigint::CRTInteger;
use halo2_proofs::halo2curves::bls12_381::Scalar;
use halo2_proofs::{
circuit::{AssignedCell, Layouter, Value},
halo2curves::bn256::Fr,
plonk::{ConstraintSystem, Error, Expression},
};
use snark_verifier_sdk::LIMBS;
use zkevm_circuits::{table::U8Table, util::Challenges};
pub const BLOB_WIDTH: usize = 4096;
#[derive(Debug, Clone)]
pub struct BlobConsistencyConfig<const N_SNARKS: usize> {}
impl<const N_SNARKS: usize> BlobConsistencyConfig<N_SNARKS> {
pub fn construct(
_meta: &mut ConstraintSystem<Fr>,
_challenges: &Challenges<Expression<Fr>>,
_u8_table: U8Table,
_: RangeConfig<Fr>,
) -> Self {
unimplemented!()
}
pub fn assign_barycentric(
&self,
_ctx: &mut Context<Fr>,
_bytes: &[u8],
_challenge: U256,
) -> AssignedBarycentricEvaluationConfig {
unimplemented!()
}
pub fn assign_blob_data(
&self,
_layouter: &mut impl Layouter<Fr>,
_challenge_value: Challenges<Value<Fr>>,
_rlc_config: &RlcConfig,
_blob_bytes: &[u8],
) -> Result<AssignedBlobDataExport, Error> {
unimplemented!()
}
pub fn link(
_layouter: &mut impl Layouter<Fr>,
_blob_crts_limbs: &[[AssignedCell<Fr, Fr>; LIMBS]],
_barycentric_crts: &[CRTInteger<Fr>],
) -> Result<(), Error> {
unimplemented!()
}
}
#[derive(Debug, Clone, Copy, Default)]
pub struct BlobConsistencyWitness {
blob_versioned_hash: H256,
challenge_digest: H256,
evaluation: Scalar,
}
impl BlobConsistencyWitness {
pub fn new<const N_SNARKS: usize>(_bytes: &[u8], _batch_data: &BatchData<N_SNARKS>) -> Self {
unimplemented!()
}
pub fn id(&self) -> H256 {
unimplemented!()
}
pub fn challenge_digest(&self) -> U256 {
unimplemented!()
}
pub fn challenge(&self) -> Scalar {
unimplemented!()
}
pub fn evaluation(&self) -> Scalar {
unimplemented!()
}
pub fn blob_data_proof(&self) -> [H256; 2] {
unimplemented!()
}
}
#[derive(Default)]
pub struct AssignedBarycentricEvaluationConfig {
/// CRTIntegers for the BLOB_WIDTH number of blob polynomial coefficients, followed by a
/// CRTInteger for the challenge digest.
pub(crate) barycentric_assignments: Vec<CRTInteger<Fr>>,
/// 32 Assigned cells representing the LE-bytes of challenge z.
pub(crate) z_le: Vec<AssignedValue<Fr>>,
/// 32 Assigned cells representing the LE-bytes of evaluation y.
pub(crate) y_le: Vec<AssignedValue<Fr>>,
}
/// Get the blob data bytes that will be populated in BlobDataConfig.
pub fn get_blob_bytes(_batch_bytes: &[u8]) -> Vec<u8> {
unimplemented!("trick for linting");
}