zcash_primitives: Replace sapling::redjubjub with redjubjub crate#1056
Conversation
As a side-effect, we remove the ability to verify individual transactions with pre-ZIP 216 rules (which we already removed from `zcashd` consensus nodes in zcash/zcash#6000 and zcash/zcash#6399, as all pre-ZIP 216 transactions on mainnet are also valid under ZIP 216).
3878654 to
de1ed21
Compare
| binding_signature: auth.sigs.bsk.sign( | ||
| &sighash, | ||
| &mut rng, | ||
| VALUE_COMMITMENT_RANDOMNESS_GENERATOR, | ||
| ), | ||
| binding_signature: auth.sigs.bsk.sign(&mut rng, &sighash), |
There was a problem hiding this comment.
There was a bug here previously in that this didn't include key prefixing, because we never implemented that inside our redjubjub module (as the original RedDSA draft spec lacked it). I should have used the equivalent of the sapling::spend_sig method here when I added this in #1023 (not that exact method because it also handled re-randomization), but as we haven't cut a release including this API yet, the bug is not in deployed code. The redjubjub crate includes key prefixing.
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #1056 +/- ##
==========================================
+ Coverage 70.62% 70.79% +0.16%
==========================================
Files 140 138 -2
Lines 13786 13698 -88
==========================================
- Hits 9737 9698 -39
+ Misses 4049 4000 -49 ☔ View full report in Codecov by Sentry. |
4cbeeb9 to
cb72231
Compare
The Sapling key components specification places more constraints on the values of `ask` and `ak` than general RedJubjub signing and verification keys.
cb72231 to
5ccba3e
Compare
|
|
f9b4c53 to
ded09f9
Compare
| #[derive(Clone, Debug)] | ||
| pub struct SpendValidatingKey(redjubjub::VerificationKey<SpendAuth>); | ||
|
|
||
| impl From<&SpendAuthorizingKey> for SpendValidatingKey { |
There was a problem hiding this comment.
Please change this to an explicitly named method.
As a side-effect, we remove the ability to verify individual transactions with pre-ZIP 216 rules (which we already removed from
zcashdconsensus nodes in zcash/zcash#6000 and zcash/zcash#6399, as all pre-ZIP 216 transactions on mainnet and testnet are also valid under ZIP 216).