INNER CODE UNIT · Rust
wrap_loop
GuildOfWeavers/distaff · src/processor/decoder/mod.rs:206
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();
assert!(self.sponge[0] == self.peek_loop_image(),
"cannot wrap a loop at step {}: hash of the last iteration doesn't match loop image", self.step);
self.set_op_bits(FlowOps::Wrap, UserOps::Noop);
self.set_sponge([0, 0, 0, 0]);
}
/// Prepares the decoder for exiting a loop.
pub fn break_loop(&mut self) {
assert!(self.step % BASE_CYCLE_LENGTH == BASE_CYCLE_LENGTH - 1,
"cannot break a loop at step {}: operation alignment is not valid", self.step);
self.advance_step(false);