diff --git a/core/src/runtime/mod.rs b/core/src/runtime/mod.rs index 2b0b24418..26a0ae21d 100644 --- a/core/src/runtime/mod.rs +++ b/core/src/runtime/mod.rs @@ -895,6 +895,12 @@ impl<'a> Runtime<'a> { SyscallCode::SHA_COMPRESS => { (self.opts.split_opts.sha_compress_split_threshold, 80) } + SyscallCode::SHA512_EXTEND => { + (self.opts.split_opts.sha512_extend_split_threshold, 48) + } + SyscallCode::SHA512_COMPRESS => { + (self.opts.split_opts.sha512_compress_split_threshold, 80) + } _ => (self.opts.split_opts.deferred_shift_threshold, 1), }; let nonce = (((*syscall_count as usize) % threshold) * multiplier) as u32; diff --git a/core/src/runtime/record.rs b/core/src/runtime/record.rs index 9c2df4cf0..39184e37e 100644 --- a/core/src/runtime/record.rs +++ b/core/src/runtime/record.rs @@ -351,6 +351,8 @@ pub struct SplitOpts { pub keccak_split_threshold: usize, pub sha_extend_split_threshold: usize, pub sha_compress_split_threshold: usize, + pub sha512_extend_split_threshold: usize, + pub sha512_compress_split_threshold: usize, pub memory_split_threshold: usize, } @@ -361,6 +363,8 @@ impl SplitOpts { keccak_split_threshold: deferred_shift_threshold / 24, sha_extend_split_threshold: deferred_shift_threshold / 48, sha_compress_split_threshold: deferred_shift_threshold / 80, + sha512_extend_split_threshold: deferred_shift_threshold / 48, + sha512_compress_split_threshold: deferred_shift_threshold / 80, memory_split_threshold: deferred_shift_threshold, } } @@ -657,10 +661,13 @@ impl ExecutionRecord { secp256k1_double_events: take(&mut self.secp256k1_double_events), bn254_add_events: take(&mut self.bn254_add_events), bn254_double_events: take(&mut self.bn254_double_events), + blake2s_round_events: take(&mut self.blake2s_round_events), bls12381_g1_add_events: take(&mut self.bls12381_g1_add_events), bls12381_g1_double_events: take(&mut self.bls12381_g1_double_events), sha_extend_events: take(&mut self.sha_extend_events), sha_compress_events: take(&mut self.sha_compress_events), + sha512_extend_events: take(&mut self.sha512_extend_events), + sha512_compress_events: take(&mut self.sha512_compress_events), ed_add_events: take(&mut self.ed_add_events), ed_decompress_events: take(&mut self.ed_decompress_events), secp256k1_decompress_events: take(&mut self.secp256k1_decompress_events), @@ -740,6 +747,13 @@ impl ExecutionRecord { opts.deferred_shift_threshold, last ); + split_events!( + self, + blake2s_round_events, + shards, + opts.deferred_shift_threshold, + last + ); split_events!( self, bls12381_g1_add_events, @@ -768,6 +782,20 @@ impl ExecutionRecord { opts.sha_compress_split_threshold, last ); + split_events!( + self, + sha512_extend_events, + shards, + opts.sha512_extend_split_threshold, + last + ); + split_events!( + self, + sha512_compress_events, + shards, + opts.sha512_compress_split_threshold, + last + ); split_events!( self, ed_add_events, diff --git a/core/src/stark/air.rs b/core/src/stark/air.rs index 5c79878ac..c837e72e0 100644 --- a/core/src/stark/air.rs +++ b/core/src/stark/air.rs @@ -140,6 +140,10 @@ impl RiscvAir { chips.push(RiscvAir::Sha256Extend(sha_extend)); let sha_compress = ShaCompressChip; chips.push(RiscvAir::Sha256Compress(sha_compress)); + let sha512_extend = Sha512ExtendChip; + chips.push(RiscvAir::Sha512Extend(sha512_extend)); + let sha512_compress = Sha512CompressChip; + chips.push(RiscvAir::Sha512Compress(sha512_compress)); let ed_add_assign = EdAddAssignChip::>::new(); chips.push(RiscvAir::Ed25519Add(ed_add_assign)); let ed_decompress = EdDecompressChip::::default();