mirror of
https://github.com/saymrwulf/risc0-curve25519-dalek-source.git
synced 2026-09-06 20:20:39 +00:00
Use box syntax instead of an unsafe block
This commit is contained in:
parent
640f40287f
commit
a4ed8e2b81
2 changed files with 2 additions and 7 deletions
|
|
@ -834,13 +834,7 @@ impl BasepointTable {
|
||||||
pub fn create(basepoint: &ExtendedPoint) -> Box<BasepointTable> {
|
pub fn create(basepoint: &ExtendedPoint) -> Box<BasepointTable> {
|
||||||
// Create the table storage
|
// Create the table storage
|
||||||
// XXX this is a dirty hack, does placement new work here?
|
// XXX this is a dirty hack, does placement new work here?
|
||||||
let mut table: Box<[[AffineNielsPoint; 8]; 32]> = unsafe {
|
let mut table = box [[AffineNielsPoint::identity(); 8]; 32];
|
||||||
Box::from_raw(
|
|
||||||
Box::into_raw( // 8 * 32 = 256
|
|
||||||
vec![AffineNielsPoint::identity(); 256].into_boxed_slice()
|
|
||||||
) as *mut [[AffineNielsPoint; 8]; 32]
|
|
||||||
)
|
|
||||||
};
|
|
||||||
let mut P = basepoint.clone();
|
let mut P = basepoint.clone();
|
||||||
for i in 0..32 {
|
for i in 0..32 {
|
||||||
// P = (16^2)^i * B
|
// P = (16^2)^i * B
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@
|
||||||
#![cfg_attr(not(feature = "std"), feature(collections))]
|
#![cfg_attr(not(feature = "std"), feature(collections))]
|
||||||
#![allow(unused_features)]
|
#![allow(unused_features)]
|
||||||
#![feature(test)]
|
#![feature(test)]
|
||||||
|
#![feature(box_syntax)]
|
||||||
#![deny(missing_docs)] // refuse to compile if documentation is missing
|
#![deny(missing_docs)] // refuse to compile if documentation is missing
|
||||||
|
|
||||||
//! # curve25519-dalek
|
//! # curve25519-dalek
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue