Commit b914f779 authored by Steven Fackler's avatar Steven Fackler
Browse files

Turns out yet another variant of EC_POINT_mul is allowed!

parent 9dca8f06
Loading
Loading
Loading
Loading
+21 −4
Original line number Diff line number Diff line
@@ -144,8 +144,25 @@ 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,
                         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,