__len__
DecryptedShare.__len__
- Returns the length of the decrypted share. If a decrypted share represents data that is longer than the engine's slot count, it is internally decrypted once per every slot count. This length represents the total number of decrypted data divided by the engine's slot count.
from desilofhe import Engine
engine = Engine(use_multiparty=True)
secret_key_1 = engine.create_secret_key()
secret_key_2 = engine.create_secret_key()
public_key_a = engine.create_public_key_a()
public_key_b1 = engine.create_public_key_b(secret_key1, public_key_a)
public_key_b2 = engine.create_public_key_b(secret_key2, public_key_a)
public_key = engine.create_multiparty_public_key([public_key_b1, public_key_b2], public_key_a)
message = [1] * 2 * engine.slot_count
ciphertext = engine.encrypt(message, public_key)
decrypted_share = engine.individual_decrypt(ciphertext, secret_key_1)
length = len(decrypted_share) # 2