mod_raise
Engine.mod_raise(ciphertext, bootstrap_key)
- 부트스트랩 과정의 중간 단계인 ModRaise 함수를 수행합니다. 출력값이 암호문이기는 하지만 아직 정상적인 암호문이 아니기에 추가적으로 coefficient to slot, evalate modulo, slot to coefficient 단계들을 별도로 수행해야합니다. 부트스트랩 연산을 직접 구현하고 싶은 경우에만 유의미합니다. 엔진이 부트스트랩용으로 생성된 경우에만 사용할 수 있습니다.
- 인풋:
- Ciphertext: 값이 -1 에서 1 이내의 값이어야 합니다.
- BootstrapKey
- 아웃풋:
- Ciphertext: 25 레벨 입니다.
from desilofhe import Engine
engine = Engine(use_bootstrap=True)
secret_key = engine.create_secret_key()
public_key = engine.create_public_key(secret_key)
bootstrap_key = engine.create_bootstrap_key(secret_key, stage_count=3)
message = [-1, 0, 1]
ciphertext = engine.encrypt(message, public_key, level=0)
mod_raised = engine.mod_raise(ciphertext, bootstrap_key)
Engine.mod_raise(ciphertext, small_bootstrap_key)
- 부트스트랩 과정의 중간 단계인 ModRaise 함수를 수행합니다. 출력값이 암호문이기는 하지만 아직 정상적인 암호문이 아니기에 추가적으로 coefficient to slot, evalate modulo, slot to coefficient 단계들을 별도로 수행해야합니다. 부트스트랩 연산을 직접 구현하고 싶은 경우에만 유의미합니다. 엔진이 부트스트랩용으로 생성된 경우에만 사용할 수 있습니다.
- 인풋:
- Ciphertext: 값이 -1 에서 1 이내의 값이어야 합니다.
- SmallBootstrapKey
- 아웃풋:
- Ciphertext: 25 레벨 입니다.
from desilofhe import Engine
engine = Engine(use_bootstrap=True)
secret_key = engine.create_secret_key()
public_key = engine.create_public_key(secret_key)
small_bootstrap_key = engine.create_small_bootstrap_key(secret_key)
message = [-1, 0, 1]
ciphertext = engine.encrypt(message, public_key, level=0)
mod_raised = engine.mod_raise(ciphertext, small_bootstrap_key)
부트스트랩 키는 내부적으로 간이 부트스트랩 키를 포함하고 있기 때문에 위 두 함수는 동일한 연산을 수행합니다.