math

Library providing mathematical basics in Rust. The library is based on FLINT.

https://github.com/qfall/math

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.7%) to scientific vocabulary

Keywords

cryptography math rust
Last synced: 6 months ago · JSON representation ·

Repository

Library providing mathematical basics in Rust. The library is based on FLINT.

Basic Info
  • Host: GitHub
  • Owner: qfall
  • License: mpl-2.0
  • Language: Rust
  • Default Branch: dev
  • Homepage:
  • Size: 9.67 MB
Statistics
  • Stars: 20
  • Watchers: 0
  • Forks: 2
  • Open Issues: 5
  • Releases: 0
Topics
cryptography math rust
Created almost 3 years ago · Last pushed 6 months ago
Metadata Files
Readme License Citation Codeowners

README.md

qFALL-math

made-with-rust CI License: MPL 2.0

This repository is currently being developed by the project group qFALL - quantum resistant fast lattice library in the winter term 2022 and summer term 2023 by the Codes and Cryptography research group in Paderborn.

The main objective of this project is to develop a memory-safe and efficient usage of FLINT in Rust. Its main purpose is to use this library as a building block to build other projects on top of it.

Disclaimer

Currently, we are in the development phase and interfaces might change. Feel free to check out the current progress, but be aware, that the content will change in the upcoming weeks and months. An official release will most likely be published in the second half of 2024.

Quick-Start

Please refer to our website as a central information point.

To install and add our library to your project, please refer to our tutorial. It provides a step-by-step guide to install the required libraries and gives further insights into the usage of our crates.

What does qFALL-math offer?

Extensive documentation can be generated using

bash cargo doc # suffix with --open to directly open the documentation

once the project is cloned. Following, there is a small overview containing the general types of our library qFALL-math.

bash math ├── ... ├── src │ ├── integer # src folder containing implementations of integers │ ├── integer_mod_q # src folder containing implementations of integers │ │ # for which a certain modulus is applied │ └── rational # src folder containing implementations of rationals └── ...

Integers

  • Z: Represents $\mathbb Z$.
  • MatZ: Represents matrices of $\mathbb Z$.
  • PolyOverZ: Represents polynomials with coefficients over $\mathbb Z$.
  • MatPolyOverZ: Represents matrices of polynomials with coefficients over $\mathbb Z$.

```rust use qfall_math::integer::Z;

let a = Z::from(24); let b = Z::from(42);

let resadd: Z = &a + &b; let ressub: Z = a - 10; let res_mul: Z = 3 * b; ```

Integers mod q

  • Zq: Represents $\mathbb Z_q$.
  • MatZq: Represents matrices of $\mathbb Z_q$.
  • PolyOverZq: Represents polynomials with coefficients over $\mathbb Z_q$.
  • PolynomialRingZq: Represents quotient rings of $\mathbb Z_q[X]/f(X)$ where $q$ is an integer modulus and $f(X)$ is a PolyOverZq.
  • MatPolynomialRingZq: Represents matrices of quotient rings of $\mathbb Z_q[X]/f(X)$ where $q$ is an integer modulus and $f(X)$ is a PolyOverZq.

```rust use qfallmath::integermodq::Zq; use qfallmath::integermodq::Modulus;

let modulus = Modulus::from(24); let a = Zq::from((42, &modulus)); let b = Zq::from((17, &modulus));

let resadd: Zq = &a + &b; let ressub: Zq = a - 10; let res_mul: Zq = 3 * b; ```

Rationals

  • Q: Represents $\mathbb Q$.
  • MatQ: Represents matrices of $\mathbb Q$.
  • PolyOverQ: Represents polynomials with coefficients over $\mathbb Q$.

```rust use qfall_math::rational::Q;

let a = Q::from((17, 19)); let b = Q::from(0.5);

let resadd: Q = &a + &b; let ressub: Q = a - 10.5; let res_mul: Q = 3 * b; ```

External Libraries

