Conversation
…to Domain implementation.
…ShieldedOutput trait
…textBytes, wrapping the AEADBytes in a struct
alexeykoren
left a comment
There was a problem hiding this comment.
Looks good to me, although I agree with old Vivec's comments about variables naming
Cargo.toml
Outdated
| schemer-rusqlite = { git = "https://github.com/aschampion/schemer.git", rev = "6726b60f43f72c6e24a18d31be0ec7d42829e5e1" } | ||
| group = { git = "https://github.com/zkcrypto/group.git", rev = "f61e3e420ed1220c8f1f80988f8c6c5e202d8715" } | ||
| orchard = { version = "0.3", git = "https://github.com/QED-it/orchard", rev = "5a50fb8d11361d3f7d1f3b2f6c0a468f88c0db49" } | ||
| orchard = { version = "0.3", git = "https://github.com/QED-it/orchard", rev = "c6e048a4474f0bef5182ed56e5d2ecff6fea0389" } |
There was a problem hiding this comment.
We should bump this up to the commit that is the latest eventually, (currently 49a7775eccdd74ebaaa30aabc42fccf063b25ec1), but this is not functionality-critical.
This also seems like a cycle with the dependency requirement in Orchard though...
There was a problem hiding this comment.
| orchard = { version = "0.3", git = "https://github.com/QED-it/orchard", rev = "c6e048a4474f0bef5182ed56e5d2ecff6fea0389" } | |
| orchard = { version = "0.3", git = "https://github.com/QED-it/orchard", rev = "49a7775eccdd74ebaaa30aabc42fccf063b25ec1" } |
There was a problem hiding this comment.
yes, due to the cycle, it is not possible to provide the correct rev for both repos.
| &[], | ||
| &mut output[..NOTE_PLAINTEXT_SIZE], | ||
| ) | ||
| .encrypt_in_place_detached([0u8; 12][..].into(), &[], output.as_mut()) |
There was a problem hiding this comment.
output already is &mut [u8], so output.as_mut() seems unnecessary.
| .encrypt_in_place_detached([0u8; 12][..].into(), &[], output.as_mut()) | |
| .encrypt_in_place_detached([0u8; 12][..].into(), &[], output) |
| let mut tnc = TransmittedNoteCiphertext { | ||
| epk_bytes: [0u8; 32], | ||
| enc_ciphertext: [0u8; 580], | ||
| enc_ciphertext: [0u8; 612], |
There was a problem hiding this comment.
This is V3 specific at the moment, would need updating along with backward compatibility
- Updated to support encryption_v3 as given in QED-it/orchard#38 and QED-it/librustzcash#18. - This PR breaks compatibility with OrchardDomainV2
Added `OrchardDomainV3` on top of the encryption generalization (QED-it/librustzcash#18). not for review: note_encryption.rs, note_encryptionv2v3.rs and src/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).
In order to support note encryption for zsa, we suggest extending the current
zcash_note_encryptionimplementation. Currently, theCOMPACT_NOTE_SIZEis a constant, however we need to support variable note sizes to include theAssetIdfield for zsa notes.Currently, in
zcash_note_encryption:and
We suggest moving the constants into the specific implementation (
impl Domain for OrchardDomainand Sapling) of theDomaintrait by adding abstract types toNotePlaintextBytes,NoteCiphertextBytes,CompactNotePlaintextBytes,CompactNoteCiphertextBytes.We get
Also, the constant will be removed from functions' signatures since they are unknown during the compilation time. For example:
Will be replaced with simply
We provided our initial implementation to be complemented by the appropriate changes in
Orchard::note_encryption.rsThe changes will allow us to implement an
Orchard::DomainforV3notes while keeping compatibility with the existing Orchard Domain ( forV2notes ) and Sapling.