Use wNAF multiplication for Sapling key agreement.

This commit is contained in:
Sean Bowe 2021-01-22 15:16:06 -07:00
parent 47348afd50
commit 6315f7dc28
No known key found for this signature in database
GPG Key ID: 95684257D8F8B031
1 changed files with 3 additions and 1 deletions

View File

@ -136,7 +136,9 @@ pub fn sapling_ka_agree(esk: &jubjub::Fr, pk_d: &jubjub::ExtendedPoint) -> jubju
// [8 esk] pk_d
// <ExtendedPoint as CofactorGroup>::clear_cofactor is implemented using
// ExtendedPoint::mul_by_cofactor in the jubjub crate.
CofactorGroup::clear_cofactor(&(pk_d * esk))
let mut wnaf = group::Wnaf::new();
wnaf.scalar(esk).base(*pk_d).clear_cofactor()
}
/// Sapling KDF for note encryption.