diff options
| author | Steven Fackler <[email protected]> | 2016-11-15 21:20:06 +0100 |
|---|---|---|
| committer | Steven Fackler <[email protected]> | 2016-11-15 21:20:06 +0100 |
| commit | b914f779e83647df0cfeb9444de0a2eed18a1eb5 (patch) | |
| tree | 94b8a7c4d13de8956b04cb795c4cc21b5124e3c8 | |
| parent | Merge pull request #524 from sfackler/ec (diff) | |
| download | rust-openssl-b914f779e83647df0cfeb9444de0a2eed18a1eb5.tar.xz rust-openssl-b914f779e83647df0cfeb9444de0a2eed18a1eb5.zip | |
Turns out yet another variant of EC_POINT_mul is allowed!
| -rw-r--r-- | openssl/src/ec.rs | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/openssl/src/ec.rs b/openssl/src/ec.rs index ae712430..a4470b2c 100644 --- a/openssl/src/ec.rs +++ b/openssl/src/ec.rs @@ -144,18 +144,35 @@ impl EcPointRef { } } - /// Computes `generator * n + q * m`, storing the result in `self`. + /// Computes `generator * n`, storing the result ing `self`. pub fn mul_generator(&mut self, group: &EcGroupRef, n: &BigNumRef, - q: &EcPointRef, - m: &BigNumRef, - ctx: &mut BigNumContextRef) + ctx: &BigNumContextRef) -> Result<(), ErrorStack> { unsafe { cvt(ffi::EC_POINT_mul(group.as_ptr(), self.as_ptr(), n.as_ptr(), + ptr::null(), + ptr::null(), + ctx.as_ptr())) + .map(|_| ()) + } + } + + /// Computes `generator * n + q * m`, storing the result in `self`. + pub fn mul_full(&mut self, + group: &EcGroupRef, + n: &BigNumRef, + q: &EcPointRef, + m: &BigNumRef, + ctx: &mut BigNumContextRef) + -> Result<(), ErrorStack> { + unsafe { + cvt(ffi::EC_POINT_mul(group.as_ptr(), + self.as_ptr(), + n.as_ptr(), q.as_ptr(), m.as_ptr(), ctx.as_ptr())) |