Skip to content

Commit

Permalink
promote illegal opcode to a panic
Browse files Browse the repository at this point in the history
if the engine25519 hits an illegal opcode, really, that's a
software bug that should be fixed. panic, so that we get
a guru meditation and a bug report.
  • Loading branch information
bunnie committed Mar 28, 2024
1 parent 4170979 commit cdd1539
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions curve25519-dalek/src/backend/serial/u32e/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ pub fn was_engine_error(job_len: usize) -> bool {

let reason = engine.r(utra::engine::EV_PENDING);
if reason & engine.ms(utra::engine::EV_PENDING_ILLEGAL_OPCODE, 1) != 0 {
log::warn!("Illegal opcode encountered in engine25519");
return true;
panic!("Illegal opcode encountered in engine25519");
}
// if the job length isn't what we had set it to, conclude that the
// microcode engine went through a suspend/resume cycle
Expand Down

0 comments on commit cdd1539

Please sign in to comment.