diff --git a/tinysnark/src/arith.rs b/tinysnark/src/arith.rs index bf106af..31d7815 100644 --- a/tinysnark/src/arith.rs +++ b/tinysnark/src/arith.rs @@ -12,9 +12,13 @@ extern "C" { fn tinysnark_fieldt_add(a: FieldT, b: FieldT) -> FieldT; } +#[derive(Copy, Clone, Debug)] +#[repr(simd)] +struct EightBytes(u64); + #[derive(Copy, Clone, Debug)] #[repr(C)] -pub struct FieldT([u8; 32]); +pub struct FieldT([u8; 32], [EightBytes; 0]); impl FieldT { #[inline(always)] diff --git a/tinysnark/src/lib.rs b/tinysnark/src/lib.rs index 83084cf..7c90b9f 100644 --- a/tinysnark/src/lib.rs +++ b/tinysnark/src/lib.rs @@ -1,4 +1,4 @@ -#![feature(box_syntax)] +#![feature(box_syntax, repr_simd)] #![allow(improper_ctypes)] //#![cfg_attr(test, feature(test))] extern crate libc;