@@ -246,7 +246,30 @@ int_cipher_text, signature = build_string_input_text(plaintext, user_aes_key, se
246246
247247- ` input_text ` : A dictionary of the form { "ciphertext": { "value": int[ ] }, "signature": bytes[ ] }
248248
249- ### 9. ` generate_rsa_keypair() `
249+ ### 9. ` build_address_input_text(plaintext, user_aes_key, sender, contract, func_selector, signing_key) `
250+
251+ ** Purpose:** Builds input text by encrypting the plaintext and signing it.
252+
253+ ** Usage:**
254+
255+ ``` python
256+ int_cipher_text, signature = build_address_input_text(plaintext, user_aes_key, sender, contract, func_selector, signing_key)
257+ ```
258+
259+ ** Parameters:**
260+
261+ - ` plaintext ` : The plaintext message.
262+ - ` user_aes_key ` : The user's AES key.
263+ - ` sender ` : The sender's address.
264+ - ` contract ` : The contract address.
265+ - ` func_selector ` : The function selector.
266+ - ` signing_key ` : The private key used for signing.
267+
268+ ** Returns:**
269+
270+ - ` input_text ` : A dictionary of the form { "ciphertext": { "ct1": int, "ct2": int, "ct3": int }, "signature1": bytes, "signature2": bytes, "signature3": bytes }
271+
272+ ### 10. ` generate_rsa_keypair() `
250273
251274** Purpose:** Generates an RSA key pair.
252275
@@ -261,7 +284,7 @@ private_key_bytes, public_key_bytes = generate_rsa_keypair()
261284- ` private_key_bytes ` : The serialized private key.
262285- ` public_key_bytes ` : The serialized public key.
263286
264- ### 10 . ` encrypt_rsa(public_key_bytes, plaintext) `
287+ ### 11 . ` encrypt_rsa(public_key_bytes, plaintext) `
265288
266289** Purpose:** Encrypts plaintext using RSA encryption with a provided public key.
267290
@@ -280,7 +303,7 @@ ciphertext = encrypt_rsa(public_key_bytes, plaintext)
280303
281304- ` ciphertext ` : The encrypted message.
282305
283- ### 11 . ` decrypt_rsa(private_key_bytes, ciphertext) `
306+ ### 12 . ` decrypt_rsa(private_key_bytes, ciphertext) `
284307
285308** Purpose:** Decrypts ciphertext using RSA decryption with a provided private key.
286309
@@ -299,7 +322,7 @@ plaintext = decrypt_rsa(private_key_bytes, ciphertext)
299322
300323- ` plaintext ` : The decrypted message.
301324
302- ### 12 . ` decrypt_uint(ciphertext, user_key) `
325+ ### 13 . ` decrypt_uint(ciphertext, user_key) `
303326
304327** Purpose:** Decrypts a value stored in a contract using a user key
305328
@@ -318,7 +341,7 @@ plaintext = decrypt_uint(ciphertext, user_key)
318341
319342- ` result ` : The decrypted value.
320343
321- ### 13 . ` decrypt_string(ciphertext, user_key) `
344+ ### 14 . ` decrypt_string(ciphertext, user_key) `
322345
323346** Purpose:** Decrypts a value stored in a contract using a user key
324347
@@ -337,6 +360,25 @@ plaintext = decrypt_string(ciphertext, user_key)
337360
338361- ` result ` : The decrypted value.
339362
363+ ### 15. ` decrypt_address(ciphertext, user_key) `
364+
365+ ** Purpose:** Decrypts a value stored in a contract and encrypted using a user key
366+
367+ ** Usage:**
368+
369+ ``` python
370+ plaintext = decrypt_string(ciphertext, user_key)
371+ ```
372+
373+ ** Parameters:**
374+
375+ - ` ciphertext ` : A dictionary of the form { "ct1": int, "ct2": int, "ct3": int } where each cell holds a portion of the address encrypted
376+ - ` userKey ` : The user's AES key.
377+
378+ ** Returns:**
379+
380+ - ` result ` : The decrypted address.
381+
340382# Utilities (utils.py) Functions
341383
342384### 1. ` web3_connected(web3) `
0 commit comments