mirror of https://github.com/zcash/mpc.git
Add additional alignment assertions.
This commit is contained in:
parent
2102573efd
commit
a487c8a2d8
|
@ -52,8 +52,14 @@ lazy_static! {
|
|||
|
||||
/// This must be called before anything in this module is used.
|
||||
pub fn initialize() {
|
||||
use std::mem::align_of;
|
||||
let mut l = INIT_LOCK.lock().unwrap();
|
||||
|
||||
assert_eq!(align_of::<Fr>(), align_of::<libc::uint64_t>());
|
||||
assert_eq!(align_of::<G1>(), align_of::<libc::uint64_t>());
|
||||
assert_eq!(align_of::<G2>(), align_of::<libc::uint64_t>());
|
||||
assert_eq!(align_of::<Gt>(), align_of::<libc::uint64_t>());
|
||||
|
||||
if !*l {
|
||||
unsafe { libsnarkwrap_init(); }
|
||||
*l = true;
|
||||
|
|
Loading…
Reference in New Issue