Merge pull request #332 from ebfull/faster-scanning

Use wNAF multiplication for Sapling key agreement.
This commit is contained in:
str4d 2021-01-23 12:25:17 +13:00 committed by GitHub
commit 1a3b5c1750
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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.