diff options
| author | Andy Gauge <[email protected]> | 2017-10-09 12:10:04 -0700 |
|---|---|---|
| committer | Andy Gauge <[email protected]> | 2017-10-09 12:10:04 -0700 |
| commit | 2c7f0e7604e758d2ba7f6f39ab78d8302f484f65 (patch) | |
| tree | b939ebd1ac58177ad4e7a8f25b488f8fe41cd61f /openssl/src/ec.rs | |
| parent | Begun DSA documentation (diff) | |
| parent | Merge pull request #753 from zsck/issue719 (diff) | |
| download | rust-openssl-2c7f0e7604e758d2ba7f6f39ab78d8302f484f65.tar.xz rust-openssl-2c7f0e7604e758d2ba7f6f39ab78d8302f484f65.zip | |
Merge branch 'master' of https://github.com/sfackler/rust-openssl
Diffstat (limited to 'openssl/src/ec.rs')
| -rw-r--r-- | openssl/src/ec.rs | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/openssl/src/ec.rs b/openssl/src/ec.rs index aded95ab..02be6d22 100644 --- a/openssl/src/ec.rs +++ b/openssl/src/ec.rs @@ -262,12 +262,12 @@ impl EcPointRef { ctx: &mut BigNumContextRef, ) -> Result<bool, ErrorStack> { unsafe { - let res = try!(cvt_n(ffi::EC_POINT_cmp( + let res = cvt_n(ffi::EC_POINT_cmp( group.as_ptr(), self.as_ptr(), other.as_ptr(), ctx.as_ptr(), - ))); + ))?; Ok(res == 0) } } @@ -323,15 +323,15 @@ impl EcPoint { buf: &[u8], ctx: &mut BigNumContextRef, ) -> Result<EcPoint, ErrorStack> { - let point = try!(EcPoint::new(group)); + let point = EcPoint::new(group)?; unsafe { - try!(cvt(ffi::EC_POINT_oct2point( + cvt(ffi::EC_POINT_oct2point( group.as_ptr(), point.as_ptr(), buf.as_ptr(), buf.len(), ctx.as_ptr(), - ))); + ))?; } Ok(point) } @@ -429,17 +429,17 @@ impl EcKey { group: &EcGroupRef, public_key: &EcPointRef, ) -> Result<EcKey, ErrorStack> { - let mut builder = try!(EcKeyBuilder::new()); - try!(builder.set_group(group)); - try!(builder.set_public_key(public_key)); + let mut builder = EcKeyBuilder::new()?; + builder.set_group(group)?; + builder.set_public_key(public_key)?; Ok(builder.build()) } /// Generates a new public/private key pair on the specified curve. pub fn generate(group: &EcGroupRef) -> Result<EcKey, ErrorStack> { - let mut builder = try!(EcKeyBuilder::new()); - try!(builder.set_group(group)); - try!(builder.generate_key()); + let mut builder = EcKeyBuilder::new()?; + builder.set_group(group)?; + builder.generate_key()?; Ok(builder.build()) } |