Sodium Oxide: Fast cryptographic library for Rust (bindings to libsodium)
Clone or download
3 authors Merge #239
239: Updated Argon2 Support r=Dylan-DPC a=kvnallsn

Based off the work @ccfb3ee765a58cae did for Argon2 support, but updated to work with the latest changes on the master branch.

This exposes libsodium's crypt_pwhash_argon2 functions, providing a rust API similar to sodiumoxide::crypto::pwhash::scryptsalsa208sha256::*

Co-authored-by: Kevin Allison <kvnallsn@gmail.com>
Co-authored-by: Roman <humbug@deeptown.org>
Latest commit 62288dc Nov 14, 2018

README.md

sodiumoxide

Build Status Appveyor Build Status Latest Version Docs Join the chat at https://gitter.im/rust-sodiumoxide/Lobby

NaCl (pronounced "salt") is a new easy-to-use high-speed software library for network communication, encryption, decryption, signatures, etc. NaCl's goal is to provide all of the core operations needed to build higher-level cryptographic tools. Of course, other libraries already exist for these core operations. NaCl advances the state of the art by improving security, by improving usability, and by improving speed.

Sodium is a portable, cross-compilable, installable, packageable fork of NaCl (based on the latest released upstream version nacl-20110221), with a compatible API.

This package aims to provide a type-safe and efficient Rust binding that's just as easy to use.

Dependencies

Clang >= 3.9

Libsodium 1.0.16 (installation)

pkg-config (OSX: brew install pkg-config)

Building

cargo build

Testing

cargo test

Documentation

cargo doc

Documentation will be generated in target/doc/...

Most documentation is taken from NaCl, with minor modification where the API differs between the C and Rust versions.

Optional features

Several optional features are available:

  • std (default: enabled). When this feature is disabled, sodiumoxide builds using #![no_std]. Some functionality may be lost. Requires a nightly build of Rust.

  • serde (default: enabled). Allows serialization and deserialization of keys, authentication tags, etc. using the serde library.

  • benchmarks (default: disabled). Compile benchmark tests. Requires a nightly build of Rust.

Examples

TBD

Platform Compatibiility

Sodiumoxide has been tested on:

  • Linux: Yes
  • Windows: Yes (MSVC)
  • Mac OS:
  • IOS:
  • Android:

Using vcpkg

To build sodiumoxide using libsodium from vcpkg, you have to add either VCPKGRS_DYNAMIC=1 (for dynamic linking) or RUSTFLAGS=-Ctarget-feature=+crt-static (for static linking) to environment variables.

Regardless of the OS, to link libsodium statically you also need to set SODIUM_STATIC environment variable.

Join in

File bugs in the issue tracker

Master git repository

git clone https://github.com/sodiumoxide/sodiumoxide.git

License

Licensed under either of

at your option.

Contribution

Go through the CONTRIBUTING.md document to know more about how to contribute to this project.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Code of Conduct

We believe in creating an enabling community for developers and have laid out a general code of conduct. Please read and adopt it to help us achieve and maintain the desired community standards.