Turns out yet another variant of EC_POINT_mul is allowed!

This commit is contained in:
Steven Fackler 2016-11-15 21:20:06 +01:00
parent 9dca8f06e7
commit b914f779e8
1 changed files with 21 additions and 4 deletions

View File

@ -144,14 +144,31 @@ 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(),