1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
#![allow(non_snake_case)] pub mod wrappers; extern crate libc; use std::fmt; use fp2::wrappers::*; use ecp2::wrappers::*; impl ECP2 { pub fn set(P: &mut ECP2, x: &FP2, y: &FP2) { unsafe { ECP2_set(P, x, y); } } } impl fmt::Display for ECP2 { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "ECP2: [ {}, {}, {}, {} ]", self.inf, self.x, self.y, self.z) } } impl fmt::Debug for ECP2 { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "ECP2: [ {}, {}, {}, {} ]", self.inf, self.x, self.y, self.z) } }