Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arrabbiata: implement control flow for the new Poseidon gadget #3056

Merged
merged 1 commit into from
Feb 25, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 16 additions & 6 deletions arrabbiata/src/witness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1214,6 +1214,22 @@ where
Instruction::Poseidon(0)
}
}
Instruction::PoseidonPermutation(i) => {
if i < PlonkSpongeConstants::PERM_ROUNDS_FULL - 5 {
Instruction::PoseidonPermutation(i + 5)
} else {
// FIXME: for now, we continue absorbing because the current
// code, while fetching the values to absorb, raises an
// exception when we absorbed everythimg, and the main file
// handles the halt by filling as many rows as expected (see
// [VERIFIER_CIRCUIT_SIZE]).
Instruction::PoseidonSpongeAbsorb
}
}
Instruction::PoseidonSpongeAbsorb => {
// Whenever we absorbed a value, we run the permutation.
Instruction::PoseidonPermutation(0)
}
Instruction::EllipticCurveScaling(i_comm, bit) => {
// TODO: we still need to substract (or not?) the blinder.
// Maybe we can avoid this by aggregating them.
Expand All @@ -1239,12 +1255,6 @@ where
}
}
Instruction::NoOp => Instruction::NoOp,
Instruction::PoseidonSpongeAbsorb => {
todo!()
}
Instruction::PoseidonPermutation(_) => {
todo!()
}
}
}

Expand Down
Loading