ckks_engine

Module ckks

Source

About the `ckks` Module

The `ckks` module in the ckks_engine crate provides the core functionality of the Cheon-Kim-Kim-Song (CKKS) encryption scheme. It is a homomorphic encryption scheme specifically designed for performing arithmetic operations directly on encrypted data, while preserving the privacy of the underlying plaintext.

Key Features

  • CKKS Parameters: Includes tools to define polynomial degree and prime modulus, critical for the encryption scheme's functionality.
  • Encryptor: The CKKSEncryptor struct provides methods for encrypting collections, individual values, and strings using public keys.
  • Decryptor: The CKKSDecryptor struct allows for decryption of ciphertexts using secret keys, restoring encrypted data back to its plaintext form.
  • Modular Reduction: Ensures that encrypted data remains within the bounds of the encryption parameters.
  • String Operations: Extends the CKKS scheme to handle encrypted string encoding, encryption, and decryption.

How It Works

The CKKS scheme relies on polynomial arithmetic and encoding to represent real numbers or strings as polynomials. These encoded polynomials are then encrypted using public keys and can be decrypted back using corresponding secret keys.

The module integrates key generation, polynomial operations, and modular reduction to ensure secure and efficient encrypted computations. It supports both numeric and string-based data, making it versatile for a wide range of applications.

Usage

The `ckks` module is central to the functionality of the ckks_engine crate and is typically used in combination with other modules, such as arithmetic for operations and keygen for key management.

To use the `ckks` module, create instances of the CKKSEncryptor and CKKSDecryptor structs with the required keys and parameters, then perform encryption and decryption operations on data.

Structsยง