diff --git a/crates/precompile/src/secp256r1.rs b/crates/precompile/src/secp256r1.rs index e6cb505..f5b21e4 100644 --- a/crates/precompile/src/secp256r1.rs +++ b/crates/precompile/src/secp256r1.rs @@ -110,9 +110,9 @@ fn p256_verify(input: &Bytes, gas_limit: u64) -> PrecompileResult { if P256VERIFY_BASE > gas_limit { return Err(PrecompileErrors::Error(PrecompileError::OutOfGas)); } - let mut result = B256::default(); - result.0[31] = (verify_impl(input).is_some()) as u8; - Ok(PrecompileOutput::new(P256VERIFY_BASE, result.into())) + let result = verify_impl(input).is_some(); + let out = PrecompileOutput::new(P256VERIFY_BASE, B256::with_last_byte(result as u8).into()); + Ok(out) } /// Returns `Some(())` if the signature included in the input byte slice is