Skip to content

Commit 2783a81

Browse files
committed
integarte blake g gate
1 parent fcb07cb commit 2783a81

28 files changed

Lines changed: 3032 additions & 24 deletions

crates/cairo_air/src/privacy_test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,5 +265,5 @@ fn test_privacy_proof_info() {
265265
let proof_info = ProofInfo::from_config(&proof_config);
266266
println!("{proof_info}");
267267
// Assert the total size in bytes.
268-
assert_eq!(proof_info.total_bytes(), 355088);
268+
assert_eq!(proof_info.total_bytes(), 373108);
269269
}

crates/cairo_air/src/sample_evaluations.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// AIR version 80108501
1+
// AIR version 0c8c7d49
22
use stwo::core::fields::{cm31::CM31, m31::M31, qm31::QM31};
33
pub const ADD_AP_OPCODE_SAMPLE_EVAL_RESULT: QM31 =
44
QM31(CM31(M31(1435814162), M31(1618992457)), CM31(M31(840348268), M31(442754761)));

crates/circuit_air/src/circuit_components.rs

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
use crate::circuit_claim::{CircuitClaim, CircuitInteractionClaim, CircuitInteractionElements};
22
use crate::components::{
3-
blake_g, blake_gate, blake_output, blake_round, blake_round_sigma, eq, m_31_to_u_32, qm31_ops,
4-
range_check_15, range_check_16, triple_xor, triple_xor_32, verify_bitwise_xor_4,
5-
verify_bitwise_xor_7, verify_bitwise_xor_8, verify_bitwise_xor_9, verify_bitwise_xor_12,
3+
blake_g, blake_g_gate, blake_gate, blake_output, blake_round, blake_round_sigma, eq,
4+
m_31_to_u_32, qm31_ops, range_check_15, range_check_16, triple_xor, triple_xor_32,
5+
verify_bitwise_xor_4, verify_bitwise_xor_7, verify_bitwise_xor_8, verify_bitwise_xor_9,
6+
verify_bitwise_xor_12,
67
};
78
use stwo::core::air::Component;
89
use stwo_constraint_framework::TraceLocationAllocator;
@@ -28,6 +29,7 @@ define_component_list! {
2829
TripleXor32,
2930
TripleXor,
3031
M31ToU32,
32+
BlakeGGate,
3133
VerifyBitwiseXor8,
3234
VerifyBitwiseXor12,
3335
VerifyBitwiseXor4,
@@ -48,6 +50,7 @@ pub struct CircuitComponents {
4850
pub triple_xor_32: triple_xor_32::Component,
4951
pub triple_xor: triple_xor::Component,
5052
pub m_31_to_u_32: m_31_to_u_32::Component,
53+
pub blake_g_gate: blake_g_gate::Component,
5154
pub verify_bitwise_xor_8: verify_bitwise_xor_8::Component,
5255
pub verify_bitwise_xor_12: verify_bitwise_xor_12::Component,
5356
pub verify_bitwise_xor_4: verify_bitwise_xor_4::Component,
@@ -161,6 +164,16 @@ impl CircuitComponents {
161164
},
162165
interaction_claim.claimed_sums[ComponentList::M31ToU32 as usize],
163166
);
167+
let blake_g_gate_component = blake_g_gate::Component::new(
168+
tree_span_provider,
169+
blake_g_gate::Eval {
170+
claim: blake_g_gate::Claim {
171+
log_size: circuit_claim.log_sizes[ComponentList::BlakeGGate as usize],
172+
},
173+
common_lookup_elements: interaction_elements.common_lookup_elements.clone(),
174+
},
175+
interaction_claim.claimed_sums[ComponentList::BlakeGGate as usize],
176+
);
164177
let verify_bitwise_xor_8_component = verify_bitwise_xor_8::Component::new(
165178
tree_span_provider,
166179
verify_bitwise_xor_8::Eval {
@@ -228,6 +241,7 @@ impl CircuitComponents {
228241
triple_xor_32: triple_xor_32_component,
229242
triple_xor: triple_xor_component,
230243
m_31_to_u_32: m_31_to_u_32_component,
244+
blake_g_gate: blake_g_gate_component,
231245
verify_bitwise_xor_8: verify_bitwise_xor_8_component,
232246
verify_bitwise_xor_12: verify_bitwise_xor_12_component,
233247
verify_bitwise_xor_4: verify_bitwise_xor_4_component,
@@ -250,6 +264,7 @@ impl CircuitComponents {
250264
Box::new(self.triple_xor_32) as Box<dyn Component>,
251265
Box::new(self.triple_xor) as Box<dyn Component>,
252266
Box::new(self.m_31_to_u_32) as Box<dyn Component>,
267+
Box::new(self.blake_g_gate) as Box<dyn Component>,
253268
Box::new(self.verify_bitwise_xor_8) as Box<dyn Component>,
254269
Box::new(self.verify_bitwise_xor_12) as Box<dyn Component>,
255270
Box::new(self.verify_bitwise_xor_4) as Box<dyn Component>,

0 commit comments

Comments
 (0)