mirror of https://github.com/zcash/halo2.git
Update comments
Co-authored-by: ying tong <yingtong@z.cash>
This commit is contained in:
parent
9585c67ed2
commit
2bbbc3ec94
|
@ -328,7 +328,7 @@ impl From<&FullViewingKey> for KeyAgreementPrivateKey {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl 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> {
|
fn derive_inner(fvk: &FullViewingKey) -> CtOption<NonZeroPallasBase> {
|
||||||
let ak = extract_p(&pallas::Point::from_bytes(&(&fvk.ak.0).into()).unwrap());
|
let ak = extract_p(&pallas::Point::from_bytes(&(&fvk.ak.0).into()).unwrap());
|
||||||
commit_ivk(&ak, &fvk.nk.0, &fvk.rivk.0)
|
commit_ivk(&ak, &fvk.nk.0, &fvk.rivk.0)
|
||||||
|
|
|
@ -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 hasher = pallas::Point::hash_to_curve("z.cash:Orchard-gd");
|
||||||
let pk_d = hasher(d);
|
let pk_d = hasher(d);
|
||||||
// If the identity occurs, we replace it with a different fixed point.
|
// 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(&[])))
|
NonIdentityPallasPoint(CtOption::new(pk_d, !pk_d.is_identity()).unwrap_or_else(|| hasher(&[])))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue