diff options
| author | Steven Fackler <[email protected]> | 2016-11-16 13:53:03 +0100 |
|---|---|---|
| committer | Steven Fackler <[email protected]> | 2016-11-16 13:53:03 +0100 |
| commit | e58dda89900dd30c14811b981b43f24352c683bd (patch) | |
| tree | f7cad9fba8e4c71e2a0eff182fcb83eaddf4950a /openssl/src | |
| parent | Test elliptic curve signatures (diff) | |
| download | rust-openssl-e58dda89900dd30c14811b981b43f24352c683bd.tar.xz rust-openssl-e58dda89900dd30c14811b981b43f24352c683bd.zip | |
Remove EcGroup constructors
You also need a generator and possibly other stuff. Let's hold off on
construction until someone has a concrete requirement for them.
Diffstat (limited to 'openssl/src')
| -rw-r--r-- | openssl/src/ec.rs | 37 |
1 files changed, 1 insertions, 36 deletions
diff --git a/openssl/src/ec.rs b/openssl/src/ec.rs index 08272363..fc3240f1 100644 --- a/openssl/src/ec.rs +++ b/openssl/src/ec.rs @@ -29,30 +29,6 @@ impl EcGroup { cvt_p(ffi::EC_GROUP_new_by_curve_name(nid.as_raw())).map(EcGroup) } } - - /// Constructs a curve over a prime field from its components. - pub fn from_components_gfp(p: &BigNumRef, - a: &BigNumRef, - b: &BigNumRef, - ctx: &mut BigNumContextRef) - -> Result<EcGroup, ErrorStack> { - unsafe { - cvt_p(ffi::EC_GROUP_new_curve_GFp(p.as_ptr(), a.as_ptr(), b.as_ptr(), ctx.as_ptr())) - .map(EcGroup) - } - } - - /// Constructs a curve over a binary field from its components. - pub fn from_components_gf2m(p: &BigNumRef, - a: &BigNumRef, - b: &BigNumRef, - ctx: &mut BigNumContextRef) - -> Result<EcGroup, ErrorStack> { - unsafe { - cvt_p(ffi::EC_GROUP_new_curve_GF2m(p.as_ptr(), a.as_ptr(), b.as_ptr(), ctx.as_ptr())) - .map(EcGroup) - } - } } impl EcGroupRef { @@ -331,7 +307,7 @@ impl EcKey { #[cfg(test)] mod test { - use bn::{BigNum, BigNumContext}; + use bn::BigNumContext; use nid; use super::*; @@ -341,17 +317,6 @@ mod test { } #[test] - fn round_trip_prime256v1() { - let group = EcGroup::from_curve_name(nid::X9_62_PRIME256V1).unwrap(); - let mut p = BigNum::new().unwrap(); - let mut a = BigNum::new().unwrap(); - let mut b = BigNum::new().unwrap(); - let mut ctx = BigNumContext::new().unwrap(); - group.components_gfp(&mut p, &mut a, &mut b, &mut ctx).unwrap(); - EcGroup::from_components_gfp(&p, &a, &b, &mut ctx).unwrap(); - } - - #[test] fn generate() { let group = EcGroup::from_curve_name(nid::X9_62_PRIME256V1).unwrap(); let key = EcKey::generate(&group).unwrap(); |