Conversation
* Added .circleci/config.yml
Implements the issuer keys as
IssuerAuthorizingKey -> isk
IssuerVerifyingKey -> ik
Test vectors generated with zcash_test_vectors repo
* Added NoteType to Notes * Added NoteType to value commitment derivation
* Circleci project setup (#1) * Added .circleci/config.yml * Added NoteType to Notes * reformated file * updated `derive` for NoteType * added note_type to value commit derivation * rustfmt * updated ci config * updated ci config * updated ci config * updated derive for note_type * added test for arb note_type * added test for `native` note type * zsa-note-encryption: introduce AssetType and encode and decode it in note plaintexts * zsa-note-encryption: extend the size of compact notes to include asset_type * fixed clippy warrnings * rustfmt * zsa-note-encryption: document parsing requirement * zsa-note-encryption: revert support of ZSA compact action * zsa_value: add NoteType method is_native * zsa-note-encryption: remove dependency on changes in the other crate * zsa-note-encryption: extract memo of ZSA notes * zsa-note-encryption: tests (zcash_test_vectors 77c73492) * zsa-note-encryption: simplify roundtrip test * zsa-note-encryption: more test vectors (zcash_test_vectors c10da464) * Circleci project setup (#1) * Added .circleci/config.yml * issuer keys implementation (#5) Implements the issuer keys as IssuerAuthorizingKey -> isk IssuerVerifyingKey -> ik Test vectors generated with zcash_test_vectors repo * Added NoteType to Notes (#2) * Added NoteType to Notes * Added NoteType to value commitment derivation * zsa-note-encryption: use both native and ZSA in proptests * zsa-note-encryption: test vector commit 51398c93 * zsa-note-encryption: fix after merge Co-authored-by: Paul <3682187+PaulLaux@users.noreply.github.com> Co-authored-by: Paul <lauxpaul@protonmail.com> Co-authored-by: Aurélien Nicolas <info@nau.re> Co-authored-by: Daniel Benarroch <danielbenarroch92@gmail.com>
+ Updated test bsk_consistent_with_bvk to verify mixed note types. + Added NoteType support to the builder and the bundle. + added split_flag to SpentInfo and as input to the Circuit (currently commented out) + added conditional cv_sum calculation (currently commented out) + added padding to actions
- added IssueBundle and IssueAction - added a builder for IssueBundle - added verify_issue_bundle() for consensus verification. - unit tests.
added tests in `tests/zsa.rs`
* disabled split notes and proof check for zsa transfer
* fixes and suggestions * changed "issuer" to "issuance" as per zcash#356 (comment) * terminology fixes * updated naming
* rename 2 note_type -> asset as per zcash#356 (comment) * added a dedicated type for "IssuanceAuth" * disabled codecov github action due to bad behavior. * extracted "is_asset_desc_of_valid_size()" into asset_id.rs
* improved `verify_issue_bundle()`
…l require modification.
vivek-arte
left a comment
There was a problem hiding this comment.
Looks generally alright, made a few comments. I would prefer to pass through src/note_encryption_v3.rs once more with a diff from the original note_encryption.rs because it is currently difficult to see the changes specific to V3. Will update once I do that.
src/issuance.rs
Outdated
| pub fn arb_issue_action()( | ||
| note in arb_zsa_note(), | ||
| note in arb_note(NoteValue::from_raw(10)), | ||
| asset_descr in string_regex(".{1,512}").unwrap() |
There was a problem hiding this comment.
This is from a previous merge, but is it not that asset_descr needs to "match" the AssetId value?
| } | ||
|
|
||
| fn enc_ciphertext_compact(&self) -> CompactNoteCiphertextBytes { | ||
| self.enc_ciphertext.clone() |
There was a problem hiding this comment.
yes, since we return a value not a ref.
- Updated to support encryption_v3 as given in QED-it/orchard#38 and QED-it/librustzcash#18. - This PR breaks compatibility with OrchardDomainV2
| let encrypted_note = TransmittedNoteCiphertext { | ||
| epk_bytes: [0u8; 32], | ||
| enc_ciphertext: [0u8; 580], | ||
| enc_ciphertext: [0u8; 612], |
There was a problem hiding this comment.
Hardcoded constants make me sad, but that's consistent with current style so probably this is more of a general comment rather than a suggestion
| .expect("The spend info is valid"); | ||
| split_spend.split_flag = true; | ||
| split_spend | ||
| SpendInfo::new(self.fvk.clone(), self.note, self.merkle_path.clone(), true).unwrap() |
There was a problem hiding this comment.
Do we prefer unwrap over expect with comment?
There was a problem hiding this comment.
only when the expect() comment is trivial.
src/bundle/commitments.rs
Outdated
| ch.update(&action.cmx().to_bytes()); | ||
| ch.update(&action.encrypted_note().epk_bytes); | ||
| ch.update(&action.encrypted_note().enc_ciphertext[..52]); | ||
| ch.update(&action.encrypted_note().enc_ciphertext[..84]); // TODO: make sure it is backward compatible with [..52] |
There was a problem hiding this comment.
I don't think it is if I understand correctly. Shall we maybe select proper hasher here based on value of EncCipherText enum? This way we can hash both V2 and V3
There was a problem hiding this comment.
yes, for sure. Our final aim should be to replace all hardcoded numbers with the relevant constants. But right now, I'm focusing on creating a simple delta to highlight the changes.
Added support for note_encryption_V3 and encryption generalization (QED-it/librustzcash#18)
not for review:
note_encryption.rs,note_encryptionv2v3.rsandsrc/test_vectors/note_encryption.rs. These files represent two possible approaches for backward compatibility and will be finalized down the road. (the files were excluded from the build).