Crate fast_paillier

Crate fast_paillier 

Source
Expand description

License Docs Crates io Discord

§Optimized Paillier encryption scheme

Library implements Paillier encryption scheme with optimization such as:

  • Faster encryption and homomorphic operations via Chinese Remainder Theorem when the private key is known
  • Faster secret key generation (a.k.a faster safe primes generation)

§Big integer backend

This crate uses an abstraction over the big integer implementation, available in backend module. The concrete backend can be selected with a feature flag:

  • backend-num-bigint (default) - use num-bigit
  • backend-rug - use rug. This backend is based on GNU GMP and can be several times faster.

The applicability of this backend to your uses is not guaranteed, any additional functionality to it will not be added. However, you can convert them to bytes or, if using a fixed backend, to the underlying format, and perform the necessary operations with those.

§#![no_std] support

Library is #![no_std]-friendly as long as you enable no_std feature, and you use only these features: backend-num-bigint, serde. Enabling other features will introduce transitive dependency on std.

§Join us in Discord!

Feel free to reach out to us in Discord!

Modules§

backend
Abstract big integer backend. This module makes no guarantees of applicability, all methods are considered internal, except for conversion functions:
utils
Various utilities

Structs§

DecryptionKey
Paillier decryption key
EncryptionKey
Paillier encryption key
Error
Error type used in the library

Traits§

AnyEncryptionKey
Any key capable of encryption
AnyEncryptionKeyExt
Additional functionality implemented for AnyEncryptionKey

Type Aliases§

Ciphertext
Paillier ciphertext
Nonce
Paillier nonce
Plaintext
Paillier plaintext