You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following issue (ZcashFoundation/zebra#6392 on zebra github repo) was raised by the auditors working on the Zebra audit:
Impact
During Sapling and Orchard output validation, one redundant elliptic curve scalar multiplication is performed. It may be considered for removal for efficiency purposes.
Description
In order to verify that Sapling and Orchard outputs are decryptable and consistent with ZIP 212 rules, Zebra uses the zcash_primitives crate’s try_sapling_output_recoveryfunction. This function is called, for example, when coinbase transaction outputs are validated to adhere to the rules specified in ZIP 212.
Once decrypted, an output’s note is parsed. An ephemeral key validation function is passed as a lambda:
// Published commitment doesn't match calculated commitment
NoteValidity::Invalid
}
}
The validation highlighted in the first code snippet happens regardless of whether ZIP 212 is activated or not. This is also what the original Zcash client does; see zcash/Note.cpp.
The validation highlighted in the second code snippet aims to only validate the public key post-ZIP 212 and is likely meant to be a blanket end-of-function validation helper. This helper includes an ECC point multiplication and as such is not inexpensive.
Recommendation
It appears that the highlighted check inside the check_note_validity function overlaps with the previous validation, and, as such, may be removed.
The text was updated successfully, but these errors were encountered:
The following issue (ZcashFoundation/zebra#6392 on zebra github repo) was raised by the auditors working on the Zebra audit:
Impact
During Sapling and Orchard output validation, one redundant elliptic curve scalar multiplication is performed. It may be considered for removal for efficiency purposes.
Description
In order to verify that Sapling and Orchard outputs are decryptable and consistent with ZIP 212 rules, Zebra uses the
zcash_primitives
crate’stry_sapling_output_recovery
function. This function is called, for example, when coinbase transaction outputs are validated to adhere to the rules specified in ZIP 212.Once decrypted, an output’s note is parsed. An ephemeral key validation function is passed as a lambda:
librustzcash/zcash_primitives/src/sapling/note_encryption.rs
Lines 254 to 268 in fb49cd4
The check implemented by the highlighted lambda function is mandated by ZIP 212. A few lines below, the
check_note_validity
function is called:librustzcash/components/zcash_note_encryption/src/lib.rs
Lines 514 to 537 in fb49cd4
The validation highlighted in the first code snippet happens regardless of whether ZIP 212 is activated or not. This is also what the original Zcash client does; see
zcash/Note.cpp
.The validation highlighted in the second code snippet aims to only validate the public key post-ZIP 212 and is likely meant to be a blanket end-of-function validation helper. This helper includes an ECC point multiplication and as such is not inexpensive.
Recommendation
It appears that the highlighted check inside the
check_note_validity
function overlaps with the previous validation, and, as such, may be removed.The text was updated successfully, but these errors were encountered: