Specify pre-conditions for signature validation

This commit is contained in:
Jack Grigg 2018-04-18 23:59:48 +01:00
parent 45e4ca38e4
commit 840c23bd23
No known key found for this signature in database
GPG Key ID: 665DBCD284F7DAFF
1 changed files with 4 additions and 0 deletions

View File

@ -71,6 +71,10 @@ impl<E: JubjubEngine> PublicKey<E> {
PublicKey(res) PublicKey(res)
} }
// Pre-conditions:
// - rbar was the canonical representation of a point on the curve.
// - sig.s < order(G)
// TODO(str4d): Enforce these during deserialization of Signature
pub fn verify(&self, msg: &[u8], sig: &Signature<E>, params: &E::Params) -> bool { pub fn verify(&self, msg: &[u8], sig: &Signature<E>, params: &E::Params) -> bool {
// c = H*(Rbar || M) // c = H*(Rbar || M)
let mut rbar = [0u8; 32]; let mut rbar = [0u8; 32];