INNER CODE UNIT · Rust
start_loop
GuildOfWeavers/distaff · src/processor/decoder/mod.rs:194
pub fn start_loop(&mut self, loop_image: u128) {
assert!(self.step % BASE_CYCLE_LENGTH == BASE_CYCLE_LENGTH - 1,
"cannot start a loop at step {}: operation alignment is not valid", self.step);
self.advance_step(false);
self.save_context();
self.save_loop_image(loop_image);
self.set_op_bits(FlowOps::Loop, UserOps::Noop);
self.set_sponge([0, 0, 0, 0]);
}
/// Prepares the decoder for the next iteration of a loop.
pub fn wrap_loop(&mut self) {
assert!(self.step % BASE_CYCLE_LENGTH == BASE_CYCLE_LENGTH - 1,
"cannot wrap a loop at step {}: operation alignment is not valid", self.step);
self.advance_step(false);
self.copy_context_stack();