lattigo

package module
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 20, 2024 License: Apache-2.0, BSD-3-Clause, ISC, + 1 more Imports: 0 Imported by: 0

README

Pro7ech's Lattigo: Lattice-Based Multiparty Homomorphic Encryption Library in Go

This is a fork of Tune Insight's Lattigo v5.0.2, that includes a refactored backend, many additional features and new protocols.

See CHANGELOG for additional information.

Go tests

Lattigo is a Go module that implements full-RNS Ring-Learning-With-Errors-based homomorphic-encryption primitives and Multiparty-Homomorphic-Encryption-based secure protocols. The library features:

  • Optimized arithmetic for power-of-two cyclotomic rings.
  • Advanced and scheme-agnostic implementation of RLWE-based primitives, key-generation, and their multiparty version.
  • Implementation of the BFV/BGV and CKKS schemes and their multiparty version.
  • Support for RGSW, external product and LMKCDEY blind rotations.
  • A pure Go implementation, enabling cross-platform builds, including WASM compilation for browser clients, with comparable performance to state-of-the-art C++ libraries.

Lattigo is meant to support HE in distributed systems and microservices architectures, for which Go is a common choice thanks to its natural concurrency model and portability.

Library overview

The library exposes the following packages:

  • he: The main package of the library which provides scheme-agnostic interfaces and Homomorphic Encryption for different plaintext domains.

    • hebin: Homomorphic Encryption for binary arithmetic. It offers support for blind rotations (a.k.a Lookup Tables) over packed RLWE ciphertexts.

    • hefloat: Homomorphic Encryption for fixed-point approximate arithmetic over the complex or real numbers. The backed is based on a Full-RNS Homomorphic Encryption for Arithmetic for Approximate Numbers (HEAAN, a.k.a. CKKS) scheme. It provides fixed-point approximate arithmetic over the complex numbers (in its classic variant) and over the real numbers (in its conjugate-invariant variant).

      • bootstrapping: Bootstrapping for fixed-point approximate arithmetic over the real and complex numbers, with support for the Conjugate Invariant ring, batch bootstrapping with automatic packing/unpacking of sparsely packed/smaller ring degree ciphertexts, arbitrary precision bootstrapping, and advanced circuit customization/parameterization.
    • heint: Homomorphic Encryption for modular arithmetic over the integers. The backed is base on a Full-RNS generalization of the Brakerski-Fan-Vercauteren scale- invariant (BFV) and Brakerski-Gentry-Vaikuntanathan (BGV) homomorphic encryption schemes. It provides modular arithmetic over the integers.

  • mhe: Package for multiparty (a.k.a. distributed or threshold) key-generation and interactive ciphertext bootstrapping with secret-shared secret keys.

    • mhefloat: Homomorphic decryption and re-encryption from and to Linear-Secret-Sharing-Shares, as well as interactive ciphertext bootstrapping for the package he/hefloat.

    • mheint: Homomorphic decryption and re-encryption from and to Linear-Secret-Sharing-Shares, as well as interactive ciphertext bootstrapping for the package he/heint.

  • rlwe: Common base for generic RLWE-based homomorphic encryption. It provides all homomorphic functionalities and defines all structs that are not scheme-specific. This includes plaintext, ciphertext, key-generation, encryption, decryption and key-switching, as well as other more advanced primitives such as RLWE-repacking.

  • rgsw: A Full-RNS variant of Ring-GSW ciphertexts and supporting RLWExRGSW and RGSWxRGSW products.

  • ring: Modular arithmetic operations for polynomials in the RNS basis, including: RNS basis extension; RNS rescaling; number theoretic transform (NTT); uniform, Gaussian and ternary sampling.

  • examples: Executable Go programs that demonstrate the use of the library. Each subpackage includes test files that further demonstrate the use of the implemented primitives.

  • utils: Generic utility methods. This package also contains the following sub-pacakges:

    • concurrency: Basic helpers for adding concurrency.
    • bignum: Arbitrary precision linear algebra and polynomial approximation.
    • buffer: Efficient methods to write/read on io.Writer and io.Reader.
    • factorization: Various factorization algorithms for medium-sized integers.
    • sampling: Secure bytes sampling.
    • structs: Generic structs for maps, vectors and matrices, including serialization.
