Skip to content

Commit e29bfbc

Browse files
committed
fmt
1 parent 1139412 commit e29bfbc

File tree

4 files changed

+20
-33
lines changed

4 files changed

+20
-33
lines changed

Diff for: src/air/composition.cairo

+3-5
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ fn eval_composition_polynomial(
1818
let public_memory_column_size = trace_domain_size / PUBLIC_MEMORY_STEP;
1919
assert(public_memory_column_size >= 0, 'Invalid column size');
2020

21-
let public_memory_prod_ratio = public_input.get_public_memory_product_ratio(memory_z, memory_alpha, public_memory_column_size);
21+
let public_memory_prod_ratio = public_input
22+
.get_public_memory_product_ratio(memory_z, memory_alpha, public_memory_column_size);
2223

2324
// TODO diluted
2425

@@ -37,10 +38,7 @@ fn eval_composition_polynomial(
3738
rc_max: 0,
3839
offset_size: 0,
3940
half_offset_size: 0,
40-
pedersen_shift_point: EcPoint {
41-
x: 0,
42-
y: 0
43-
},
41+
pedersen_shift_point: EcPoint { x: 0, y: 0 },
4442
pedersen_points_x: 0,
4543
pedersen_points_y: 0,
4644
memory_multi_column_perm_perm_interaction_elm: 0,

Diff for: src/air/global_values.cairo

-4
Original file line numberDiff line numberDiff line change
@@ -18,24 +18,20 @@ struct GlobalValues {
1818
initial_bitwise_addr: felt252,
1919
rc_min: felt252,
2020
rc_max: felt252,
21-
2221
// Constants.
2322
offset_size: felt252,
2423
half_offset_size: felt252,
2524
pedersen_shift_point: EcPoint,
26-
2725
// Periodic columns.
2826
pedersen_points_x: felt252,
2927
pedersen_points_y: felt252,
30-
3128
// Interaction elements.
3229
memory_multi_column_perm_perm_interaction_elm: felt252,
3330
memory_multi_column_perm_hash_interaction_elm0: felt252,
3431
rc16_perm_interaction_elm: felt252,
3532
diluted_check_permutation_interaction_elm: felt252,
3633
diluted_check_interaction_z: felt252,
3734
diluted_check_interaction_alpha: felt252,
38-
3935
// Permutation products.
4036
memory_multi_column_perm_perm_public_memory_prod: felt252,
4137
rc16_perm_public_memory_prod: felt252,

Diff for: src/air/public_input.cairo

+5-8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
use cairo_verifier::air::public_memory::{Page, PageTrait, ContinuousPageHeader, get_continuous_pages_product};
1+
use cairo_verifier::air::public_memory::{
2+
Page, PageTrait, ContinuousPageHeader, get_continuous_pages_product
3+
};
24
use cairo_verifier::common::felt252::{pow, Felt252PartialOrd, Felt252Div};
35

46
#[derive(Drop)]
@@ -15,10 +17,7 @@ impl PublicInputImpl of PublicInputTrait {
1517
// This is the value that needs to be at the memory__multi_column_perm__perm__public_memory_prod
1618
// member expression.
1719
fn get_public_memory_product_ratio(
18-
self: @PublicInput,
19-
z: felt252,
20-
alpha: felt252,
21-
public_memory_column_size: felt252
20+
self: @PublicInput, z: felt252, alpha: felt252, public_memory_column_size: felt252
2221
) -> felt252 {
2322
let (pages_product, total_length) = self.get_public_memory_product(z, alpha);
2423

@@ -34,9 +33,7 @@ impl PublicInputImpl of PublicInputTrait {
3433

3534
// Returns the product of all public memory cells.
3635
fn get_public_memory_product(
37-
self: @PublicInput,
38-
z: felt252,
39-
alpha: felt252
36+
self: @PublicInput, z: felt252, alpha: felt252
4037
) -> (felt252, felt252) {
4138
let main_page_prod = self.main_page.get_product(z, alpha);
4239

Diff for: src/air/public_memory.cairo

+12-16
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,7 @@ struct ContinuousPageHeader {
3030
#[generate_trait]
3131
impl PageImpl of PageTrait {
3232
// Returns the product of (z - (addr + alpha * val)) over a single page.
33-
fn get_product(
34-
self: @Page,
35-
z: felt252,
36-
alpha: felt252
37-
) -> felt252 {
33+
fn get_product(self: @Page, z: felt252, alpha: felt252) -> felt252 {
3834
let mut res = 1;
3935
let mut i = 0;
4036
loop {
@@ -49,17 +45,17 @@ impl PageImpl of PageTrait {
4945
}
5046

5147
fn get_continuous_pages_product(page_headers: Span<ContinuousPageHeader>) -> (felt252, felt252) {
52-
let mut res = 1;
53-
let mut total_length = 0;
54-
let mut i = 0;
55-
loop {
56-
if i == page_headers.len() {
57-
break (res, total_length);
58-
}
59-
let current = page_headers.at(i);
60-
61-
res *= *current.prod;
62-
total_length += *current.size;
48+
let mut res = 1;
49+
let mut total_length = 0;
50+
let mut i = 0;
51+
loop {
52+
if i == page_headers.len() {
53+
break (res, total_length);
6354
}
55+
let current = page_headers.at(i);
56+
57+
res *= *current.prod;
58+
total_length += *current.size;
59+
}
6460
}
6561

0 commit comments

Comments
 (0)