Update zcash_note_encryption to support variable note plaintext and encrypted note ciphertext sizes (orchard compatible)#14
Closed
vivek-arte wants to merge 12 commits intozsa1from
Closed
Conversation
…to Domain implementation.
…ShieldedOutput trait
PaulLaux
reviewed
Nov 14, 2022
|
|
||
| fn separate_tag_from_ciphertext(enc_ciphertext: &Self::EncNoteCiphertextBytes) -> (Self::NotePlaintextBytes, [u8; AEAD_TAG_SIZE]); | ||
|
|
||
| fn convert_to_compact_plaintext_type(enc_ciphertext: &Self::CompactEncNoteCiphertextBytes) -> Self::CompactNotePlaintextBytes; |
Collaborator
There was a problem hiding this comment.
should be used as From and Into
PaulLaux
reviewed
Nov 14, 2022
| /// `EphemeralSecretKey`. | ||
| fn extract_esk(out_plaintext: &OutPlaintextBytes) -> Option<Self::EphemeralSecretKey>; | ||
|
|
||
| fn separate_tag_from_ciphertext(enc_ciphertext: &Self::EncNoteCiphertextBytes) -> (Self::NotePlaintextBytes, [u8; AEAD_TAG_SIZE]); |
Collaborator
There was a problem hiding this comment.
[u8; AEAD_TAG_SIZE] should have a struct
PaulLaux
reviewed
Nov 14, 2022
| /// Exposes the note ciphertext of the output. | ||
| fn enc_ciphertext(&self) -> &[u8; CIPHERTEXT_SIZE]; | ||
| /// Exposes the note ciphertext of the output. Returns `None` if the output is compact. | ||
| fn enc_ciphertext(&self) -> Option<D::EncNoteCiphertextBytes>; |
Collaborator
There was a problem hiding this comment.
attempt to unify with CompactEncNoteCiphertextBytes.
…textBytes, wrapping the AEADBytes in a struct
Collaborator
|
closed in favor of #18 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This has been done by
NotePlaintextBytesstruct and creating new types forNotePlaintextBytesandCompactNotePlaintextBytesin theDomaintrait. This allows each implementation to set its choice of these data structures.EncNoteCiphertextByesandCompactEncNoteCiphertextBytestypes in theDomaintrait. This replaces the use of byte arrays ([u8]) to represent encrypted note ciphertexts with the use of specific data structures that can be varied per implementation.Note that this is