Crate masp_note_encryption

Source
Expand description

Note encryption for MASP transactions.

This crate implements the in-band secret distribution scheme for the MASP Sapling protocol. It provides reusable methods that implement common note encryption and trial decryption logic, and enforce protocol-agnostic verification requirements.

Protocol-specific logic is handled via the Domain trait. Implementations of this trait are provided in the masp_primitives (for MASP Sapling) crate; users with their own existing types can similarly implement the trait themselves.

Modules§

batchalloc
APIs for batch trial decryption.

Structs§

EphemeralKeyBytes
Newtype representing the byte encoding of an EphemeralPublicKey.
NoteEncryption
A struct containing context required for encrypting Sapling and Orchard notes.
NotePlaintextBytes
Newtype representing the byte encoding of a note plaintext.
OutPlaintextBytes
Newtype representing the byte encoding of a outgoing plaintext.
OutgoingCipherKey
A symmetric key that can be used to recover a single Sapling or Orchard output.

Constants§

ASSET_IDENTIFIER_LENGTH
COMPACT_NOTE_SIZE
The size of a compact note.
ENC_CIPHERTEXT_SIZE
The size of an encrypted note plaintext.
NOTE_PLAINTEXT_SIZE
The size of NotePlaintextBytes.
OUT_CIPHERTEXT_SIZE
The size of an encrypted outgoing plaintext.
OUT_PLAINTEXT_SIZE
The size of OutPlaintextBytes.

Traits§

BatchDomainalloc
Trait that encapsulates protocol-specific batch trial decryption logic.
Domain
Trait that encapsulates protocol-specific note encryption types and logic.
ShieldedOutput
Trait that provides access to the components of an encrypted transaction output.

Functions§

try_compact_note_decryption
Trial decryption of the compact note plaintext by the recipient for light clients.
try_note_decryption
Trial decryption of the full note plaintext by the recipient.
try_output_recovery_with_ock
Recovery of the full note plaintext by the sender.
try_output_recovery_with_ovk
Recovery of the full note plaintext by the sender.