---
title: Packages Dependency & Organization
---
flowchart LR
RING(RING) --> RLWE(RLWE)
RLWE --> RGSW(RGSW)
RLWE --> HE([HE])
RLWE --> CKKS{{CKKS}}
RGSW --> HEBin{HEBin}
HE --> HEFloat{HEFloat}
HE --> HEInt{HEInt}
HE --> HEBin
BFV/BGV --> HEInt
CKKS --> HEFloat
RLWE --> BFV/BGV{{BFV/BGV}}
MHE --> MHEFloat
HEFloat --> MHEFloat((MHEFloat))
HEFloat --> Bootstrapping
HEInt --> MHEInt((MHEInt))
RLWE --> MHE([MHE])
MHE --> MHEInt

Versions and Roadmap

The current version of the library is fast-evolving and in constant development. Consequently, there will still be backward-incompatible changes within this major version, in addition to many bug fixes and new features. Hence, we encourage all users to always update to the latest version.

See CHANGELOG for the current and past versions.

Stability

Branches with the prefix dev_ are branches in active development and will be frequently rebased. Hence, we don't recommend depending on them.

Contributing to the Library

See CONTRIBUTING

Security

See SECURITY

License

Apache 2.0. See LICENSE

Contact

You can mail me at jeanphilippe.bossuat@gmail.com

Citing

Please use the following BibTex entry for citing Lattigo:

