vstack

Engine.vstack(ciphertexts)
암호문들을 세로로 쌓습니다. 행렬의 행 단위로 이어붙인다고 볼 수 있습니다. 인자의 암호문들은 전부 같은 레벨이고 NTT, rescaled, multiparty 상태가 같아야 합니다.
  • 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)

# ciphertext_4의 내부:
# [[ 1,  2,  3,  4]]
# ciphertext_8의 내부:
# [[ 5,  6,  7,  8],
#  [ 9, 10, 11, 12]]

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

# ciphertext_12의 내부:
# [[ 1,  2,  3,  4],
#  [ 5,  6,  7,  8],
#  [ 9, 10, 11, 12]]