Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

Use stable Rust toolchain unless asm feature enabled #13

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rust-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nightly-2021-11-17
1.62.0
14 changes: 14 additions & 0 deletions src/bn256/assembly.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
3 changes: 1 addition & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#![feature(asm)]
#![feature(asm_const)]
#![cfg_attr(feature = "asm", feature(asm_const))]

#[macro_use]
mod ec;
Expand Down