feat: add a Risc0 backend

Defaults to software keccak on unoptimized rounds
This commit is contained in:
agureev 2026-06-19 20:07:51 +04:00
parent c4b35a1346
commit ff608af82a

View File

@ -0,0 +1,23 @@
use crate::consts::F1600_ROUNDS;
use crate::types::{Fn1600, State1600};
#[cfg(feature = "parallel")]
use hybrid_array::typenum::U1;
pub(crate) struct Backend;
impl super::Backend for Backend {
#[cfg(feature = "parallel")]
type ParSize1600 = U1;
#[inline]
fn get_p1600<const ROUNDS: usize>() -> Fn1600 {
if ROUNDS == F1600_ROUNDS {
return risc0_p1600;
}
super::soft::keccak_p::<u64, ROUNDS>
}
}
fn risc0_p1600(state: &mut State1600) {
risc0_zkvm::guest::env::risc0_keccak_update(state);
}