This project uses the C-based, optimized math library FLINT. To use a C-library in Rust, there has to be an FFI (Foreign Function Interface) which allows to call the methods from FLINT in Rust. This project uses the crate flint-sys as a binding for FLINT. Furthermore, we utilized serde and serde_json to (de-)serialize objects to and from JSON. Last, but not least, our sampling algorithms heavily rely on the rand-crate. An extensive list can be found in our Cargo.toml file.

License

This library is distributed under the Mozilla Public License Version 2.0 which can be found here License. Permissions of this weak copyleft license are conditioned on making available the source code of licensed files and modifications of those files under the same license (or in certain cases, 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.

Citing

Please use the following bibtex entry to cite qFALL-math:

text @software{Porzenheim_qFALL-math, author = {Porzenheim, Laurens and Beckmann, Marvin and Kramer, Paul and Milewski, Phil and Moog, Sven and Schmidt, Marcel and Siemer, Niklas}, license = {MPL-2.0}, title = {{qFALL-math}}, url = {https://github.com/qfall/math} }

Get in Touch

To contact us, please refer to our mailing list pg-qfall(at)lists.upb.de.

Owner

  • Name: qFALL
  • Login: qfall
  • Kind: organization
  • Location: Germany

Citation (CITATION.cff)

# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!

cff-version: 1.2.0
title: qFALL-math
message: 'University Paderborn,  Codes and Cryptography'
type: software
authors:
  - given-names: Laurens
    family-names: Porzenheim
  - given-names: Marvin
    family-names: Beckmann
  - given-names: Paul
    family-names: Kramer
  - given-names: Phil
    family-names: Milewski
  - given-names: Sven
    family-names: Moog
  - given-names: Marcel
    family-names: Schmidt
  - given-names: Niklas
    family-names: Siemer
repository-code: 'https://github.com/qfall/math'
license: MPL-2.0

GitHub Events

Total
  • Watch event: 1
  • Delete event: 78
  • Push event: 308
  • Pull request review event: 169
  • Pull request review comment event: 152
  • Pull request event: 144
  • Create event: 81
Last Year
  • Watch event: 1
  • Delete event: 78
  • Push event: 308
  • Pull request review event: 169
  • Pull request review comment event: 152
  • Pull request event: 144
  • Create event: 81

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 0
  • Total pull requests: 70
  • Average time to close issues: N/A
  • Average time to close pull requests: 20 days
  • Total issue authors: 0
  • Total pull request authors: 4
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 56
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 70
  • Average time to close issues: N/A
  • Average time to close pull requests: 20 days
  • Issue authors: 0
  • Pull request authors: 4
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 56
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • Marcel583 (2)
Pull Request Authors
  • Marcel583 (50)
  • jnsiemer (33)
  • Marvin-Beckmann (17)
  • 3pmile (2)
Top Labels
Issue Labels
enhancement📈 (1)
Pull Request Labels
enhancement📈 (69) performance⚡ (12) documentation📖 (8) bug🐛 (6) hotfix🔥 (3) refactoring :tractor: (2)

Dependencies

.github/workflows/main.yml actions
  • actions-rs/audit-check v1 composite
  • actions-rs/cargo v1 composite
  • actions-rs/clippy-check v1 composite
  • actions-rs/tarpaulin v0.1 composite
  • actions-rs/toolchain v1 composite
  • actions/cache v3 composite
  • actions/checkout v3 composite
  • actions/upload-artifact v1 composite
.github/workflows/pull_request.yml actions
  • actions-rs/audit-check v1 composite
  • actions-rs/cargo v1 composite
  • actions-rs/clippy-check v1 composite
  • actions-rs/tarpaulin v0.1 composite
  • actions-rs/toolchain v1 composite
  • actions/cache v3 composite
  • actions/checkout v3 composite
  • actions/upload-artifact v1 composite
.github/workflows/push.yml actions
  • actions-rs/audit-check v1 composite
  • actions-rs/cargo v1 composite
  • actions-rs/clippy-check v1 composite
  • actions-rs/toolchain v1 composite
  • actions/cache v3 composite
  • actions/checkout v2 composite
Cargo.toml cargo