{"id":22281208,"url":"https://github.com/open-quantum-safe/liboqs-rust","last_synced_at":"2025-05-15T11:08:22.637Z","repository":{"id":37897330,"uuid":"252143304","full_name":"open-quantum-safe/liboqs-rust","owner":"open-quantum-safe","description":"Rust bindings for liboqs","archived":false,"fork":false,"pushed_at":"2025-05-01T14:37:30.000Z","size":8307,"stargazers_count":140,"open_issues_count":12,"forks_count":52,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-05-01T14:44:44.498Z","etag":null,"topics":["crypto","cryptography","nist-standardization","post-quantum","public-key-cryptography","rust","rust-bindings"],"latest_commit_sha":null,"homepage":"https://openquantumsafe.org/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/open-quantum-safe.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE-APACHE2","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-04-01T10:29:14.000Z","updated_at":"2025-05-01T14:33:24.000Z","dependencies_parsed_at":"2023-10-04T14:58:36.070Z","dependency_job_id":"56794fa3-6955-4046-b7f6-e86746651e3e","html_url":"https://github.com/open-quantum-safe/liboqs-rust","commit_stats":{"total_commits":228,"total_committers":15,"mean_commits":15.2,"dds":0.5789473684210527,"last_synced_commit":"f7bd5038018f2d69c55b642fcc373ae445ac378a"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-quantum-safe%2Fliboqs-rust","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-quantum-safe%2Fliboqs-rust/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-quantum-safe%2Fliboqs-rust/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-quantum-safe%2Fliboqs-rust/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/open-quantum-safe","download_url":"https://codeload.github.com/open-quantum-safe/liboqs-rust/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254328384,"owners_count":22052632,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["crypto","cryptography","nist-standardization","post-quantum","public-key-cryptography","rust","rust-bindings"],"created_at":"2024-12-03T16:16:14.706Z","updated_at":"2025-05-15T11:08:22.624Z","avatar_url":"https://github.com/open-quantum-safe.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# liboqs-rust: Rust bindings for liboqs\n\n[![Build status](https://github.com/open-quantum-safe/liboqs-rust/workflows/Continuous%20integration/badge.svg)](https://github.com/open-quantum-safe/liboqs-rust/actions?query=workflow%3A\"Continuous+integration\")\n\n| crate   | crates.io                                                                                  | docs.rs                                                                                           | License                                             |\n| ------- | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------- | --------------------------------------------------- |\n| oqs-sys | [ ![crates.io](https://img.shields.io/crates/v/oqs-sys)](https://crates.io/crates/oqs-sys) | [![crates.io/docs](https://img.shields.io/docsrs/oqs-sys)](https://docs.rs/crate/oqs-sys/latest/) | ![License](https://img.shields.io/crates/l/oqs-sys) |\n| oqs     | [![crates.io](https://img.shields.io/crates/v/oqs)](https://crates.io/crates/oqs)          | [![crates.io/docs](https://img.shields.io/docsrs/oqs)](https://docs.rs/crate/oqs/latest/)         | ![License](https://img.shields.io/crates/l/oqs)     |\n\n**liboqs-rust** offers two Rust wrappers for the [Open Quantum Safe](https://openquantumsafe.org/) [liboqs](https://github.com/open-quantum-safe/liboqs/) C library, which is a C library for quantum-resistant cryptographic algorithms.\n\n- The `oqs-sys` crate compiles and builds `liboqs` and generates `unsafe` bindings to the C library.\n- The `oqs` crate offers a Rust-style safe interface to the schemes included in `liboqs`.\n\n## Versioning\n\nReleases up to and including release `0.9.0` of `oqs` and `oqs-sys` followed the `liboqs` versioning 1-on-1.\n**Starting from release `0.9.0`, this is no longer guaranteed.**\nThese crates will now receive version bumps as necessary.\nWe will include the version number of `liboqs` that is distributed by `liboqs-sys` in the version number of `liboqs-sys`\nas `0.9.0+liboqs-0.9.0`.\n\n## Pre-requisites\n\n`oqs-sys` depends on the [liboqs](https://github.com/open-quantum-safe/liboqs) C library.\nIt will build `liboqs` automatically with the default-enabled `vendored` feature.\nSee below for more information.\n\n## Contents\n\nThis crate provides unsafe `ffi` bindings in the `oqs-sys` crate, and safe wrappers are offered via the `oqs` crate.\nThe rendered Rustdoc documentation can be [found here](https://open-quantum-safe.github.io/liboqs-rust/oqs/)\n\n## Usage\n\nUpdate your `Cargo.toml` and include `oqs`:\n\n```toml\n[dependencies]\noqs = \"0.10.1\"\n```\n\n`oqs-sys` can be specified equivalently.\n\n## Minimal builds\n\nThe default-on `kems` and `sigs` features turn on all supported KEMs and signature schemes. If you want a smaller build, turn off these default features and opt-in to individual algorithms.\nNote that if you specify `default-features = false`, you may also want to re-include the `oqs-sys/openssl` feature.\n\n## Vendored `liboqs`\n\nBy default `oqs-sys` attempts to find a system-provided version of `liboqs` and build against it,\nfalling back to vendored from-source build otherwise.\nYou can opt into forcing the vendored build by enabling the `vendored` feature.\n\nOtherwise, if you want to force using the system-provided `liboqs`,\nyou can set the `LIBOQS_NO_VENDOR=1` environment variable and the build will fail if the library is not found.\n\n## Serde support\n\nYou can enable `serde` serialization support by enabling the `serde` feature on the `oqs` crate.\n\n## `std` support\n\nThe `oqs-sys` crate does not use `std` at all.\nNote that the default features do enable building `liboqs` with `openssl`, so use `default-features = false`.\n\nTo make `oqs` a `#![no_std]` crate make sure the `std` feature is disabled.\nMake sure to also disable the `oqs-sys/openssl` feature by specifying `default-features = false`.\n\nAs `default-features` includes the `kems` and `sigs` features, consider re-adding them as well. This results into:\n\n```toml\n[dependencies.oqs]\nversion = \"*\"\ndefault-features = false\nfeatures = [\"sigs\", \"kems\"]\n```\n\nYou will probably want to change the random-number generator through the [`OQS_RAND` API][] offered by `oqs-sys`.\n\n[`OQS_RAND` API]: https://open-quantum-safe.github.io/liboqs-rust/oqs_sys/rand/index.html\n\n## `non_portable` feature\n\nIf compiled with the `non_portable` feature, `liboqs-sys` will not enable CPU feature detection and\nalways use the best implementation on your current platform. This enables support for implementations\nwhere feature detection is not functional.\n\n## Stack usage\n\nSome algorithms use large amounts of stack space. This means that you may need\nto specify `RUST_MIN_STACK` in your environment. This for example affects\ntests.\n\n## Algorithm features\n\n- `kems` (default): Compile with all KEMs enabled\n  - `bike`\n  - `classic_mceliece`\n  - `frodokem`\n  - `hqc`\n  - `kyber`\n  - `ml_kem`\n  - `ntruprime`\n- `sigs` (default): Compile with all signature schemes enabled\n  - `cross`\n  - `dilithium`\n  - `falcon`\n  - `mayo`\n  - `ml_dsa`\n  - `sphincs`: SPHINCS\u003csup\u003e+\u003c/sup\u003e\n  - `uov`\n\n## Running\n\n```rust\n/// # Example: Some signed KEX\n/// This protocol has no replay protection!\n///\nuse oqs::*;\nfn main() -\u003e Result\u003c()\u003e {\n    let sigalg = sig::Sig::new(sig::Algorithm::MlDsa44)?;\n    let kemalg = kem::Kem::new(kem::Algorithm::MlKem512)?;\n    // A's long-term secrets\n    let (a_sig_pk, a_sig_sk) = sigalg.keypair()?;\n    // B's long-term secrets\n    let (b_sig_pk, b_sig_sk) = sigalg.keypair()?;\n\n    // assumption: A has (a_sig_sk, a_sig_pk, b_sig_pk)\n    // assumption: B has (b_sig_sk, b_sig_pk, a_sig_pk)\n\n    // A -\u003e B: kem_pk, signature\n    let (kem_pk, kem_sk) = kemalg.keypair()?;\n    let signature = sigalg.sign(kem_pk.as_ref(), \u0026a_sig_sk)?;\n\n    // B -\u003e A: kem_ct, signature\n    sigalg.verify(kem_pk.as_ref(), \u0026signature, \u0026a_sig_pk)?;\n    let (kem_ct, b_kem_ss) = kemalg.encapsulate(\u0026kem_pk)?;\n    let signature = sigalg.sign(kem_ct.as_ref(), \u0026b_sig_sk)?;\n\n    // A verifies, decapsulates, now both have kem_ss\n    sigalg.verify(kem_ct.as_ref(), \u0026signature, \u0026b_sig_pk)?;\n    let a_kem_ss = kemalg.decapsulate(\u0026kem_sk, \u0026kem_ct)?;\n    assert_eq!(a_kem_ss, b_kem_ss);\n\n    Ok(())\n}\n```\n\n## Limitations and security\n\nliboqs is designed for prototyping and evaluating quantum-resistant cryptography. Security of proposed quantum-resistant algorithms may rapidly change as research advances, and may ultimately be completely insecure against either classical or quantum computers.\n\nWe believe that the NIST Post-Quantum Cryptography standardization project is currently the best avenue to identifying potentially quantum-resistant algorithms. liboqs does not intend to \"pick winners\", and we strongly recommend that applications and protocols rely on the outcomes of the NIST standardization project when deploying post-quantum cryptography.\n\nWe acknowledge that some parties may want to begin deploying post-quantum cryptography prior to the conclusion of the NIST standardization project. We strongly recommend that any attempts to do make use of so-called **hybrid cryptography**, in which post-quantum public-key algorithms are used alongside traditional public key algorithms (like RSA or elliptic curves) so that the solution is at least no less secure than existing traditional cryptography.\n\nJust like liboqs, liboqs-rust is provided \"as is\", without warranty of any kind. See [LICENSE-MIT](https://github.com/open-quantum-safe/liboqs-rust/blob/main/LICENSE-MIT) for the full disclaimer.\n\n## License\n\nliboqs-rust is dual-licensed under the MIT and Apache-2.0 licenses.\n\nThe included library `liboqs` is covered by the [`liboqs` license](https://github.com/open-quantum-safe/liboqs/blob/main/LICENSE.txt).\n\n## Team\n\nThe Open Quantum Safe project is led by [Douglas Stebila](https://www.douglas.stebila.ca/research/) and [Michele Mosca](http://faculty.iqc.uwaterloo.ca/mmosca/) at the University of Waterloo.\n\nliboqs-rust was developed by [Thom Wiggers](https://thomwiggers.nl) at Radboud University.\n\n### Support\n\nFinancial support for the development of Open Quantum Safe has been provided by Amazon Web Services and the Canadian Centre for Cyber Security.\n\nWe'd like to make a special acknowledgement to the companies who have dedicated programmer time to contribute source code to OQS, including Amazon Web Services, Cisco Systems, evolutionQ, IBM Research, and Microsoft Research.\n\nResearch projects which developed specific components of OQS have been supported by various research grants, including funding from the Natural Sciences and Engineering Research Council of Canada (NSERC); see the source papers for funding acknowledgments.\n\nThom Wiggers' contributions before May 2023 were supported by the European Research Council through Starting Grant No. 805031 (EPOQUE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopen-quantum-safe%2Fliboqs-rust","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopen-quantum-safe%2Fliboqs-rust","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopen-quantum-safe%2Fliboqs-rust/lists"}