Update comments

Co-authored-by: ying tong <yingtong@z.cash>
This commit is contained in:
str4d 2021-05-21 21:24:08 +01:00 committed by GitHub
parent 9585c67ed2
commit 2bbbc3ec94
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -328,7 +328,7 @@ impl From<&FullViewingKey> for KeyAgreementPrivateKey {
}
impl KeyAgreementPrivateKey {
/// Derives ask from sk. Internal use only, does not enforce all constraints.
/// Derives ivk from fvk. Internal use only, does not enforce all constraints.
fn derive_inner(fvk: &FullViewingKey) -> CtOption<NonZeroPallasBase> {
let ak = extract_p(&pallas::Point::from_bytes(&(&fvk.ak.0).into()).unwrap());
commit_ivk(&ak, &fvk.nk.0, &fvk.rivk.0)

View File

@ -134,6 +134,7 @@ pub(crate) fn diversify_hash(d: &[u8; 11]) -> NonIdentityPallasPoint {
let hasher = pallas::Point::hash_to_curve("z.cash:Orchard-gd");
let pk_d = hasher(d);
// If the identity occurs, we replace it with a different fixed point.
// TODO: Replace the unwrap_or_else with a cached fixed point.
NonIdentityPallasPoint(CtOption::new(pk_d, !pk_d.is_identity()).unwrap_or_else(|| hasher(&[])))
}