diff --git a/src/derive/field/common.rs b/src/derive/field/common.rs index cb78598e..f9dcbcc9 100644 --- a/src/derive/field/common.rs +++ b/src/derive/field/common.rs @@ -20,7 +20,16 @@ macro_rules! field_bits { let limbs = (0..Self::NUM_LIMBS * 8 / STEP) .map(|off| { - u64::from_le_bytes(bytes[off * STEP..(off + 1) * STEP].try_into().unwrap()) + #[cfg(target_pointer_width = "64")] + let limb = u64::from_le_bytes( + bytes[off * STEP..(off + 1) * STEP].try_into().unwrap(), + ); + #[cfg(not(target_pointer_width = "64"))] + let limb = u32::from_le_bytes( + bytes[off * STEP..(off + 1) * STEP].try_into().unwrap(), + ); + + limb }) .collect::>();