pub struct OwnerMemo {
pub key_type: KeyType,
pub blind_share_bytes: Vec<u8>,
pub lock_bytes: Vec<u8>,
}Expand description
Information directed to the recipient.
Fields§
§key_type: KeyTypeThe signature used curve type.
The random point used to compute the shared point.
lock_bytes: Vec<u8>The ciphertext of the memo information.
Implementations§
source§impl OwnerMemo
impl OwnerMemo
sourcepub fn from_amount<R: CryptoRng + RngCore>(
prng: &mut R,
amount: u64,
pub_key: &PublicKey
) -> Result<(Self, (RistrettoScalar, RistrettoScalar))>
pub fn from_amount<R: CryptoRng + RngCore>(
prng: &mut R,
amount: u64,
pub_key: &PublicKey
) -> Result<(Self, (RistrettoScalar, RistrettoScalar))>
Construct an OwnerMemo for an asset record with only confidential amount.
sourcepub fn from_asset_type<R: CryptoRng + RngCore>(
prng: &mut R,
asset_type: &AssetType,
pub_key: &PublicKey
) -> Result<(Self, RistrettoScalar)>
pub fn from_asset_type<R: CryptoRng + RngCore>(
prng: &mut R,
asset_type: &AssetType,
pub_key: &PublicKey
) -> Result<(Self, RistrettoScalar)>
Construct an OwnerMemo for an asset record with only confidential asset type.
sourcepub fn from_amount_and_asset_type<R: CryptoRng + RngCore>(
prng: &mut R,
amount: u64,
asset_type: &AssetType,
pub_key: &PublicKey
) -> Result<(Self, (RistrettoScalar, RistrettoScalar), RistrettoScalar)>
pub fn from_amount_and_asset_type<R: CryptoRng + RngCore>(
prng: &mut R,
amount: u64,
asset_type: &AssetType,
pub_key: &PublicKey
) -> Result<(Self, (RistrettoScalar, RistrettoScalar), RistrettoScalar)>
Construct an OwnerMemo for an asset record with both confidential amount and confidential asset type.
sourcepub fn decrypt_amount(&self, keypair: &KeyPair) -> Result<u64>
pub fn decrypt_amount(&self, keypair: &KeyPair) -> Result<u64>
Decrypt the OwnerMemo.lock which encrypts only the confidential amount
returns error if the decrypted bytes length doesn’t match.
sourcepub fn decrypt_asset_type(&self, keypair: &KeyPair) -> Result<AssetType>
pub fn decrypt_asset_type(&self, keypair: &KeyPair) -> Result<AssetType>
Decrypt the OwnerMemo.lock which encrypts only the confidential asset type
returns error if the decrypted bytes length doesn’t match.
sourcepub fn decrypt_amount_and_asset_type(
&self,
keypair: &KeyPair
) -> Result<(u64, AssetType)>
pub fn decrypt_amount_and_asset_type(
&self,
keypair: &KeyPair
) -> Result<(u64, AssetType)>
Decrypt the OwnerMemo.lock which encrypts “amount || asset type”, both amount and asset type
are confidential.
sourcepub fn derive_amount_blinds(
&self,
keypair: &KeyPair
) -> Result<(RistrettoScalar, RistrettoScalar)>
pub fn derive_amount_blinds(
&self,
keypair: &KeyPair
) -> Result<(RistrettoScalar, RistrettoScalar)>
Return the amount blind (blind_low, blind_high)
sourcepub fn derive_asset_type_blind(
&self,
keypair: &KeyPair
) -> Result<RistrettoScalar>
pub fn derive_asset_type_blind(
&self,
keypair: &KeyPair
) -> Result<RistrettoScalar>
Return the asset type blind