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§
- batch
alloc
- APIs for batch trial decryption.
Structs§
- Ephemeral
KeyBytes - Newtype representing the byte encoding of an
EphemeralPublicKey
. - Note
Encryption - A struct containing context required for encrypting Sapling and Orchard notes.
- Note
Plaintext Bytes - Newtype representing the byte encoding of a note plaintext.
- OutPlaintext
Bytes - Newtype representing the byte encoding of a outgoing plaintext.
- Outgoing
Cipher Key - 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§
- Batch
Domain alloc
- Trait that encapsulates protocol-specific batch trial decryption logic.
- Domain
- Trait that encapsulates protocol-specific note encryption types and logic.
- Shielded
Output - 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.