vstack

Engine.vstack(ciphertexts)
Stack ciphertexts in sequence vertically (row wise). All the input ciphertexts should have the same level, NTT state, rescaled state, and multiparty state.
  • Input:
    • list of Ciphertext
  • Output:
    • Ciphertext
from desilofhe import Engine

engine = Engine(slot_count=4)
secret_key = engine.create_secret_key()

message_4 = [1, 2, 3, 4]
ciphertext_4 = engine.encrypt(message_4, secret_key)

message_8 = [5, 6, 7, 8, 9, 10, 11, 12]
ciphertext_8 = engine.encrypt(message_8, secret_key)

# contents of ciphertext_4:
# [[ 1,  2,  3,  4]]
# contents of ciphertext_8:
# [[ 5,  6,  7,  8],
#  [ 9, 10, 11, 12]]

ciphertext_12 = engine.vstack([ciphertext_4, ciphertext_8])

# contents of ciphertext_12:
# [[ 1,  2,  3,  4],
#  [ 5,  6,  7,  8],
#  [ 9, 10, 11, 12]]