diff --git a/src/curve.rs b/src/curve.rs index 804d180..96e0b16 100644 --- a/src/curve.rs +++ b/src/curve.rs @@ -834,13 +834,7 @@ impl BasepointTable { pub fn create(basepoint: &ExtendedPoint) -> Box { // Create the table storage // XXX this is a dirty hack, does placement new work here? - let mut table: Box<[[AffineNielsPoint; 8]; 32]> = unsafe { - Box::from_raw( - Box::into_raw( // 8 * 32 = 256 - vec![AffineNielsPoint::identity(); 256].into_boxed_slice() - ) as *mut [[AffineNielsPoint; 8]; 32] - ) - }; + let mut table = box [[AffineNielsPoint::identity(); 8]; 32]; let mut P = basepoint.clone(); for i in 0..32 { // P = (16^2)^i * B diff --git a/src/lib.rs b/src/lib.rs index 947a531..bcacba1 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -13,6 +13,7 @@ #![cfg_attr(not(feature = "std"), feature(collections))] #![allow(unused_features)] #![feature(test)] +#![feature(box_syntax)] #![deny(missing_docs)] // refuse to compile if documentation is missing //! # curve25519-dalek