decrypt

GLEngine.decrypt(ciphertext, secret_key)
암호문을 복호화합니다.
  • 인풋:
    • GLCiphertext
    • GLSecretKey
  • 아웃풋:
    • numpy.ndarray
      • dtype은 기본적으로 numpy.double64인데, 연산과정중에 복소수가 포함되어있었다면 numpy.complex128의 형태로 출력됩니다.
import numpy as np

from desilofhe import GLEngine

engine = GLEngine()
secret_key = engine.create_secret_key()

message = np.ones(engine.shape)
ciphertext = engine.encrypt(message, secret_key)
decrypted = engine.decrypt(ciphertext, secret_key)