merge_bootstrap

Engine.merge_bootstrap(ciphertext1, ciphertext2, evaluation_key)
두 실수 암호문을 한 번에 부트스트랩합니다. 연산 키를 사용하면 재선형화 키, 켤레화 키, 부트스트랩 키를 따로 전달하지 않고 하나의 키로 부트스트랩할 수 있습니다. 엔진이 부트스트랩용으로 생성된 경우에만 사용할 수 있습니다.
  • 인풋:
    • ciphertext1: Ciphertext
      • 부트스트랩을 수행할 첫 번째 암호문입니다. 실수 값만을 포함해야 합니다. 값이 -1 에서 1 이내의 값이어야 합니다.
    • ciphertext2: Ciphertext
      • 부트스트랩을 수행할 두 번째 암호문입니다. 실수 값만을 포함해야 합니다. 값이 -1 에서 1 이내의 값이어야 합니다.
    • EvaluationKey
  • 아웃풋:
    • (bootstrapped1, bootstrapped2) : tuple of Ciphertexts
      • 부트스트랩이 수행된 17 레벨 암호문 쌍입니다.

Warning

  • 행렬 엔진은 이 연산을 아직 지원하지 않습니다.
from desilofhe import Engine

engine = Engine(bootstrap=True)
secret_key = engine.create_secret_key()
public_key = engine.create_public_key(secret_key)
evaluation_key = engine.create_evaluation_key(secret_key)

message1 = [-1, 0, 1]
message2 = [1, 0, -1]
ciphertext1 = engine.encrypt(message1, public_key, level=0)
ciphertext2 = engine.encrypt(message2, public_key, level=0)
bootstrapped1, bootstrapped2 = engine.merge_bootstrap(
    ciphertext1, ciphertext2, evaluation_key
)
Engine.merge_bootstrap(ciphertext1, ciphertext2, relinearization_key, conjugation_key, bootstrap_key)
병합 부트스트랩은 실수 값만을 포함한 두 암호문의 부트스트랩을 한 번에 수행합니다. 부트스트랩 키를 사용하여 간이 부트스트랩 키를 사용하는 경우보다 추가적인 메모리가 사용되지만 더 좋은 성능을 가집니다. 엔진이 부트스트랩용으로 생성된 경우에만 사용할 수 있습니다.
  • 인풋:
    • ciphertext1: Ciphertext
      • 부트스트랩을 수행할 첫 번째 암호문입니다. 실수 값만을 포함해야 합니다. 값이 -1 에서 1 이내의 값이어야 합니다.
    • ciphertext2: Ciphertext
      • 부트스트랩을 수행할 두 번째 암호문입니다. 실수 값만을 포함해야 합니다. 값이 -1 에서 1 이내의 값이어야 합니다.
    • RelinearizationKey
    • ConjugationKey
    • BootstrapKey
  • 아웃풋:
    • (bootstrapped1, bootstrapped2) : tuple of Ciphertexts
      • 부트스트랩이 수행된 17 레벨 암호문 쌍입니다.

Warning

  • 행렬 엔진은 이 연산을 아직 지원하지 않습니다.
from desilofhe import Engine

engine = Engine(bootstrap=True)
secret_key = engine.create_secret_key()
public_key = engine.create_public_key(secret_key)
relinearization_key = engine.create_relinearization_key(secret_key)
conjugation_key = engine.create_conjugation_key(secret_key)
bootstrap_key = engine.create_bootstrap_key(secret_key)

message1 = [-1, 0, 1]
message2 = [1, 0, -1]
ciphertext1 = engine.encrypt(message1, public_key, level=0)
ciphertext2 = engine.encrypt(message2, public_key, level=0)
bootstrapped1, bootstrapped2 = engine.merge_bootstrap(
    ciphertext1,
    ciphertext2,
    relinearization_key,
    conjugation_key,
    bootstrap_key,
)
Engine.merge_bootstrap(ciphertext1, ciphertext2, relinearization_key, conjugation_key, roll_key, small_bootstrap_key)
곱셈 횟수를 다시 늘려줍니다. 간이 부트스트랩 키를 사용하여 메모리 사용이 적지만 느립니다. 엔진이 부트스트랩용으로 생성된 경우에만 사용할 수 있습니다.
  • 인풋:
    • ciphertext1: Ciphertext
      • 부트스트랩을 수행할 첫 번째 암호문입니다. 실수 값만을 포함해야 합니다. 값이 -1 에서 1 이내의 값이어야 합니다.
    • ciphertext2: Ciphertext
      • 부트스트랩을 수행할 두 번째 암호문입니다. 실수 값만을 포함해야 합니다. 값이 -1 에서 1 이내의 값이어야 합니다.
    • RelinearizationKey
    • ConjugationKey
    • RollKey
    • SmallBootstrapKey
  • 아웃풋:
    • (bootstrapped1, bootstrapped2) : tuple of Ciphertexts
      • 부트스트랩이 수행된 17 레벨 암호문 쌍입니다.

Warning

  • 행렬 엔진은 이 연산을 아직 지원하지 않습니다.
from desilofhe import Engine

engine = Engine(bootstrap=True)
secret_key = engine.create_secret_key()
public_key = engine.create_public_key(secret_key)
relinearization_key = engine.create_relinearization_key(secret_key)
conjugation_key = engine.create_conjugation_key(secret_key)
roll_key = engine.create_roll_key(secret_key)
small_bootstrap_key = engine.create_small_bootstrap_key(secret_key)

message1 = [-1, 0, 1]
message2 = [1, 0, -1]
ciphertext1 = engine.encrypt(message1, public_key, level=0)
ciphertext2 = engine.encrypt(message2, public_key, level=0)
bootstrapped1, bootstrapped2 = engine.merge_bootstrap(
    ciphertext1,
    ciphertext2,
    relinearization_key,
    conjugation_key,
    roll_key,
    small_bootstrap_key,
)