Skip to content

Commit 176d1c2

Browse files
committed
update uint encryption
1 parent 9126ab9 commit 176d1c2

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

coti/crypto_utils.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,10 @@ def build_input_text(plaintext, user_aes_key, sender, contract, function_selecto
120120
# Convert the ct to an integer
121121
int_cipher_text = int.from_bytes(ct, byteorder='big')
122122

123-
return int_cipher_text, signature
123+
return {
124+
'ciphertext': int_cipher_text,
125+
'signature': signature
126+
}
124127

125128

126129
def build_string_input_text(plaintext, user_aes_key, sender, contract, function_selector, signing_key):
@@ -139,7 +142,7 @@ def build_string_input_text(plaintext, user_aes_key, sender, contract, function_
139142

140143
byte_arr = encoded_plaintext[start_idx:end_idx] + bytearray(8 - (end_idx - start_idx))
141144

142-
ct_int, sig = build_input_text(
145+
it_int = build_input_text(
143146
int.from_bytes(byte_arr, 'big'),
144147
user_aes_key,
145148
sender,
@@ -148,8 +151,8 @@ def build_string_input_text(plaintext, user_aes_key, sender, contract, function_
148151
signing_key
149152
)
150153

151-
input_text['ciphertext']['value'].append(ct_int)
152-
input_text['signature'].append(sig)
154+
input_text['ciphertext']['value'].append(it_int['ciphertext'])
155+
input_text['signature'].append(it_int['signature'])
153156

154157
return input_text
155158

0 commit comments

Comments
 (0)