Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,27 @@ and this library adheres to Rust's notion of
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Changed
- **Breaking change:** removed the constants `COMPACT_NOTE_SIZE`,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be in ### Removed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was going to address all of this in a subsequent PR after getting #2 in, but I guess now that I've been forced to open a separate PR for just that, I can fix the changelog at the same time.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eh, actually I will still do the changelog rework in a separate PR.

`NOTE_PLAINTEXT_SIZE`, and `ENC_CIPHERTEXT_SIZE` as they are now
implementation-specific (located in `orchard` and `sapling-crypto` crates).
- Generalized the note plaintext size to support variable sizes by adding the
abstract types `NotePlaintextBytes`, `NoteCiphertextBytes`,
`CompactNotePlaintextBytes`, and `CompactNoteCiphertextBytes` to the `Domain`
trait.
- Removed the separate `NotePlaintextBytes` type definition (as it is now an
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be in ### Removed.

associated type).
- Added new `parse_note_plaintext_bytes`, `parse_note_ciphertext_bytes`, and
`parse_compact_note_plaintext_bytes` methods to the `Domain` trait.
- Updated the `note_plaintext_bytes` method of the `Domain` trait to return the
`NotePlaintextBytes` associated type.
- Updated the `encrypt_note_plaintext` method of `NoteEncryption` to return the
`NoteCiphertextBytes` associated type of the `Domain` instead of the explicit
array.
- Updated the `enc_ciphertext` method of the `ShieldedOutput` trait to return an
`Option` of a reference instead of a copy.
- Added a new `note_bytes` module with helper trait and struct to deal with note
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be in ### Added.

bytes data with abstracted underlying array size.

## [0.4.1] - 2024-12-06
### Added
Expand Down
8 changes: 4 additions & 4 deletions src/batch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use alloc::vec::Vec; // module is alloc only

use crate::{
try_compact_note_decryption_inner, try_note_decryption_inner, BatchDomain, EphemeralKeyBytes,
ShieldedOutput, COMPACT_NOTE_SIZE, ENC_CIPHERTEXT_SIZE,
ShieldedOutput,
};

/// Trial decryption of a batch of notes with a set of recipients.
Expand All @@ -16,7 +16,7 @@ use crate::{
/// provided, along with the index in the `ivks` slice associated with
/// the IVK that successfully decrypted the output.
#[allow(clippy::type_complexity)]
pub fn try_note_decryption<D: BatchDomain, Output: ShieldedOutput<D, ENC_CIPHERTEXT_SIZE>>(
pub fn try_note_decryption<D: BatchDomain, Output: ShieldedOutput<D>>(
ivks: &[D::IncomingViewingKey],
outputs: &[(D, Output)],
) -> Vec<Option<((D::Note, D::Recipient, D::Memo), usize)>> {
Expand All @@ -32,14 +32,14 @@ pub fn try_note_decryption<D: BatchDomain, Output: ShieldedOutput<D, ENC_CIPHERT
/// provided, along with the index in the `ivks` slice associated with
/// the IVK that successfully decrypted the output.
#[allow(clippy::type_complexity)]
pub fn try_compact_note_decryption<D: BatchDomain, Output: ShieldedOutput<D, COMPACT_NOTE_SIZE>>(
pub fn try_compact_note_decryption<D: BatchDomain, Output: ShieldedOutput<D>>(
ivks: &[D::IncomingViewingKey],
outputs: &[(D, Output)],
) -> Vec<Option<((D::Note, D::Recipient), usize)>> {
batch_note_decryption(ivks, outputs, try_compact_note_decryption_inner)
}

fn batch_note_decryption<D: BatchDomain, Output: ShieldedOutput<D, CS>, F, FR, const CS: usize>(
fn batch_note_decryption<D: BatchDomain, Output: ShieldedOutput<D>, F, FR>(
ivks: &[D::IncomingViewingKey],
outputs: &[(D, Output)],
decrypt_inner: F,
Expand Down
Loading
Loading