MCPcopy Create free account
hub / github.com/ProvableHQ/sdk / decrypt

Method decrypt

wasm/src/programs/data/ciphertext.rs:54–56  ·  view source on GitHub ↗

Decrypt the ciphertext using the given view key. @param {ViewKey} viewKey The view key of the account that encrypted the ciphertext. @param {Group} nonce The nonce used to encrypt the ciphertext. @returns {Plaintext} The decrypted plaintext.

(&self, view_key: ViewKey, nonce: Group)

Source from the content-addressed store, hash-verified

52 ///
53 /// @returns {Plaintext} The decrypted plaintext.
54 pub fn decrypt(&self, view_key: ViewKey, nonce: Group) -> Result<Plaintext, String> {
55 Ok(Plaintext::from(self.0.decrypt(*view_key, *nonce).map_err(|e| e.to_string())?))
56 }
57
58 /// Decrypt a ciphertext using the view key of the transition signer, transition public key, and
59 /// (program, function, index) tuple.

Callers

nothing calls this directly

Calls 1

to_stringMethod · 0.45

Tested by

no test coverage detected