Skip to content

Commit

Permalink
moving from eval to coeff based on discussion
Browse files Browse the repository at this point in the history
  • Loading branch information
anupsv committed Aug 8, 2024
1 parent cb69b6d commit 7fe62ad
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions arbitrator/prover/src/kzgbn254.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,11 @@ pub fn prove_kzg_preimage_bn254(
// expand roots of unity
kzg.calculate_roots_of_unity(preimage.len() as u64)?;

// preimage is already padded, unpadding and repadding already padded data can destroy context post IFFT
// as some elements in the bn254 field are represented by 32 bytes, we know that the preimage is padded
// to 32 bytes per DA spec as the preimage is retrieved from DA, so we can use this unchecked function
// preimage is already padded and is expected to be in data domain i.e, this is the actual data but padded
// to power of 2
let blob = Blob::from_padded_bytes_unchecked(preimage);

let blob_polynomial_evaluation_form = blob.to_polynomial(PolynomialFormat::InEvaluationForm)?;
let blob_polynomial_evaluation_form = blob.to_polynomial(PolynomialFormat::InCoefficientForm)?;
let blob_commitment = kzg.commit(&blob_polynomial_evaluation_form)?;

let mut commitment_bytes = Vec::new();
Expand Down

0 comments on commit 7fe62ad

Please sign in to comment.