Change signature verification equation to permit batch verification.

This commit is contained in:
Sean Bowe 2018-07-27 10:37:26 -06:00
parent 3e43cae526
commit cae9715a8e
No known key found for this signature in database
GPG Key ID: 95684257D8F8B031
1 changed files with 5 additions and 2 deletions

View File

@ -145,8 +145,11 @@ impl<E: JubjubEngine> PublicKey<E> {
Ok(s) => s,
Err(_) => return false,
};
// S . P_G = R + c . vk
self.0.mul(c, params).add(&r, params) == params.generator(p_g).mul(s, params).into()
// 0 = 8(-S . P_G + R + c . vk)
self.0.mul(c, params).add(&r, params).add(
&params.generator(p_g).mul(s, params).negate().into(),
params
).mul_by_cofactor(params).eq(&Point::zero())
}
}