Skip to content

Commit

Permalink
Remove unused constants COMPACT_NOTE_SIZE, NOTE_PLAINTEXT_SIZE, ENC_C…
Browse files Browse the repository at this point in the history
…IPHERTEXT_SIZE, and update CHANGELOG accordingly
  • Loading branch information
dmidem committed Aug 12, 2024
1 parent c66c8a2 commit ded868d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ and this library adheres to Rust's notion of

## [Unreleased]
### Changed
- Breaking change: removed the constants `COMPACT_NOTE_SIZE`,
`NOTE_PLAINTEXT_SIZE`, and `ENC_CIPHERTEXT_SIZE` as they are no longer used
in the `zcash_note_encryption`, orchard`, or `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`
Expand All @@ -22,8 +25,7 @@ and this library adheres to Rust's notion of
array.
- Updated the `enc_ciphertext` method of the `ShieldedOutput` trait to return an
`Option` of a reference instead of a copy.
- Moved the specific constants into the `Domain` trait implementations, while
keeping the original constants for backward compatibility.
- Moved the specific constants into the `Domain` trait implementations.
- Added new `note_bytes` module with helper trait and struct to deal with note
bytes data with abstracted underlying array size.

Expand Down
9 changes: 0 additions & 9 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,10 @@ pub mod note_bytes;

use note_bytes::NoteBytes;

/// The size of a compact note for Sapling and pre-ZSA Orchard.
pub const COMPACT_NOTE_SIZE: usize = 1 + // version
11 + // diversifier
8 + // value
32; // rseed (or rcm prior to ZIP 212)
/// The size of [`Domain::NotePlaintextBytes`] for Sapling and pre-ZSA Orchard.
pub const NOTE_PLAINTEXT_SIZE: usize = COMPACT_NOTE_SIZE + 512;
/// The size of [`OutPlaintextBytes`].
pub const OUT_PLAINTEXT_SIZE: usize = 32 + // pk_d
32; // esk
const AEAD_TAG_SIZE: usize = 16;
/// The size of an encrypted note plaintext for Sapling and pre-ZSA Orchard.
pub const ENC_CIPHERTEXT_SIZE: usize = NOTE_PLAINTEXT_SIZE + AEAD_TAG_SIZE;
/// The size of an encrypted outgoing plaintext.
pub const OUT_CIPHERTEXT_SIZE: usize = OUT_PLAINTEXT_SIZE + AEAD_TAG_SIZE;

Expand Down

0 comments on commit ded868d

Please sign in to comment.