Skip to content

qfall/schemes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

qFALL-schemes

github crates.io docs.rs tutorial build license

qFALL is a prototyping library for lattice-based cryptography. This schemes-crate collects implementations of lattice-based constructions s.t. anyone can audit, modify, extend, or build on top of them to prototype more involved constructions or protocols.

Quick-Start

First, ensure that you use a Unix-like distribution (Linux or MacOS). Setup WSL if you're using Windows. This is required due to this crate's dependency on FLINT. Then, make sure your rustc --version is 1.85 or newer.

Furthermore, it's required that m4, a C-compiler such as gcc, and make are installed.

sudo apt-get install m4 gcc make

Then, add you can add this crate to your project by executing the following command.

cargo add qfall-schemes

What does qFALL-schemes offer?

qFALL-schemes collects prototype implementations of lattice-based constructions to audit, modify, extend, and reuse them more easily in more involved constructions or protocols.

List of prototypes

Quick Examples

Kyber's Public-Key Encryption

use qfall_schemes::pk_encryption::{KPKE, PKEncryptionScheme};
use qfall_math::integer::Z;

// setup public parameters
let k_pke = KPKE::ml_kem_512();

// generate (pk, sk) pair
let (pk, sk) = k_pke.key_gen();

// encrypt a message
let msg = Z::from_utf8("Hello");
let cipher = k_pke.enc(&pk, &msg);

// decrypt the ciphertext
let m = k_pke.dec(&sk, &cipher);

assert_eq!(msg, m);

GPV-based Probabilistic Full-Domain Hash

use qfall_schemes::signature::{pfdh::PFDHGPV, SignatureScheme};

let mut pfdh = PFDHGPV::setup(4, 113, 17, 128);

let msg = "Hello World!";

let (pk, sk) = pfdh.key_gen();
let sigma = pfdh.sign(msg.clone(), &sk, &pk);

assert!(pfdh.vfy(msg.clone(), &sigma, &pk));

SemVer and Backward Compatibility

As initial implementations of traits and prototypes can sometimes be optimized by changing the API, we give no API/interface stability guarantees for this crate. We try to be mindful but we may reorganize code without warning in advance. Therefore, it is recommended to fix the used version version = "=x.y.z" in your Cargo.toml.

Bugs

Please report bugs through the GitHub issue tracker.

Contributions

Contributors are:

  • Marvin Beckmann
  • Phil Milewski
  • Jan Niklas Siemer

A few reasons to merge your prototype into qFALL-schemes.

  • In case of API changes, a version update of Rust or adapted formatting requirements, prototypes in this crate be kept executable and up-to-date.
  • qFALL may benefit from your contribution as most prototypes are built with some optimisation in mind. We may consider integrating your optimisation into qfall-math and qfall-tools.
  • We ensure that prototypes are properly formatted, modularised, and documented before merging s.t. prototypes yield a reusable resource to the community.
  • Researchers and developers may benefit from the public exposure of their prototype (and the often associated paper).

See Contributing for details on how to contribute.

Citing

Please use the following bibtex entry to cite qFALL.

TODO: Update to eprint

Dependencies

This project is based on qfall-math and qfall-tools, which build on top of the C-based, optimised math-library FLINT. We utilise serde and serde_json to (de-)serialize objects to and from JSON. This crate relies on criterion for benchmarking purposes. An extensive list can be found in our Cargo.toml file.

License

This library is distributed under the Mozilla Public License Version 2.0. Permissions of this weak copyleft license are conditioned on making the source code of licensed files and modifications of those files available under the same license (or in certain cases, under one of the GNU licenses). Copyright and license notices must be preserved. Contributors provide an express grant of patent rights. However, a larger work using the licensed work may be distributed under different terms and without source code for files added to the larger work.

About

A collection of schemes implemented using `qfall-math` and `qfall-tools`.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages