diff --git a/evm/src/cpu/kernel/opcodes.rs b/evm/src/cpu/kernel/opcodes.rs index 2325c53a..c5133050 100644 --- a/evm/src/cpu/kernel/opcodes.rs +++ b/evm/src/cpu/kernel/opcodes.rs @@ -2,7 +2,7 @@ pub(crate) fn get_push_opcode(n: u8) -> u8 { assert!(n > 0); assert!(n <= 32); - 0x60 + (n as u8 - 1) + 0x60 + n - 1 } /// The opcode of a standard instruction (not a `PUSH`). diff --git a/evm/src/cpu/kernel/tests/ripemd.rs b/evm/src/cpu/kernel/tests/ripemd.rs index 6123c336..305548ec 100644 --- a/evm/src/cpu/kernel/tests/ripemd.rs +++ b/evm/src/cpu/kernel/tests/ripemd.rs @@ -46,7 +46,7 @@ fn test_ripemd_reference() -> Result<()> { let kernel = combined_kernel(); let initial_offset = kernel.global_labels["ripemd_stack"]; - let initial_stack: Vec = input.iter().map(|&x| U256::from(x as u32)).rev().collect(); + let initial_stack: Vec = input.iter().map(|&x| U256::from(x)).rev().collect(); let final_stack: Vec = run_with_kernel(&kernel, initial_offset, initial_stack)? .stack() .to_vec(); diff --git a/field/src/types.rs b/field/src/types.rs index b112fde2..545f90c5 100644 --- a/field/src/types.rs +++ b/field/src/types.rs @@ -455,7 +455,7 @@ pub trait PrimeField: Field { let mut x = w * *self; let mut b = x * w; - let mut v = Self::TWO_ADICITY as usize; + let mut v = Self::TWO_ADICITY; while !b.is_one() { let mut k = 0usize; diff --git a/plonky2/src/gadgets/arithmetic_extension.rs b/plonky2/src/gadgets/arithmetic_extension.rs index 23caeac1..23c401b8 100644 --- a/plonky2/src/gadgets/arithmetic_extension.rs +++ b/plonky2/src/gadgets/arithmetic_extension.rs @@ -443,7 +443,7 @@ impl, const D: usize> CircuitBuilder { let mut current = base; let mut product = self.one_extension(); - for j in 0..bits_u64(exponent as u64) { + for j in 0..bits_u64(exponent) { if j != 0 { current = self.square_extension(current); }