diff --git a/rust-toolchain b/rust-toolchain index 2e62589..76d0536 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -nightly-2021-11-17 +1.62.0 diff --git a/src/bn256/assembly.rs b/src/bn256/assembly.rs index 6d56639..ad28f67 100644 --- a/src/bn256/assembly.rs +++ b/src/bn256/assembly.rs @@ -4,6 +4,8 @@ macro_rules! assembly_field { /// Doubles this field element. #[inline] pub fn double(&self) -> $field { + use core::arch::asm; + let mut r0: u64; let mut r1: u64; let mut r2: u64; @@ -59,6 +61,8 @@ macro_rules! assembly_field { /// Squares this element. #[inline] pub fn square(&self) -> $field { + use core::arch::asm; + let mut r0: u64; let mut r1: u64; let mut r2: u64; @@ -347,6 +351,8 @@ macro_rules! assembly_field { #[inline(always)] pub(crate) fn montgomery_reduce(a: &[u64; 8]) -> $field { + use core::arch::asm; + let mut r0: u64; let mut r1: u64; let mut r2: u64; @@ -533,6 +539,8 @@ macro_rules! assembly_field { /// Multiplies `rhs` by `self`, returning the result. #[inline] pub fn mul(&self, rhs: &Self) -> $field { + use core::arch::asm; + let mut r0: u64; let mut r1: u64; let mut r2: u64; @@ -823,6 +831,8 @@ macro_rules! assembly_field { /// Subtracts `rhs` from `self`, returning the result. #[inline] pub fn sub(&self, rhs: &Self) -> $field { + use core::arch::asm; + let mut r0: u64; let mut r1: u64; let mut r2: u64; @@ -879,6 +889,8 @@ macro_rules! assembly_field { /// Adds `rhs` to `self`, returning the result. #[inline] pub fn add(&self, rhs: &Self) -> $field { + use core::arch::asm; + let mut r0: u64; let mut r1: u64; let mut r2: u64; @@ -935,6 +947,8 @@ macro_rules! assembly_field { /// Negates `self`. #[inline] pub fn neg(&self) -> $field { + use core::arch::asm; + let mut r0: u64; let mut r1: u64; let mut r2: u64; diff --git a/src/lib.rs b/src/lib.rs index 61756bb..e9176b4 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,5 +1,4 @@ -#![feature(asm)] -#![feature(asm_const)] +#![cfg_attr(feature = "asm", feature(asm_const))] #[macro_use] mod ec;