hetorch.compiler.ir
Custom HE operations for PyTorch
Functions
_register_he_ops()
Register HE operations as PyTorch custom ops
bootstrap(ct: torch.Tensor) -\> torch.Tensor
Bootstrap ciphertext
cadd(ct1: torch.Tensor, ct2: torch.Tensor) -\> torch.Tensor
Ciphertext addition
cmult(ct1: torch.Tensor, ct2: torch.Tensor) -\> torch.Tensor
Ciphertext multiplication
padd(ct: torch.Tensor, pt: torch.Tensor) -\> torch.Tensor
Add plaintext to ciphertext
pmult(ct: torch.Tensor, pt: torch.Tensor) -\> torch.Tensor
Multiply ciphertext by plaintext
relinearize(ct: torch.Tensor) -\> torch.Tensor
Relinearize ciphertext (reduce size after multiplication)
rescale(ct: torch.Tensor) -\> torch.Tensor
Rescale ciphertext (CKKS)
rotate(ct: torch.Tensor, steps: int) -\> torch.Tensor
Ciphertext rotation