gmpmee_sys/lib.rs
1// Copyright © 2024 Denis Morel
2
3// This program is free software: you can redistribute it and/or modify it under
4// the terms of the GNU Lesser General Public License as published by the Free
5// Software Foundation, either version 3 of the License, or (at your option) any
6// later version.
7//
8// This program is distributed in the hope that it will be useful, but WITHOUT
9// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
10// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
11// details.
12//
13// You should have received a copy of the GNU Lesser General Public License and
14// a copy of the GNU General Public License along with this program. If not, see
15// <https://www.gnu.org/licenses/>.
16
17//! The gmpmee-sys crate provides Rust FFI bindings to the
18//! [GMP Modular Exponentiation Extension (GMPMEE)](https://github.com/verificatum/verificatum-gmpmee),
19//! which is a minor extension of [GMP](https://gmplib.org/).
20//! It adds simultaneous modular exponentiation and fixed base modular exponentiation functionality to the set of
21//! integer functions (the mpz-functions), as well as special purpose primality testing routines.
22//!
23//! The crate is strongly inspired from [gmp-mpfr-sys](https://crates.io/crates/gmp-mpfr-sys).
24//! In particular the file `build.rs` is copied from this crate, and adapted to the needs of the gmpmee-sys crate.
25//! No cache is implemented, since the compilation is quick.
26//!
27//! # Types
28//!
29//! Unlike in the C libraries, the types (e.g. `gmpmee_spowm_tab`, `gmpmee_fpowm_tab`) are defined directly as structs,
30//! not as single-element arrays.
31//!
32//! # Using gmpmee-sys
33//!
34//! The gmpmee-sys crate is available on crates.io.
35//! To use gmpmee-sys in your crate, add it as a dependency inside [*Cargo.toml*]:
36//!
37//! ```toml
38//! [dependencies]
39//! gmpmee-sys = "0.1"
40//! ```
41//!
42//! # Building on GNU/Linux
43//! To build on GNU/Linux, simply make sure you have `diffutils`, `gcc`,
44//! `make`, `autoconf`, `libtool`, `m4` and `gmp` installed on your system. For example on Debian:
45//!
46//! ```sh
47//! sudo apt update
48//! sudo apt install diffutils gcc make m4 autoconf libtool libgmp3-dev
49//! ```
50//!
51//! # Building on macOS
52//!
53//! To build on macOS, you need the command-line developer tools. To
54//! install them, run the following command in a terminal:
55//!
56//! ```sh
57//! xcode-select --install
58//! ```
59//!
60//! # Building on Windows
61//! You can build on Windows with the Rust GNU toolchain and an up-to-date
62//!
63//! # Licence
64//!
65//! The gmpee-sys crate is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. See the full text of the [LICENSE](LICENSE.md) for details.
66
67mod gmpmee;
68
69pub use gmpmee::*;