From cdd1539ba8606a2023b9f1cb8cfed4c80cfee3af Mon Sep 17 00:00:00 2001 From: bunnie Date: Thu, 28 Mar 2024 10:21:27 +0800 Subject: [PATCH] promote illegal opcode to a panic 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. --- curve25519-dalek/src/backend/serial/u32e/mod.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/curve25519-dalek/src/backend/serial/u32e/mod.rs b/curve25519-dalek/src/backend/serial/u32e/mod.rs index f29cdaf..8e87b57 100644 --- a/curve25519-dalek/src/backend/serial/u32e/mod.rs +++ b/curve25519-dalek/src/backend/serial/u32e/mod.rs @@ -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