pub struct TracerMemo {
    pub enc_key: AssetTracerEncKeys,
    pub lock_amount: Option<(RecordDataCiphertext, RecordDataCiphertext)>,
    pub lock_asset_type: Option<RecordDataCiphertext>,
    pub lock_attributes: Vec<AttributeCiphertext>,
    pub lock_info: NoahHybridCiphertext,
}
Expand description

Information directed to an asset tracer.

Fields§

§enc_key: AssetTracerEncKeys

The asset tracer encryption keys, used to identify the tracer.

§lock_amount: Option<(RecordDataCiphertext, RecordDataCiphertext)>

The ciphertexts of the amounts, each amount has one for higher 32 bits, and one for the lower 32 bits.

§lock_asset_type: Option<RecordDataCiphertext>

The ciphertexts of the asset types.

§lock_attributes: Vec<AttributeCiphertext>

The ciphertexts of the attributes.

§lock_info: NoahHybridCiphertext

A hybrid encryption of amount, asset type, and attributes encrypted above for faster access.

Implementations§

Sample a new TracerMemo. amount_info is (amount_low, amount_high, amount_blind_low, amount_blind_high) tuple asset_type_info is (asset_type, asset_type_blind) tuple

Decrypts the asset tracer memo: Returns NoahError:BogusAssetTracerMemo in case decrypted values are inconsistents

Check if the amount encrypted in self.lock_amount is expected. If self.lock_amount is None, return Err(NoahError::ParameterError), Otherwise, if decrypted amount is not expected amount, return Err(NoahError::AssetTracingExtractionError), else Ok(()).

Check if the asset type encrypted in self.lock_asset_type is expected. return Err if lock_asset_type is None or the decrypted is not as expected, else returns Ok.

Decrypt asset_type in self.lock_asset_type via a linear scan over candidate_asset_types. If self.lock_asset_type is None, return Err(NoahError::ParameterError), Otherwise, if decrypted asset_type is not in the candidate list return Err(NoahError::AssetTracingExtractionError), else return the decrypted asset_type.

Check is the attributes encrypted in self.lock_attrs are the same as in expected_attributes, If self.lock_attrs is None or if attribute length doesn’t match expected list, return Err(NoahError::ParameterError), Otherwise, it returns a boolean vector indicating true for every positive match and false otherwise.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Deserialize this value from the given Serde deserializer. Read more
This method tests for self and other values to be equal, and is used by ==.
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Checks if this value is equivalent to the given key. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.