vstack
Engine.vstack(ciphertexts)- 암호문들을 세로로 쌓습니다. 행렬의 행 단위로 이어붙인다고 볼 수 있습니다. 인자의 암호문들은 전부 같은 레벨이고 NTT, rescaled, multiparty 상태가 같아야 합니다.
- 인풋:
list[Ciphertext]
- 아웃풋:
Ciphertext
Warning
- 행렬 엔진은 이 연산을 아직 지원하지 않습니다.
import numpy as np
from desilofhe import Engine
engine = Engine()
secret_key = engine.create_secret_key()
slot_count = engine.slot_count # 8192
message_1 = np.full(slot_count, 1)
ciphertext_1 = engine.encrypt(message_1, secret_key)
message_2 = np.repeat([2, 3], slot_count)
ciphertext_2 = engine.encrypt(message_2, secret_key)
# 각 행은 engine.slot_count (8192)개의 슬롯을 가집니다
# ciphertext_1의 내부:
# [[1, 1, ..., 1]]
# ciphertext_2의 내부:
# [[2, 2, ..., 2],
# [3, 3, ..., 3]]
ciphertext_3 = engine.vstack([ciphertext_1, ciphertext_2])
# ciphertext_3의 내부:
# [[1, 1, ..., 1],
# [2, 2, ..., 2],
# [3, 3, ..., 3]]