Skip to content

Commit 305b149

Browse files
huitseekerwwared
authored andcommitted
fix: adjust rebase for blake2s + sha512 events
1 parent 62f9557 commit 305b149

File tree

4 files changed

+36
-7
lines changed

4 files changed

+36
-7
lines changed

core/src/runtime/record.rs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -657,10 +657,13 @@ impl ExecutionRecord {
657657
secp256k1_double_events: take(&mut self.secp256k1_double_events),
658658
bn254_add_events: take(&mut self.bn254_add_events),
659659
bn254_double_events: take(&mut self.bn254_double_events),
660+
blake2s_round_events: take(&mut self.blake2s_round_events),
660661
bls12381_g1_add_events: take(&mut self.bls12381_g1_add_events),
661662
bls12381_g1_double_events: take(&mut self.bls12381_g1_double_events),
662663
sha_extend_events: take(&mut self.sha_extend_events),
663664
sha_compress_events: take(&mut self.sha_compress_events),
665+
sha512_extend_events: take(&mut self.sha512_extend_events),
666+
sha512_compress_events: take(&mut self.sha512_compress_events),
664667
ed_add_events: take(&mut self.ed_add_events),
665668
ed_decompress_events: take(&mut self.ed_decompress_events),
666669
secp256k1_decompress_events: take(&mut self.secp256k1_decompress_events),
@@ -740,6 +743,13 @@ impl ExecutionRecord {
740743
opts.deferred_shift_threshold,
741744
last
742745
);
746+
split_events!(
747+
self,
748+
blake2s_round_events,
749+
shards,
750+
opts.deferred_shift_threshold,
751+
last
752+
);
743753
split_events!(
744754
self,
745755
bls12381_g1_add_events,
@@ -768,6 +778,20 @@ impl ExecutionRecord {
768778
opts.sha_compress_split_threshold,
769779
last
770780
);
781+
split_events!(
782+
self,
783+
sha512_extend_events,
784+
shards,
785+
opts.deferred_shift_threshold,
786+
last
787+
);
788+
split_events!(
789+
self,
790+
sha512_compress_events,
791+
shards,
792+
opts.deferred_shift_threshold,
793+
last
794+
);
771795
split_events!(
772796
self,
773797
ed_add_events,

core/src/stark/air.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,10 @@ impl<F: PrimeField32> RiscvAir<F> {
140140
chips.push(RiscvAir::Sha256Extend(sha_extend));
141141
let sha_compress = ShaCompressChip;
142142
chips.push(RiscvAir::Sha256Compress(sha_compress));
143+
let sha512_extend = Sha512ExtendChip;
144+
chips.push(RiscvAir::Sha512Extend(sha512_extend));
145+
let sha512_compress = Sha512CompressChip;
146+
chips.push(RiscvAir::Sha512Compress(sha512_compress));
143147
let ed_add_assign = EdAddAssignChip::<EdwardsCurve<Ed25519Parameters>>::new();
144148
chips.push(RiscvAir::Ed25519Add(ed_add_assign));
145149
let ed_decompress = EdDecompressChip::<Ed25519Parameters>::default();
@@ -169,10 +173,6 @@ impl<F: PrimeField32> RiscvAir<F> {
169173
chips.push(RiscvAir::Bls12381G1Decompress(bls12381_g1_decompress));
170174
let blake_2s_round = Blake2sRoundChip::new();
171175
chips.push(RiscvAir::Blake2sRound(blake_2s_round));
172-
let sha512_extend = Sha512ExtendChip;
173-
chips.push(RiscvAir::Sha512Extend(sha512_extend));
174-
let sha512_compress = Sha512CompressChip;
175-
chips.push(RiscvAir::Sha512Compress(sha512_compress));
176176
let div_rem = DivRemChip;
177177
chips.push(RiscvAir::DivRem(div_rem));
178178

core/src/syscall/precompiles/sha512/compress/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,9 @@ impl Sha512CompressChip {
131131
pub mod compress_tests {
132132

133133
use crate::{
134-
runtime::{Instruction, Opcode, Program, SyscallCode}, stark::DefaultProver, utils::{run_test, setup_logger, tests::SHA512_COMPRESS_ELF, u64_to_le_u32s}
134+
runtime::{Instruction, Opcode, Program, SyscallCode},
135+
stark::DefaultProver,
136+
utils::{run_test, setup_logger, tests::SHA512_COMPRESS_ELF, u64_to_le_u32s},
135137
};
136138

137139
use super::SHA512_COMPRESS_K;

core/src/syscall/precompiles/sha512/extend/mod.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,13 @@ pub mod extend_tests {
4646

4747
use super::Sha512ExtendChip;
4848
use crate::{
49-
air::MachineAir, runtime::{ExecutionRecord, Instruction, Opcode, Program, SyscallCode}, stark::DefaultProver, utils::{
49+
air::MachineAir,
50+
runtime::{ExecutionRecord, Instruction, Opcode, Program, SyscallCode},
51+
stark::DefaultProver,
52+
utils::{
5053
self, run_test,
5154
tests::{SHA512_ELF, SHA512_EXTEND_ELF},
52-
}
55+
},
5356
};
5457

5558
pub fn sha512_extend_program() -> Program {

0 commit comments

Comments
 (0)