From e929e092169dba0dfda26a957a38c61fa3e33eb2 Mon Sep 17 00:00:00 2001 From: Steven Fackler Date: Mon, 14 Nov 2016 19:44:20 +0100 Subject: Add EcPoint::invert --- openssl/src/ec_key.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'openssl/src') diff --git a/openssl/src/ec_key.rs b/openssl/src/ec_key.rs index 215a89b5..3b40496a 100644 --- a/openssl/src/ec_key.rs +++ b/openssl/src/ec_key.rs @@ -147,6 +147,13 @@ impl EcPointRef { } } + /// Inverts `self`. + pub fn invert(&mut self, group: &EcGroupRef, ctx: &BigNumContextRef) -> Result<(), ErrorStack> { + unsafe { + cvt(ffi::EC_POINT_invert(group.as_ptr(), self.as_ptr(), ctx.as_ptr())).map(|_| ()) + } + } + /// Serializes the point to a binary representation. pub fn to_bytes(&self, group: &EcGroupRef, -- cgit v1.2.3