@misc{lattigo,
    title = {Pro7ech's Lattigo},
    howpublished = {Online: \url{https://github.com/Pro7ech/lattigo}},
    month = Nov,
    year = 2024,
    note = {EPFL-LDS, Tune Insight SA, Jean-Philippe Bossuat}
}

The Lattigo logo is a lattice-based version of the original Golang mascot by Renee French.

Documentation

Overview

Package lattigo is the open-source community-version of Tune Insight's Homomorphic Encryption library. It provides a pure Go implementation of state-of-the-art Homomorphic Encryption (HE) and Multiparty Homomorphic Encryption (MHE) schemes, enabling code-simplicity, cross-platform compatibility and easy builds, while retaining the same performance as C++ libraries.

Directories

Path Synopsis
Package examples contains several example Go applications that use lattigo in both the single- and multiparty settings, as well as several example parameter sets.
Package examples contains several example Go applications that use lattigo in both the single- and multiparty settings, as well as several example parameter sets.
single_party/hebin/blind_rotations command
Package main implements an example of Blind Rotation (a.k.a.
Package main implements an example of Blind Rotation (a.k.a.
single_party/hefloat/advanced/bootstrapping/basics command
Package main implements an example showcasing the basics of the bootstrapping for fixed-point approximate arithmetic over the reals/complexes.
Package main implements an example showcasing the basics of the bootstrapping for fixed-point approximate arithmetic over the reals/complexes.
single_party/hefloat/advanced/bootstrapping/high_precision command
Package main implements an example showcasing high-precision bootstrapping for high-precision fixed- point approximate arithmetic over the reals/complexes.
Package main implements an example showcasing high-precision bootstrapping for high-precision fixed- point approximate arithmetic over the reals/complexes.
single_party/hefloat/advanced/bootstrapping/slim command
Package main implements an example showcasing slim for bootstrapping for fixed-point approximate arithmetic over the reals/complexes numbers.
Package main implements an example showcasing slim for bootstrapping for fixed-point approximate arithmetic over the reals/complexes numbers.
single_party/hefloat/advanced/polynomial_evaluation command
Package main implements an example of smooth function approximation using Chebyshev polynomial interpolation.
Package main implements an example of smooth function approximation using Chebyshev polynomial interpolation.
single_party/hefloat/advanced/scheme_switching command
Package main showcases how lookup tables can complement fixed-point approximate homomorphic encryption to compute non-linear functions such as sign.
Package main showcases how lookup tables can complement fixed-point approximate homomorphic encryption to compute non-linear functions such as sign.
single_party/hefloat/basics command
Package main provides an example showcasing the basics of encrypted fixed-point approximate arithmetic over the reals/complexes using the package `hefloat`.
Package main provides an example showcasing the basics of encrypted fixed-point approximate arithmetic over the reals/complexes using the package `hefloat`.
single_party/hefloat/template command
Package main is a template encrypted arithmetic with floating point values, with a set of example parameters, key generation, encoding, encryption, decryption and decoding.
Package main is a template encrypted arithmetic with floating point values, with a set of example parameters, key generation, encoding, encryption, decryption and decoding.
single_party/heint/template command
Package main is a template encrypted modular arithmetic integers, with a set of example parameters, key generation, encoding, encryption, decryption and decoding.
Package main is a template encrypted modular arithmetic integers, with a set of example parameters, key generation, encoding, encryption, decryption and decoding.
he
Package he implements scheme agnostic functionalities for RLWE-based Homomorphic Encryption schemes implemented in lattigo.
Package he implements scheme agnostic functionalities for RLWE-based Homomorphic Encryption schemes implemented in lattigo.
hebin
Package hebin implements blind rotations evaluation for RLWE schemes.
Package hebin implements blind rotations evaluation for RLWE schemes.
hefloat
Package hefloat implements Homomorphic Encryption with fixed-point approximate arithmetic over the complex or real numbers.
Package hefloat implements Homomorphic Encryption with fixed-point approximate arithmetic over the complex or real numbers.
hefloat/bootstrapping
Package bootstrapping implements bootstrapping for fixed-point encrypted approximate homomorphic encryption over the complex/real numbers.
Package bootstrapping implements bootstrapping for fixed-point encrypted approximate homomorphic encryption over the complex/real numbers.
hefloat/cosine
Package cosine method is the Go implementation of the polynomial-approximation algorithm by Han and Ki in
Package cosine method is the Go implementation of the polynomial-approximation algorithm by Han and Ki in
heint
Package heint provides Homomorphic Encryption for encrypted modular arithmetic over the integers.
Package heint provides Homomorphic Encryption for encrypted modular arithmetic over the integers.
mhe
Package mhe implements RLWE-based scheme agnostic multiparty key-generation and proxy re-rencryption.
Package mhe implements RLWE-based scheme agnostic multiparty key-generation and proxy re-rencryption.
mhefloat
Package mhefloat implements homomorphic decryption to Linear-Secret-Shared-Shares (LSSS) and homomorphic re-encryption from LSSS, as well as interactive bootstrapping for the package `he/hefloat` See `mhe/README.md` for additional information on multiparty schemes.
Package mhefloat implements homomorphic decryption to Linear-Secret-Shared-Shares (LSSS) and homomorphic re-encryption from LSSS, as well as interactive bootstrapping for the package `he/hefloat` See `mhe/README.md` for additional information on multiparty schemes.
mheint
Package mheint implements homomorphic decryption to Linear-Secret-Shared-Shares (LSSS) and homomorphic re-encryption from LSSS, as well as interactive bootstrapping for the package `he/heint` See `mhe/README.md` for additional information on multiparty schemes.
Package mheint implements homomorphic decryption to Linear-Secret-Shared-Shares (LSSS) and homomorphic re-encryption from LSSS, as well as interactive bootstrapping for the package `he/heint` See `mhe/README.md` for additional information on multiparty schemes.
Package rgsw implements an RLWE-based GSW encryption and external product RLWE x RGSW -> RLWE.
Package rgsw implements an RLWE-based GSW encryption and external product RLWE x RGSW -> RLWE.
Package ring implements RNS-accelerated modular arithmetic operations for polynomials, including: RNS basis extension; RNS rescaling; number theoretic transform (NTT); uniform, Gaussian and ternary sampling.
Package ring implements RNS-accelerated modular arithmetic operations for polynomials, including: RNS basis extension; RNS rescaling; number theoretic transform (NTT); uniform, Gaussian and ternary sampling.
Package rlwe implements the generic cryptographic functionalities and operations that are common to R-LWE schemes.
Package rlwe implements the generic cryptographic functionalities and operations that are common to R-LWE schemes.
Package utils implements various helper functions.
Package utils implements various helper functions.
bignum
Package bignum implements arbitrary precision arithmetic for integers, reals and complex numbers.
Package bignum implements arbitrary precision arithmetic for integers, reals and complex numbers.
buffer
Package buffer implement methods for efficiently writing and reading values to and from io.Writer and io.Reader that also expose their internal buffers.
Package buffer implement methods for efficiently writing and reading values to and from io.Writer and io.Reader that also expose their internal buffers.
concurrency
Package concurrency implements a simple channel based ressource manager for concurrent operations.
Package concurrency implements a simple channel based ressource manager for concurrent operations.
factorization
Package factorization implements various algorithms for efficient factoring integers of small to medium size.
Package factorization implements various algorithms for efficient factoring integers of small to medium size.
sampling
Package sampling implements secure sampling.
Package sampling implements secure sampling.
structs
Package structs implements helpers to generalize vectors and matrices of structs, as well as their serialization.
Package structs implements helpers to generalize vectors and matrices of structs, as well as their serialization.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL