Skip to content
Merged
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.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "nightly-2025-10-20"
channel = "nightly-2026-03-04"
components = ["rustfmt", "rust-analyzer", "clippy"]
1 change: 0 additions & 1 deletion skyscraper/bn254-multiplier/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#![feature(portable_simd)]
#![feature(bigint_helper_methods)]
//#![no_std] This crate can technically be no_std. However this requires
// replacing StdFloat.mul_add with intrinsics.

Expand Down
5 changes: 1 addition & 4 deletions skyscraper/bn254-multiplier/src/rne/batched.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,7 @@ pub fn simd_sqr(v0_a: [u64; 4], v1_a: [u64; 4]) -> ([u64; 4], [u64; 4]) {
/// limbs except the last one is 51 bits. The most significant limb can be
/// larger than 51 bits as the input can be bigger 2^255-1.
#[inline(always)]
fn redundant_carry<const N: usize, const L: usize>(t: [Simd<i64, L>; N]) -> [Simd<u64, L>; N]
where
std::simd::LaneCount<L>: std::simd::SupportedLaneCount,
{
fn redundant_carry<const N: usize, const L: usize>(t: [Simd<i64, L>; N]) -> [Simd<u64, L>; N] {
let mut borrow = Simd::splat(0);
let mut res = [Simd::splat(0); N];
for i in 0..t.len() - 1 {
Expand Down
22 changes: 5 additions & 17 deletions skyscraper/bn254-multiplier/src/rne/simd_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use {
},
std::{
array,
simd::{cmp::SimdPartialEq, LaneCount, SupportedLaneCount},
simd::{cmp::SimdPartialEq, Select},
},
};
#[inline(always)]
Expand All @@ -24,10 +24,7 @@ use {
///
/// Warning: due to Rust's limitations this can not be a const function.
/// Therefore check your dependency path as this will not be optimised out.
pub fn i2f<const N: usize>(a: Simd<u64, N>) -> Simd<f64, N>
where
LaneCount<N>: SupportedLaneCount,
{
pub fn i2f<const N: usize>(a: Simd<u64, N>) -> Simd<f64, N> {
// This function has no target gating as we want to verify this function with
// kani and proptest on a different platform than wasm

Expand Down Expand Up @@ -95,10 +92,7 @@ pub fn transpose_simd_to_u256(limbs: [Simd<u64, 2>; 4]) -> [[u64; 4]; 2] {
/// Convert 4×64-bit to 5×51-bit limb representation.
/// Input must fit in 255 bits; no runtime checking.
#[inline(always)]
pub fn u256_to_u255_simd<const N: usize>(limbs: [Simd<u64, N>; 4]) -> [Simd<u64, N>; 5]
where
LaneCount<N>: SupportedLaneCount,
{
pub fn u256_to_u255_simd<const N: usize>(limbs: [Simd<u64, N>; 4]) -> [Simd<u64, N>; 5] {
for lane in 0..N {
debug_assert!(limbs[3][lane] & (1 << 63) == 0);
}
Expand All @@ -115,10 +109,7 @@ where

/// Convert 5×51-bit back to 4×64-bit limb representation.
#[inline(always)]
pub fn u255_to_u256_simd<const N: usize>(limbs: [Simd<u64, N>; 5]) -> [Simd<u64, N>; 4]
where
LaneCount<N>: SupportedLaneCount,
{
pub fn u255_to_u256_simd<const N: usize>(limbs: [Simd<u64, N>; 5]) -> [Simd<u64, N>; 4] {
let [l0, l1, l2, l3, l4] = limbs;
[
l0 | (l1 << 51),
Expand All @@ -130,10 +121,7 @@ where

/// Convert 5×51-bit to 4×64-bit with simultaneous division by 2.
#[inline(always)]
pub fn u255_to_u256_shr_1_simd<const N: usize>(limbs: [Simd<u64, N>; 5]) -> [Simd<u64, N>; 4]
where
LaneCount<N>: SupportedLaneCount,
{
pub fn u255_to_u256_shr_1_simd<const N: usize>(limbs: [Simd<u64, N>; 5]) -> [Simd<u64, N>; 4] {
let [l0, l1, l2, l3, l4] = limbs;
[
(l0 >> 1) | (l1 << 50),
Expand Down
2 changes: 1 addition & 1 deletion skyscraper/bn254-multiplier/src/rtz/simd_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use {
Simd,
},
},
std::simd::StdFloat,
std::simd::{Select, StdFloat},
};

// -- [SIMD UTILS]
Expand Down
3 changes: 1 addition & 2 deletions skyscraper/core/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#![feature(portable_simd)]
#![feature(bigint_helper_methods)]
#![feature(cold_path)]
#![feature(const_unsigned_bigint_helpers)]

pub mod arithmetic;
pub mod bar;
Expand Down
Loading