Skip to content

Commit

Permalink
Wording adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
Tanner Davies committed Oct 26, 2023
1 parent e8b6ec3 commit cce8ef2
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "argon2-kdf"
version = "1.4.0"
version = "1.5.0"
edition = "2021"
readme = "Readme.md"
license = "MIT"
Expand Down
6 changes: 2 additions & 4 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,10 @@ To use argon2-kdf, add the following to your Cargo.toml:

```toml
[dependencies]
argon2-kdf = "1.4.0"
argon2-kdf = "1.5.0"
```

The original C implementation uses AVX to enhance execution speed. If you wish to disable AVX or make other fine adjustments to the compiler, you can set an environment variable containing a list of flags to be passed to the C compiler. This can be particularly useful when building an executable for air-gapped machines that lack support for the same features as the machine where the code is being compiled.

For instance, you can use the following command: `C_COMPILER_FLAGS="-mno-avx512f" cargo build` to disable AVX512F. If you want to pass more than one variable you can split them with `;`: `C_COMPILER_FLAGS="-mno-avx512f;-mno-avx2" cargo build`.
To pass build flags to the C compiler used to build the Argon2 library, you may add a semicolon-delimited list of flags to the `ARGON2_KDF_C_COMPILER_FLAGS` environment variable. For example, if you wish to disable the AVX optimizations that are on by default, you can do so with the following command: `ARGON2_KDF_C_COMPILER_FLAGS="-mno-avx512f;-mno-avx2" cargo build`.

# Examples

Expand Down
4 changes: 2 additions & 2 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ fn main() {
.flag("-std=c89")
.flag("-pthread");

if let Ok(compiler_flags) = std::env::var("C_COMPILER_FLAGS") {
for flag in compiler_flags.split(";").into_iter() {
if let Ok(compiler_flags) = std::env::var("ARGON2_KDF_C_COMPILER_FLAGS") {
for flag in compiler_flags.split(';') {
build = build.flag(flag);
}
}
Expand Down
2 changes: 1 addition & 1 deletion deployment-checklist.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Deployment Checklist

1. Run `cargo fmt`
1. Run `cargo fmt` and `cargo clippy`
2. Run `cargo test --release`
3. Update version in `Cargo.toml`
4. Update version in `Readme.md`
Expand Down
7 changes: 6 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,13 @@
//!
//! ```toml
//! [dependencies]
//! argon2-kdf = "1.4.0"
//! argon2-kdf = "1.5.0"
//! ```
//! To pass build flags to the C compiler used to build the Argon2 library, you may add a
//! semicolon-delimited list of flags to the `ARGON2_KDF_C_COMPILER_FLAGS` environment variable.
//! For example, if you wish to disable the AVX optimizations that are on by default, you can
//! build using the following command:
//! `ARGON2_KDF_C_COMPILER_FLAGS="-mno-avx512f;-mno-avx2" cargo build`.
//!
//! # Examples
//!
Expand Down

0 comments on commit cce8ef2

Please sign in to comment.