commit_hash
stringlengths
40
40
author
stringlengths
1
57
date
timestamp[s]date
2010-07-26 04:45:09
2026-04-14 18:21:10
message
stringlengths
8
1.39M
diff
stringlengths
68
51.2k
files_changed
int64
1
136
insertions
int64
0
2.35k
deletions
int64
0
1.9k
43344c69051f496d8a936c3957decc62b86e62ac
Tony Arcieri
2025-11-06T19:55:45
yescrypt v0.1.0-rc.0 (#743)
diff --git a/Cargo.lock b/Cargo.lock index 8264ede..c58b9e6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -548,7 +548,7 @@ checksum = "f17a85883d4e6d00e8a97c586de764dabcc06133f7f1d55dce5cdc070ad7fe59" [[package]] name = "yescrypt" -version = "0.1.0-pre.4" +version = "0.1.0-rc.0" dependencies = [ "hex-literal", "...
3
4
4
4331d51b6a0c69a4f7323953c45af13516df3437
Tony Arcieri
2025-11-06T19:49:12
scrypt v0.12.0-rc.3 (#741)
diff --git a/Cargo.lock b/Cargo.lock index 39bc626..8264ede 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -406,7 +406,7 @@ dependencies = [ [[package]] name = "scrypt" -version = "0.12.0-rc.2" +version = "0.12.0-rc.3" dependencies = [ "password-hash", "pbkdf2", diff --git a/scrypt/Cargo.toml b/scrypt/Cargo.toml ...
2
2
2
26823413f04cc4ca5e03575f20fe6ffb7821b51e
Tony Arcieri
2025-11-06T19:49:02
yescrypt: use `subtle` for password hash comparisons (#742) For rationale, see: https://docs.rs/password-hash/0.6.0-rc.2/password_hash/struct.Output.html#constant-time-comparisons
diff --git a/Cargo.lock b/Cargo.lock index 62d4424..39bc626 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -556,6 +556,7 @@ dependencies = [ "pbkdf2", "salsa20", "sha2", + "subtle", ] [[package]] diff --git a/yescrypt/Cargo.toml b/yescrypt/Cargo.toml index 2bb2ab6..f967dd0 100644 --- a/yescrypt/Cargo.toml +++ b/...
3
3
2
47c5308f1dd02688fe61f56cf74b6abcd1e7617f
Tony Arcieri
2025-11-06T00:15:38
argon2 v0.6.0-rc.2 (#740)
diff --git a/Cargo.lock b/Cargo.lock index 49788cb..62d4424 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,7 +4,7 @@ version = 4 [[package]] name = "argon2" -version = "0.6.0-rc.1" +version = "0.6.0-rc.2" dependencies = [ "base64ct", "blake2", diff --git a/argon2/Cargo.toml b/argon2/Cargo.toml index 915bf8c..a...
2
5
5
d58af7f4ee09b91d7318e36319c62c738a2b2bb0
Tony Arcieri
2025-11-05T23:20:56
Cut `pre.2` prereleases of `*pbkdf*` crates (#738) Cuts the following prereleases: - `bcrypt-pbkdf` v0.11.0-rc.2 - `pbkdf2` v0.13.0-rc.2
diff --git a/Cargo.lock b/Cargo.lock index d72b9cb..49788cb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -43,7 +43,7 @@ checksum = "55248b47b0caf0546f7988906588779981c43bb1bc9d0c44087278f80cdb44ba" [[package]] name = "bcrypt-pbkdf" -version = "0.11.0-rc.1" +version = "0.11.0-rc.2" dependencies = [ "blowfish", "...
3
5
5
8785ea435b1e576d71bc58a7da4fd9899ccaa107
Artyom Pavlov
2025-11-05T23:20:39
argon2: migrate from the variable output traits (#739) Closes #736
diff --git a/Cargo.lock b/Cargo.lock index 7cb2e3f..d72b9cb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -71,7 +71,8 @@ dependencies = [ [[package]] name = "blake2" version = "0.11.0-rc.3" -source = "git+https://github.com/RustCrypto/hashes?branch=blake2%2Frestore-blake-var#23e8c1296de00e3abfe39bf614fb1d56df90de0d" +...
3
29
37
4ff18e99f6c54ed1b616574d82112e6443741e72
Sebastian Messmer
2025-10-28T16:10:50
Parallelize scrypt with rayon (#733) Implements https://github.com/RustCrypto/password-hashes/issues/79 If `p>1`, then the different RoMix blocks are calculated in parallel, using Rayon. # Benchmarks ## without `rayon` feature ``` test scrypt_17_2_4 ... bench: 270,342,994.10 ns/iter (+/- 37,060,120.60) test scrypt_1...
diff --git a/Cargo.lock b/Cargo.lock index 4c45194..e0d75bb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -419,6 +419,7 @@ version = "0.12.0-rc.2" dependencies = [ "password-hash", "pbkdf2", + "rayon", "salsa20", "sha2", ] diff --git a/scrypt/Cargo.toml b/scrypt/Cargo.toml index 7622727..295fe4d 100644 --- a/sc...
4
40
6
6d3bd17429a99f23f387a2fc7c597cb5bc47d844
Jean-Marie Lemetayer
2025-10-22T15:54:11
sha-crypt: implement `Error` for `CheckError` (#732) Closes #731
diff --git a/sha-crypt/src/errors.rs b/sha-crypt/src/errors.rs index 71c3c68..0cfd5f4 100644 --- a/sha-crypt/src/errors.rs +++ b/sha-crypt/src/errors.rs @@ -58,6 +58,20 @@ pub enum CheckError { HashMismatch, } +#[cfg(feature = "simple")] +impl core::error::Error for CheckError {} + +#[cfg(feature = "simple")] +...
1
14
0
697b2076e1fb5f9468b2ecc173ed76924538c4fb
Tony Arcieri
2025-10-20T16:32:59
sha-crypt: extract `simple` module (#729) Moves all functionality in the feature-gated `simple` API into its own module, which eliminates the need for a lot of gating, and means the "pure" functions sit in lib.rs without additional complications related to MCF encoding/decoding.
diff --git a/sha-crypt/src/b64.rs b/sha-crypt/src/b64.rs deleted file mode 100644 index dbca743..0000000 --- a/sha-crypt/src/b64.rs +++ /dev/null @@ -1,31 +0,0 @@ -//! Base64 encoding support - -#![cfg(feature = "simple")] - -use crate::{ - consts::{BLOCK_SIZE_SHA256, BLOCK_SIZE_SHA512, MAP_SHA256, MAP_SHA512, PW_SI...
3
258
265
5d0369c2fbcf11f9359740e0e18304901e93827d
Tony Arcieri
2025-10-20T16:22:18
sha-crypt: simplify Base64 encoding (#728) Composes the "simple" MCF API in terms of the existing Base64 APIs, and factors the Base64 encoding functions into those Base64 APIs.
diff --git a/sha-crypt/Cargo.toml b/sha-crypt/Cargo.toml index a22c8c0..723e45f 100644 --- a/sha-crypt/Cargo.toml +++ b/sha-crypt/Cargo.toml @@ -18,7 +18,7 @@ rust-version = "1.85" [dependencies] sha2 = { version = "0.11.0-rc.2", default-features = false } -base64ct = { version = "1.7.1", default-features = false }...
4
29
81
0ae86aa06bf255abbf6dab68ac0a014fae6a3a0d
Tony Arcieri
2025-10-20T15:53:15
sha-crypt: use `mcf` crate (#726) Begins an initial integration of using the `mcf` crate for the purposes of constructing strings in Modular Crypt Format.
diff --git a/Cargo.lock b/Cargo.lock index 7bc9cb9..7102251 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -428,6 +428,7 @@ name = "sha-crypt" version = "0.6.0-pre.1" dependencies = [ "base64ct", + "mcf", "rand_core", "sha2", "subtle", diff --git a/sha-crypt/Cargo.toml b/sha-crypt/Cargo.toml index 21b1cfe..a22c8...
4
38
35
32249a6fcab21103d17ff900edd1cc9b4dbbafba
Tony Arcieri
2025-10-20T15:29:22
sha-crypt: rename `defs` => `consts` (#725) Renames the internal module that defines various constants
diff --git a/sha-crypt/src/b64.rs b/sha-crypt/src/b64.rs index 1f6232c..a96ecfa 100644 --- a/sha-crypt/src/b64.rs +++ b/sha-crypt/src/b64.rs @@ -1,6 +1,6 @@ //! Base64 encoding support -use crate::defs::{ +use crate::consts::{ BLOCK_SIZE_SHA256, BLOCK_SIZE_SHA512, MAP_SHA256, MAP_SHA512, PW_SIZE_SHA256, PW_SIZE...
3
4
4
1405af925c0e990c78df5019aeecb29635193fa3
Tony Arcieri
2025-10-20T15:27:15
sha-crypt: export `CheckError` (#724) Closes #722
diff --git a/sha-crypt/src/errors.rs b/sha-crypt/src/errors.rs index 0ff573d..71c3c68 100644 --- a/sha-crypt/src/errors.rs +++ b/sha-crypt/src/errors.rs @@ -44,11 +44,17 @@ impl fmt::Display for CryptError { } } +/// Errors which occur when verifying passwords. #[cfg(feature = "simple")] #[derive(Debug)] pub...
2
10
1
00cfbc27126dbbaa9cbd9acad879a698ee0d2b53
Tony Arcieri
2025-10-20T15:10:21
yescrypt: `mcf` simplification (#723) Uses `push_str` to add params
diff --git a/yescrypt/src/lib.rs b/yescrypt/src/lib.rs index c403c71..1ff3990 100644 --- a/yescrypt/src/lib.rs +++ b/yescrypt/src/lib.rs @@ -109,8 +109,7 @@ pub fn yescrypt(passwd: &[u8], salt: &[u8], params: &Params) -> Result<String> { // Add params string to the hash let mut params_buf = [0u8; Params::MAX_...
1
2
3
272a1252e6f39e8bf0ab094a301a2e7a734f29ec
Tony Arcieri
2025-10-16T00:29:47
sha-crypt: switch from `rand` to `rand_core` (#720) Replaces the use of `Distribution` by first filling a buffer with random bytes, then encoding it as Base64. It seems the Base64 encoding is directly consumed by the algorithm, or otherwise it would probably make sense to convert all usages of `salt` to be raw bytes....
diff --git a/Cargo.lock b/Cargo.lock index 12e7229..5c4cc69 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -334,15 +334,6 @@ dependencies = [ "streebog", ] -[[package]] -name = "ppv-lite86" -version = "0.2.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85eae3c4ed2f50dcfe72643da4bef...
4
15
90
8381055887fbd27620dff0311215871752a145ee
Tony Arcieri
2025-10-15T21:36:38
sha-crypt: remove `std` feature; add `core::error::Error` impls (#719) The `std` feature was previously unused, while `core::error::Error` allows the error trait to be impl'd without a `std` dependency
diff --git a/sha-crypt/Cargo.toml b/sha-crypt/Cargo.toml index 1ab71a4..291de48 100644 --- a/sha-crypt/Cargo.toml +++ b/sha-crypt/Cargo.toml @@ -26,8 +26,7 @@ base64ct = "1.7.1" [features] default = ["simple"] -simple = ["rand", "std", "subtle"] -std = [] +simple = ["rand", "subtle"] [package.metadata.docs.rs] ...
4
31
21
d06c084a8c02dd18d4bdbcc694c0aa266898dda3
Tony Arcieri
2025-10-15T12:35:21
Switch from `doc_auto_cfg` to `doc_cfg` (#718) See RustCrypto/traits#2028
diff --git a/argon2/src/lib.rs b/argon2/src/lib.rs index 5ab7f3e..cb6cb65 100644 --- a/argon2/src/lib.rs +++ b/argon2/src/lib.rs @@ -1,5 +1,5 @@ #![no_std] -#![cfg_attr(docsrs, feature(doc_auto_cfg))] +#![cfg_attr(docsrs, feature(doc_cfg))] #![doc = include_str!("../README.md")] #![doc( html_logo_url = "https:/...
7
7
7
f50f7728c7f5c149358fc5ae85d2b0d87a316e07
Tony Arcieri
2025-10-15T01:34:28
yescrypt v0.1.0-pre.4 (#717)
diff --git a/Cargo.lock b/Cargo.lock index a555c8c..12e7229 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -607,7 +607,7 @@ checksum = "f17a85883d4e6d00e8a97c586de764dabcc06133f7f1d55dce5cdc070ad7fe59" [[package]] name = "yescrypt" -version = "0.1.0-pre.3" +version = "0.1.0-pre.4" dependencies = [ "hex-literal", ...
2
2
2
517fcacc9063d0a077707c4506a44cc784ac9a65
Tony Arcieri
2025-10-15T01:13:18
yescrypt: make `Params` explicit in rustdoc (#715)
diff --git a/yescrypt/src/lib.rs b/yescrypt/src/lib.rs index 241c9d7..8cf0de1 100644 --- a/yescrypt/src/lib.rs +++ b/yescrypt/src/lib.rs @@ -31,7 +31,8 @@ //! # fn main() -> yescrypt::Result<()> { //! let password = b"pleaseletmein"; // don't actually use this as a password! //! let salt = b"WZaPV7LSUEKMo34."; // un...
1
4
2
fe6cf2a1c2f9e8f7ca0fedfa36a293aeb37cd09b
Tony Arcieri
2025-10-14T23:38:39
yescrypt: move `encoding` module into `params` (#714) The functions are effectively an implementation detail of the params encoder/decoder at this point, so it's simpler for refactoring to just have everything in one module. Ideally these functions could simply be replaced with `Base64ShaCrypt`, but before that some ...
diff --git a/yescrypt/src/encoding.rs b/yescrypt/src/encoding.rs deleted file mode 100644 index 8003988..0000000 --- a/yescrypt/src/encoding.rs +++ /dev/null @@ -1,112 +0,0 @@ -//! Support for encoding (s)crypt-flavored Base64. -//! -//! We mostly leverage the `base64ct` crate for this, however these functions are stil...
3
106
114
e63a4bc8ab570f5d7bac06927c502dc70376a60d
Tony Arcieri
2025-10-14T22:45:49
yescrypt: use `base64ct` via the `mcf` crate (#713) Leverages the `Base64ShaCrypt` encoding from the `base64ct` crate in place of the translated implementation from the reference implementation
diff --git a/yescrypt/Cargo.toml b/yescrypt/Cargo.toml index 72f2ea6..0a62ce0 100644 --- a/yescrypt/Cargo.toml +++ b/yescrypt/Cargo.toml @@ -20,7 +20,7 @@ salsa20 = { version = "0.11.0-rc.1", default-features = false } sha2 = { version = "0.11.0-rc.2", default-features = false } # optional dependencies -mcf = { ver...
3
23
145
0eb7441af258c5d6592281b5b46ab39796a69e1e
Tony Arcieri
2025-10-14T18:53:56
yescrypt: encoding test vectors (#712) Adds some very simple smoke tests for yescrypt-flavored Base64
diff --git a/yescrypt/src/encoding.rs b/yescrypt/src/encoding.rs index a9f5fa5..c43c6ba 100644 --- a/yescrypt/src/encoding.rs +++ b/yescrypt/src/encoding.rs @@ -197,3 +197,36 @@ pub(crate) fn encode64_uint32(dst: &mut [u8], mut src: u32, min: u32) -> Result< Ok(pos) } + +#[cfg(feature = "simple")] +#[cfg(test)]...
1
33
0
f39f75982e17da054cf424c7dbbe483a0c689e20
Артём Павлов [Artyom Pavlov]
2025-10-13T05:10:46
Update Cargo.lock
diff --git a/Cargo.lock b/Cargo.lock index d7a3aa0..a555c8c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -244,9 +244,9 @@ dependencies = [ [[package]] name = "inout" -version = "0.2.0-rc.6" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1603f76010ff924b616c8f44815a4...
1
4
4
9cb2c29f2800087cffa01a5e6452fcb2a36256eb
Артём Павлов [Artyom Pavlov]
2025-10-06T06:40:58
Update Cargo.lock
diff --git a/Cargo.lock b/Cargo.lock index 0253ddb..d7a3aa0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -167,9 +167,9 @@ checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" [[package]] name = "crypto-bigint" -version = "0.7.0-rc.7" +version = "0.7.0-rc.8" source = "registry+https://github...
1
13
12
fa5248580a6b7c75cd637ad254dae51bb4bba05c
Артём Павлов [Artyom Pavlov]
2025-09-22T06:06:10
Update Cargo.lock
diff --git a/Cargo.lock b/Cargo.lock index 8b6cb58..8767248 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -187,9 +187,9 @@ dependencies = [ [[package]] name = "digest" -version = "0.11.0-rc.1" +version = "0.11.0-rc.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a4aae35a0fcbe22ff1be...
1
24
24
63bced684aeb843709465435311d4d70b9527ff8
Tony Arcieri
2025-09-11T18:41:48
yescrypt: replace `reshape_block` with `(slice_)as_chunks_mut` (#705) Replaces an unsafe pointer cast with (our polyfill for) the `core` method `as_chunks_mut` (MSRV 1.88, but we ship our own version for now to support Rust 1.85).
diff --git a/yescrypt/src/pwxform.rs b/yescrypt/src/pwxform.rs index 24c7bca..d68c5f5 100644 --- a/yescrypt/src/pwxform.rs +++ b/yescrypt/src/pwxform.rs @@ -101,7 +101,8 @@ impl PwxformCtx<'_> { /// Transform the provided block using the provided S-boxes. fn pwxform(&mut self, b: &mut [u32; 16]) { - ...
1
8
19
c60477009926400d636703b072ea2f92f88e6273
Tony Arcieri
2025-09-10T22:43:27
yescrypt: enable `clippy::cast_possible_truncation` (#704) Fixes offenses, either by masking to show that truncation is expected, using `TryFrom` and `?` to convert to `Error::Internal` if the conversion fails, or starting with a narrower type and widening instead of trying to go the other direction.
diff --git a/yescrypt/src/encoding.rs b/yescrypt/src/encoding.rs index 5b5a9a7..a9f5fa5 100644 --- a/yescrypt/src/encoding.rs +++ b/yescrypt/src/encoding.rs @@ -12,9 +12,9 @@ static ITOA64: &[u8] = b"./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopq /// Reverse lookup table for (s)crypt-flavored Base64 alphabet....
5
25
18
3534279bb438de6cac2370c946e5a5809804b654
Tony Arcieri
2025-09-10T17:55:14
balloon-hash v0.5.0-rc.0 (#703)
diff --git a/Cargo.lock b/Cargo.lock index 21157be..fef04be 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -23,7 +23,7 @@ checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" [[package]] name = "balloon-hash" -version = "0.5.0-pre.1" +version = "0.5.0-rc.0" dependencies = [ "crypto-bigint",...
2
2
2
dd15f840b34e43440b0514d8ac8a52a0eefd0e71
daxpedda
2025-09-09T23:28:36
pbkdf2: remove unnecessary bounds (#700)
diff --git a/pbkdf2/src/lib.rs b/pbkdf2/src/lib.rs index 67f7b6d..6550061 100644 --- a/pbkdf2/src/lib.rs +++ b/pbkdf2/src/lib.rs @@ -102,14 +102,7 @@ use rayon::prelude::*; use digest::{FixedOutput, InvalidLength, KeyInit, Update, typenum::Unsigned}; #[cfg(feature = "hmac")] -use { - digest::{ - HashMarke...
1
3
14
6c830541ad584e8581a716261aa5451054ecfc80
Tony Arcieri
2025-09-09T20:25:41
yescrypt: fixes for `clippy::cast_lossless` (#699) These were all auto-applied via `cargo clippy --fix`
diff --git a/yescrypt/src/encoding.rs b/yescrypt/src/encoding.rs index 85f798b..5b5a9a7 100644 --- a/yescrypt/src/encoding.rs +++ b/yescrypt/src/encoding.rs @@ -36,7 +36,7 @@ pub(crate) fn decode64<'o>(src: &str, dst: &'o mut [u8]) -> Result<&'o [u8]> { _ => return Err(Error::Encoding), };...
5
24
24
3270be770c165de69f319cfac708c3b05f6aed8b
Tony Arcieri
2025-09-09T19:33:32
yescrypt: warn for `clippy::unwrap_used` (#698) Replaces usages of `unwrap` with `Error::Internal`
diff --git a/yescrypt/src/error.rs b/yescrypt/src/error.rs index d7f5d5b..b5e5dc3 100644 --- a/yescrypt/src/error.rs +++ b/yescrypt/src/error.rs @@ -1,6 +1,6 @@ //! Error type. -use core::fmt; +use core::{fmt, num::TryFromIntError}; /// Result type for the `yescrypt` crate with its [`Error`] type. pub type Resul...
4
58
44
a6d3fef93ca8eb49f6147e410a00d2c4d9e69228
Tony Arcieri
2025-09-09T18:59:04
yescrypt v0.1.0-pre.3 (#697)
diff --git a/Cargo.lock b/Cargo.lock index 07a2261..fe3065e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -591,7 +591,7 @@ checksum = "5c573471f125075647d03df72e026074b7203790d41351cd6edc96f46bcccd36" [[package]] name = "yescrypt" -version = "0.1.0-pre.2" +version = "0.1.0-pre.3" dependencies = [ "hex-literal", ...
7
31
9
6d28fbaa9a53fee519a2b9d5a759b49ea1a8718a
Tony Arcieri
2025-09-09T18:35:54
yescrypt: replace `Flags` with `Mode` (#696) As proposed in #694, this replaces the C-derived bitflags with a much simpler `Mode` enum for selecting between the three modes yescrypt offers: classic scrypt, write-once/read-many, and read-write. This eliminates many possible misconfigurations, including trying to use t...
diff --git a/yescrypt/src/flags.rs b/yescrypt/src/flags.rs deleted file mode 100644 index 85c8281..0000000 --- a/yescrypt/src/flags.rs +++ /dev/null @@ -1,187 +0,0 @@ -//! Algorithm flags. - -use crate::{Error, Result}; -use core::ops::{BitAnd, BitAndAssign, BitOr, BitOrAssign}; - -/// Mode mask value -const MODE_MASK:...
7
170
292
e22e9c5b20eb7e445f45254f73f7b8a26186a702
Tony Arcieri
2025-09-09T15:13:31
yescrypt: move prehashing out-of-band from `Flags` (#695) Changes it to an explicit parameter of `yescrypt_kdf_body`
diff --git a/yescrypt/src/flags.rs b/yescrypt/src/flags.rs index 8fe3047..85c8281 100644 --- a/yescrypt/src/flags.rs +++ b/yescrypt/src/flags.rs @@ -41,10 +41,6 @@ impl Flags { /// Flavor: SBox 12k pub const SBOX_12K: Self = Self(0x080); - /// Prehash - // TODO(tarcieri): move this out-of-band from `F...
2
13
21
ea2c74e8b64fb9647452d98dc27204d122f23e5a
Tony Arcieri
2025-09-09T01:41:06
yescrypt: add todo about PREHASH flag
diff --git a/yescrypt/src/flags.rs b/yescrypt/src/flags.rs index 75762ca..99e22ea 100644 --- a/yescrypt/src/flags.rs +++ b/yescrypt/src/flags.rs @@ -36,6 +36,7 @@ impl Flags { pub const SBOX_12K: Self = Self(0x080); /// Prehash + // TODO(tarcieri): move this out-of-band from `Flags`? Or actually make it ...
1
1
0
e8d1d353b96ea3856a4284c897b6f4f371730c2e
Tony Arcieri
2025-09-09T01:38:01
yescrypt: improve Flags comments
diff --git a/yescrypt/src/flags.rs b/yescrypt/src/flags.rs index 437b3b4..75762ca 100644 --- a/yescrypt/src/flags.rs +++ b/yescrypt/src/flags.rs @@ -14,25 +14,25 @@ const RW_FLAVOR_MASK: u32 = 0x3fc; pub struct Flags(pub(crate) u32); impl Flags { - /// Empty flags (represents `scrypt` classic) + /// Empty fla...
1
7
7
360cbcf634fea97554adef7d683067d9a88cf661
Tony Arcieri
2025-09-09T01:37:12
yescrypt: refactor `Flags` to remove `bitflags` dependency (#690) Pares the `Flags` type down to the minimum that is actually needed. Moves flags-related functionality into the `Flags` type (notably computing the "flavor" `u32`) and adds some smoke tests.
diff --git a/Cargo.lock b/Cargo.lock index 6d2ecd9..69e7a0a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -68,12 +68,6 @@ dependencies = [ "digest", ] -[[package]] -name = "bitflags" -version = "2.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2261d10cca569e4643e526d8dc2e62e433cc...
7
195
81
1d4eefa775c2aaa5235a77c8a4b9fe6ae4c06245
Tony Arcieri
2025-09-08T22:52:56
yescrypt: add `yescrypt_verify` function (#689) Adds a function for verifying a password hash string which can parse the flavor/params from the password hash string and use it when computing a password hash to verify. This also translates the `decode64` function from the yescrypt reference C implementation.
diff --git a/yescrypt/src/encoding.rs b/yescrypt/src/encoding.rs index ac6bc6f..984612e 100644 --- a/yescrypt/src/encoding.rs +++ b/yescrypt/src/encoding.rs @@ -18,6 +18,49 @@ pub const ATOI64: [u8; 128] = { tbl }; +pub(crate) fn decode64<'o>(src: &str, dst: &'o mut [u8]) -> Result<&'o [u8]> { + let src = sr...
4
149
35
6db85752f7605ea8cf9b80e4b4a57b0e4048e4d2
Tony Arcieri
2025-09-08T22:12:19
yescrypt: eager `Params` validation (#688) Moves the logic for validating parameters to the `Params` type, preventing it from being constructed at all with values that will be later rejected
diff --git a/yescrypt/src/lib.rs b/yescrypt/src/lib.rs index 06790f9..10772ca 100644 --- a/yescrypt/src/lib.rs +++ b/yescrypt/src/lib.rs @@ -36,8 +36,7 @@ //! ``` //! //! ## Key Derivation Function (KDF) -#![cfg_attr(feature = "simple", doc = "```")] -#![cfg_attr(not(feature = "simple"), doc = "```ignore")] +//! ```...
4
120
165
09c5d1c8c608107551535bf2efdf5820e09bedab
Tony Arcieri
2025-09-08T21:52:12
yescrypt: error enum (#687) Adds an initial error enum with variants for `Encoding` and `Params`. This is an initial conversion to an enum, and ideally we'd have more fine-grained variants than this which can report more precisely which parameters were incorrect.
diff --git a/yescrypt/src/encoding.rs b/yescrypt/src/encoding.rs index cbe9abe..ac6bc6f 100644 --- a/yescrypt/src/encoding.rs +++ b/yescrypt/src/encoding.rs @@ -18,21 +18,21 @@ pub const ATOI64: [u8; 128] = { tbl }; -pub(crate) fn decode64_uint32(src: &[u8], mut pos: usize, min: u32) -> Option<(u32, usize)> { +...
4
61
51
e02b633e3837fc453ee4c58ce5ae8d3230dd97b5
Tony Arcieri
2025-09-08T19:53:13
yescrypt: add comment
diff --git a/yescrypt/src/lib.rs b/yescrypt/src/lib.rs index bcc14be..41185e2 100644 --- a/yescrypt/src/lib.rs +++ b/yescrypt/src/lib.rs @@ -147,6 +147,7 @@ pub fn yescrypt_kdf(passwd: &[u8], salt: &[u8], params: &Params, out: &mut [u8]) &mut dk, )?; + // Use derived key as the "password"...
1
1
0
4f573972d57cbbcdcda6037a2de642dd3dcad216
Tony Arcieri
2025-09-08T19:51:28
yescrypt: remove preallocation (#686) Removes the `SHARED_PREALLOCATED`, `INIT_SHARED`, and `ALLOC_ONLY` flags and the functionality associated with them. It's unclear if it was correctly implemented or useful, and not tested. This simplifies the implementation until such functionality can be added back properly and ...
diff --git a/yescrypt/src/flags.rs b/yescrypt/src/flags.rs index 0f35a2d..35181cd 100644 --- a/yescrypt/src/flags.rs +++ b/yescrypt/src/flags.rs @@ -25,21 +25,12 @@ bitflags::bitflags! { /// SBox 12k const SBOX_12K = 0x080; - /// Use shared preallocated memory - const SHARED_PREALLOCAT...
3
16
67
527f7a8f9d1737fe1b3ec7b524b27d490d75bfad
Tony Arcieri
2025-09-08T19:32:34
yescrypt v0.1.0-pre.1 (#685)
diff --git a/Cargo.lock b/Cargo.lock index 43393b5..6d2ecd9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -597,7 +597,7 @@ checksum = "5c573471f125075647d03df72e026074b7203790d41351cd6edc96f46bcccd36" [[package]] name = "yescrypt" -version = "0.1.0-pre.0" +version = "0.1.0-pre.1" dependencies = [ "bitflags", "he...
2
2
2
7562cb9512bfed3da44a2bd86ff5906d7a9a5a56
Tony Arcieri
2025-09-08T19:26:44
yescrypt: fix miscomputed outputs (#684) There were a few regressions introduced in the recent translation which were not caught by the KATs or review. The first was in 763d6f6 (mea culpa), which rewrote `wrapping_*` arithmetic using standard infix operators which apply checked arithmetic in debug. Notably in this co...
diff --git a/yescrypt/src/lib.rs b/yescrypt/src/lib.rs index 175280d..580d4d5 100644 --- a/yescrypt/src/lib.rs +++ b/yescrypt/src/lib.rs @@ -136,13 +136,30 @@ pub fn yescrypt_kdf(passwd: &[u8], salt: &[u8], params: &Params, out: &mut [u8]) return Err(Error); } - if params.flags.contains(Flags::RW) + ...
3
40
13
ec526447107ce2ca024213e54569bfc871b7ee18
Tony Arcieri
2025-09-08T14:56:19
yescrypt: params decoder (#683) Add a decoder for yescrypt params strings, translated from the reference C implementation (namely the `yescrypt_r` function from `yescrypt-common.c`)
diff --git a/yescrypt/src/encoding.rs b/yescrypt/src/encoding.rs index 7d4cb12..cbe9abe 100644 --- a/yescrypt/src/encoding.rs +++ b/yescrypt/src/encoding.rs @@ -7,6 +7,64 @@ use core::str; /// (s)crypt-flavored Base64 alphabet. static ITOA64: &[u8] = b"./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"...
2
228
13
6088525ff4dccb5e68c6642e648da98695099ba0
Tony Arcieri
2025-09-07T23:31:08
yescrypt: add note about RustCrypto/password-hashes#680
diff --git a/yescrypt/tests/simple.rs b/yescrypt/tests/simple.rs index 21ccaed..1a7b0e6 100644 --- a/yescrypt/tests/simple.rs +++ b/yescrypt/tests/simple.rs @@ -40,7 +40,7 @@ fn yescrypt_reference_test() { for (i, &expected_hash) in EXAMPLE_HASHES.iter().enumerate() { let i = i as u32; - // TODO(...
1
1
1
1e948e222955ef605e138b53a494ea98516ce4c6
Tony Arcieri
2025-09-07T23:27:21
yescrypt: additional test vectors (#679) Adds test vectors from the yescrypt reference C implementation: https://github.com/openwall/yescrypt/blob/caa931d/TESTS-OK#L31-L66 One seems to be failing, as noted in the comments
diff --git a/yescrypt/tests/simple.rs b/yescrypt/tests/simple.rs index 154d168..21ccaed 100644 --- a/yescrypt/tests/simple.rs +++ b/yescrypt/tests/simple.rs @@ -13,19 +13,48 @@ fn yescrypt_reference_test() { // Don't use this as a real password!!! const EXAMPLE_PASSWD: &[u8] = b"pleaseletmein"; const EXA...
1
32
3
e52f340acb772d26485d32663587250859d8746b
Tony Arcieri
2025-09-07T21:15:49
yescrypt: basic usage documentation (#676)
diff --git a/yescrypt/src/lib.rs b/yescrypt/src/lib.rs index da87317..175280d 100644 --- a/yescrypt/src/lib.rs +++ b/yescrypt/src/lib.rs @@ -21,6 +21,33 @@ unused_qualifications )] +//! # Usage +//! ## Password Hashing +//! NOTE: the `simple` crate feature must be enabled (on-by-default) +#![cfg_attr(feature = ...
1
27
0
e6a2246484d3d3b5fb1c7fca5380fae68783df81
Tony Arcieri
2025-09-07T20:57:33
yescrypt: bump `mcf` to v0.2 (#674)
diff --git a/Cargo.lock b/Cargo.lock index edf3824..67ad90f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -280,8 +280,9 @@ checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" [[package]] name = "mcf" -version = "0.2.0-pre" -source = "git+https://github.com/RustCrypto/formats#2c1292202175a598...
3
4
6
521b9c9e45aa0c50e54ada73355670bef574544e
Tony Arcieri
2025-09-07T20:05:37
yescrypt: "simple" API (#673) Adds a new crate feature `simple` (on-by-default) which implements initial support for an API which computes password hash strings in Modular Crypt Format (MCF), with a leading `$y$` prefix. This adapts the Base64 encoding from the yescrypt reference implementation, as for whatever reaso...
diff --git a/Cargo.lock b/Cargo.lock index ba3161a..edf3824 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -278,6 +278,14 @@ version = "0.4.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" +[[package]] +name = "mcf" +vers...
9
427
274
94ad2d20be42e706c67a6a2c74e40ca3b2b2fe3f
Conrad Ludgate
2025-09-07T15:57:38
yescrypt: use safe crypto functions (#671) Work through the remaining crypto functions to use only slices
diff --git a/yescrypt/src/lib.rs b/yescrypt/src/lib.rs index a12586d..8534a29 100644 --- a/yescrypt/src/lib.rs +++ b/yescrypt/src/lib.rs @@ -21,7 +21,7 @@ unused_qualifications )] // Temporary lint overrides while C code is being translated -#![allow(clippy::too_many_arguments, unsafe_op_in_unsafe_fn)] +#![allow...
5
131
224
569275004a59425c1c4e317d20b5c4da053ce5c8
Tony Arcieri
2025-09-06T17:59:54
yescrypt: add `Params::encode` (#669) Initial support for encoding parameters for Modular Crypt Format strings. This adapts the reference C code for encoding params from the `yescrypt_encode_params_r` function. It currently optimizes for closeness to the original C over making the code more idiomatic. Notably the po...
diff --git a/yescrypt/src/params.rs b/yescrypt/src/params.rs index 8743477..c465af7 100644 --- a/yescrypt/src/params.rs +++ b/yescrypt/src/params.rs @@ -1,5 +1,7 @@ //! Algorithm parameters. +mod encoding; + bitflags::bitflags! { /// Flags for controlling the operation of `yescrypt`. #[derive(Clone, Copy,...
2
222
0
7cd26f38be3b52a84aea9c9ae6e9ad8fb06eed30
Tony Arcieri
2025-09-05T21:02:39
yescrypt: factor apart `common` module (#668) Replaces it with standard library features
diff --git a/yescrypt/src/common.rs b/yescrypt/src/common.rs deleted file mode 100644 index ea8fbe4..0000000 --- a/yescrypt/src/common.rs +++ /dev/null @@ -1,32 +0,0 @@ -pub(crate) unsafe fn blkcpy(dst: *mut u32, src: *const u32, count: usize) { - dst.copy_from(src, count); -} - -pub(crate) unsafe fn blkxor(dst: *mu...
6
52
63
6a9be5216f3045de5902cd01b14f40b781639497
Tony Arcieri
2025-09-05T20:41:46
yescrypt: make all `smix` args into slices (#667)
diff --git a/yescrypt/src/lib.rs b/yescrypt/src/lib.rs index 0efa088..ade2fa7 100644 --- a/yescrypt/src/lib.rs +++ b/yescrypt/src/lib.rs @@ -49,7 +49,7 @@ use crate::{ sha256::{HMAC_SHA256_Buf, PBKDF2_SHA256, SHA256_Buf}, }; use alloc::{boxed::Box, vec, vec::Vec}; -use core::ptr; +use core::{ptr, slice}; #[de...
3
36
34
a91db4e537e84601c678bd4d98e28ec6fe06b0c9
Tony Arcieri
2025-09-05T20:17:01
yescrypt: use buffer slices for `smix` (#666) Removes some more pointers, replacing them with slices
diff --git a/yescrypt/src/pwxform.rs b/yescrypt/src/pwxform.rs index 8d584ef..a835de2 100644 --- a/yescrypt/src/pwxform.rs +++ b/yescrypt/src/pwxform.rs @@ -17,7 +17,7 @@ const SWIDTH: usize = 8; const PWXBYTES: usize = PWXGATHER * PWXSIMPLE * 8; const PWXWORDS: usize = PWXBYTES / size_of::<u32>(); const SMASK: usiz...
2
18
23
6f7078641542b1a5d930d32e1e6aa7cb25a269fd
Tony Arcieri
2025-09-05T18:24:02
yescrypt: lint and code cleanups (#665)
diff --git a/yescrypt/src/common.rs b/yescrypt/src/common.rs index 9c08d61..ea8fbe4 100644 --- a/yescrypt/src/common.rs +++ b/yescrypt/src/common.rs @@ -1,41 +1,26 @@ -#![allow( - dead_code, - mutable_transmutes, - non_camel_case_types, - non_snake_case, - non_upper_case_globals, - unused_assignments,...
3
47
43
e888cc4fbfac5efe0234fa37cb413b1c16ba978f
Tony Arcieri
2025-09-05T18:05:34
yescrypt: remove `libc` (#664) Removes the last remaining usages of `libc`, which were mostly `memcpy` and various unnecessary typecasts.
diff --git a/Cargo.lock b/Cargo.lock index eb8ec9c..ba3161a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -595,7 +595,6 @@ dependencies = [ "bitflags", "hex-literal", "hmac", - "libc", "pbkdf2", "salsa20", "sha2", diff --git a/yescrypt/Cargo.toml b/yescrypt/Cargo.toml index 2214429..278cb70 100644 --- a/yescr...
5
23
32
5699decefaba046a15c3397fd8a6a3741dc3b49c
Tony Arcieri
2025-09-05T17:51:07
yescrypt: allocate state as a `Vec` (#663) Notably this is the last usages of `malloc`/`free` in the codebase. Also adds a lifetime to `PxwformCtx` and changes the constructor argument to be a mutable slice. It's still pointers internally, but this encapsulates a lot of the unsafety, and allows us to remove `unsafe`...
diff --git a/yescrypt/src/lib.rs b/yescrypt/src/lib.rs index 68a3f10..25facce 100644 --- a/yescrypt/src/lib.rs +++ b/yescrypt/src/lib.rs @@ -51,12 +51,12 @@ pub use crate::{ }; use crate::{ - pwxform::{PwxformCtx, RMIN, SBYTES}, + pwxform::{PwxformCtx, RMIN, SWORDS}, sha256::{HMAC_SHA256_Buf, PBKDF2_SHA2...
3
27
28
7fe61150a5f6481775af7a73ecced499e2b4f2c2
Tony Arcieri
2025-09-05T17:37:58
yescrypt: make buffer arg to `smix` a slice (#662) Replaces the pointer, but still converts to a pointer later in the function. An incremental improvement.
diff --git a/yescrypt/src/lib.rs b/yescrypt/src/lib.rs index d99b8e4..68a3f10 100644 --- a/yescrypt/src/lib.rs +++ b/yescrypt/src/lib.rs @@ -237,7 +237,7 @@ unsafe fn yescrypt_kdf_body( let mut pwxform_ctx = PwxformCtx::new(p as usize, s); smix::smix( - b.as_mut_ptr(), + &mut b...
2
5
5
00cf2560b0d6beb4c380ae10e88dd4299e1ed212
Tony Arcieri
2025-09-05T17:16:03
yescrypt: more constants and comments (#661) Carries over more constants and comments from the reference C implementation
diff --git a/yescrypt/src/lib.rs b/yescrypt/src/lib.rs index 33d0c04..d99b8e4 100644 --- a/yescrypt/src/lib.rs +++ b/yescrypt/src/lib.rs @@ -51,7 +51,7 @@ pub use crate::{ }; use crate::{ - pwxform::PwxformCtx, + pwxform::{PwxformCtx, RMIN, SBYTES}, sha256::{HMAC_SHA256_Buf, PBKDF2_SHA256, SHA256_Buf}, ...
2
27
10
5686fdab3f16715585ce0d208a783b18d8a4da32
Tony Arcieri
2025-09-05T16:28:46
yescrypt: pwxform cleanups (#659) - Define and use constants from the C reference implementation - Replace wrapping arithmetic with standard debug-checked operators
diff --git a/yescrypt/src/pwxform.rs b/yescrypt/src/pwxform.rs index 687bf07..f2620bf 100644 --- a/yescrypt/src/pwxform.rs +++ b/yescrypt/src/pwxform.rs @@ -7,6 +7,17 @@ use crate::{ use alloc::vec::Vec; use core::ptr; +// These are tunable, but they must meet certain constraints. +const PWXSIMPLE: usize = 2; +cons...
1
26
34
64f90c72e961acb49926f25464300046c93ce941
Tony Arcieri
2025-09-05T16:16:42
yescrypt: use more Rust references in `smix` (#658) Converts more code in the `smix` module to use Rust references rather than pointers as inherited from C. Additionally converts arithmetic to use standard operators that panic on overflow/underflow in debug mode.
diff --git a/yescrypt/src/common.rs b/yescrypt/src/common.rs index e0e64ee..38e9a82 100644 --- a/yescrypt/src/common.rs +++ b/yescrypt/src/common.rs @@ -55,8 +55,3 @@ pub(crate) fn prev_power_of_two(mut x: u64) -> u64 { } x } - -pub(crate) fn wrap(mut x: u64, mut i: u64) -> u64 { - let mut n: u64 = prev_p...
4
68
87
088b34de518adeb74687a7ad2163a0c1d04fcccf
Tony Arcieri
2025-09-05T14:41:17
yescrypt: use `Vec` for `PwxformCtx` storage (#657) Removes an instance of `malloc`, replacing it with `Vec`. Also replaces the immediate first occurance of passing it as a pointer (to `smix`) with a mutable slice, though it's immediately converted to a pointer after that. More work to be done!
diff --git a/yescrypt/src/lib.rs b/yescrypt/src/lib.rs index b51ded0..5f6f3ae 100644 --- a/yescrypt/src/lib.rs +++ b/yescrypt/src/lib.rs @@ -232,13 +232,7 @@ unsafe fn yescrypt_kdf_body( return Err(Error); } - let pwxform_ctx = match PwxformCtx::alloc(p, s) { - Ok(ctx) => ctx, ...
3
26
29
6356ca71b96e0ce67ecfd99140ecc7003b54befb
Tony Arcieri
2025-09-05T14:12:39
yescrypt: make `Params` struct members `pub(crate)` (#656) Adds accessor methods, ala the `scrypt` crate
diff --git a/yescrypt/src/params.rs b/yescrypt/src/params.rs index 5cc276e..e64909b 100644 --- a/yescrypt/src/params.rs +++ b/yescrypt/src/params.rs @@ -27,35 +27,48 @@ impl Default for Flags { } } -/// `yescrypt` parameters. +/// `yescrypt` algorithm parameters. +/// +/// These are various algorithm settings w...
2
68
44
a8aa6b51174739d3fff90e8733a1933b50691621
Tony Arcieri
2025-09-05T13:57:21
pwxform: use a reference argument (#655) Has `PwxformCtx::pwxform` take a Rust reference instead of a pointer
diff --git a/yescrypt/src/pwxform.rs b/yescrypt/src/pwxform.rs index 0569a8c..d12806a 100644 --- a/yescrypt/src/pwxform.rs +++ b/yescrypt/src/pwxform.rs @@ -71,7 +71,7 @@ impl PwxformCtx { } // 7: X <-- pwxform(X) - self.pwxform(x.as_mut_ptr()); + self.pwxform(&mut x); ...
1
10
10
3439ea75aa62e8af878fd18f3601342636c508c3
Tony Arcieri
2025-09-05T04:58:23
yescrypt: opaque error type (#654) Gets rid of the inner code. Perhaps we can eventually turn it into an enum.
diff --git a/yescrypt/src/error.rs b/yescrypt/src/error.rs index 583bae6..2a1b0db 100644 --- a/yescrypt/src/error.rs +++ b/yescrypt/src/error.rs @@ -4,11 +4,11 @@ use core::fmt; /// Error type. #[derive(Debug)] -pub struct Error(pub(crate) i32); +pub struct Error; impl fmt::Display for Error { fn fmt(&self,...
3
27
21
d39f81fcd05421522e48e87ddc4ad747680b058b
Tony Arcieri
2025-09-05T04:45:04
yescrypt: split `pwxform` and `smix` modules (#653)
diff --git a/yescrypt/src/lib.rs b/yescrypt/src/lib.rs index 3d827cf..056d30f 100644 --- a/yescrypt/src/lib.rs +++ b/yescrypt/src/lib.rs @@ -43,6 +43,7 @@ mod params; mod pwxform; mod salsa20; mod sha256; +mod smix; pub use crate::{ error::{Error, Result}, @@ -231,19 +232,9 @@ unsafe fn yescrypt_kdf_body( ...
3
398
377
a2db7f8a800f86dfb9b39a484f738cf1a2a04646
Tony Arcieri
2025-09-05T04:25:43
yescrypt: extract `pwxform` module; add comments (#652) Moves all code related to smix and the parallel wide tranformation (pwxform) into the `pwxform` module.
diff --git a/yescrypt/src/lib.rs b/yescrypt/src/lib.rs index 0bef5b8..3d827cf 100644 --- a/yescrypt/src/lib.rs +++ b/yescrypt/src/lib.rs @@ -40,9 +40,9 @@ extern crate alloc; mod common; mod error; mod params; +mod pwxform; mod salsa20; mod sha256; -mod smix; pub use crate::{ error::{Error, Result}, @@ -50...
3
414
296
f66e33e8fde99e7fd6c46cf45ed34d947f9bdc78
Tony Arcieri
2025-09-05T03:51:25
yescrypt: use slices for `yescrypt_kdf_body` params (#651)
diff --git a/yescrypt/src/lib.rs b/yescrypt/src/lib.rs index 724c9b5..0bef5b8 100644 --- a/yescrypt/src/lib.rs +++ b/yescrypt/src/lib.rs @@ -74,7 +74,7 @@ struct PwxformCtx { } /// yescrypt Key Derivation Function (KDF) -pub fn yescrypt_kdf(passwd: &[u8], salt: &[u8], params: &Params, dst: &mut [u8]) -> Result<()> ...
1
23
22
6675738000bd25786f072d37db366a47b94fe9d3
Tony Arcieri
2025-09-05T03:37:18
yescrypt: extract `smix` module (#650)
diff --git a/yescrypt/src/lib.rs b/yescrypt/src/lib.rs index 206be6f..724c9b5 100644 --- a/yescrypt/src/lib.rs +++ b/yescrypt/src/lib.rs @@ -42,6 +42,7 @@ mod error; mod params; mod salsa20; mod sha256; +mod smix; pub use crate::{ error::{Error, Result}, @@ -49,7 +50,7 @@ pub use crate::{ }; use crate::{...
2
214
202
268479d2a4765352f8f8c0e7bfb8262c6b30ba54
Tony Arcieri
2025-09-05T03:33:03
yescrypt: use snake case names (#649) Makes code closer to idiomatic Rust
diff --git a/yescrypt/src/lib.rs b/yescrypt/src/lib.rs index b7e2930..206be6f 100644 --- a/yescrypt/src/lib.rs +++ b/yescrypt/src/lib.rs @@ -26,7 +26,6 @@ clippy::too_many_arguments, clippy::toplevel_ref_arg, clippy::unwrap_used, - non_snake_case, unsafe_op_in_unsafe_fn )] @@ -66,10 +65,10 @@ ...
3
194
184
1a53ec1b45b4855a62065c4a42432d4773b9aaf6
Tony Arcieri
2025-09-05T03:11:59
yescrypt: factor out `error` and `params` modules (#648)
diff --git a/yescrypt/src/error.rs b/yescrypt/src/error.rs new file mode 100644 index 0000000..583bae6 --- /dev/null +++ b/yescrypt/src/error.rs @@ -0,0 +1,18 @@ +//! Error type. + +use core::fmt; + +/// Error type. +#[derive(Debug)] +pub struct Error(pub(crate) i32); + +impl fmt::Display for Error { + fn fmt(&self,...
4
127
88
a33a74eb8c2062745dc02b3f29f5b299a9eb0cf1
Tony Arcieri
2025-09-05T02:23:15
yescrypt: remove no-op `yescrypt_kdf_body` call (#647) The original C code has it write into a buffer which isn't used. Per the deleted comment this is apparently for demonstrating implementation parity with the optimized implementation, which does some form of preallocation which is unused in the reference implement...
diff --git a/yescrypt/src/lib.rs b/yescrypt/src/lib.rs index 5bf444f..e104304 100644 --- a/yescrypt/src/lib.rs +++ b/yescrypt/src/lib.rs @@ -139,62 +139,31 @@ pub fn yescrypt_kdf( return Err(Error(-1)); } - let retval = if params.flags.contains(Flags::RW) + if params.flags.contains(Flags::RW) ...
1
34
64
fa13c2751446549031426b6d4b2a0a7de9069350
Tony Arcieri
2025-09-05T01:24:52
yescrypt: public `Params` struct (#646) This already existed in the code from the automed translation, but was oddly only used in the internal-facing API, but not all the way to the backend. This exposes it, which matches our other crates and would be helpful for implementing the `password-hash` API.
diff --git a/yescrypt/src/lib.rs b/yescrypt/src/lib.rs index a54ce15..5bf444f 100644 --- a/yescrypt/src/lib.rs +++ b/yescrypt/src/lib.rs @@ -89,7 +89,7 @@ bitflags::bitflags! { #[derive(Clone, Copy)] #[repr(C)] -struct Params { +pub struct Params { pub flags: Flags, pub N: u64, pub r: u32, @@ -99,6 +...
2
68
43
e0317394f47a9234cbcc15ceccf917b73819822b
Tony Arcieri
2025-09-05T00:34:30
yescrypt: flags improvements (#645) Replace lingering flags numeric literals with constants
diff --git a/yescrypt/src/lib.rs b/yescrypt/src/lib.rs index c2fa1a1..a54ce15 100644 --- a/yescrypt/src/lib.rs +++ b/yescrypt/src/lib.rs @@ -71,16 +71,19 @@ struct Local { bitflags::bitflags! { #[derive(Clone, Copy, Debug, Eq, PartialEq)] pub struct Flags: u32 { - const WORM = 0x001; - c...
1
25
20
ae30efc0550687f2a6f9d6331e9c2b1b724c79ba
Tony Arcieri
2025-09-04T23:11:15
yescrypt: remove `Vec` from API (#644) Writes into an output `&mut [u8]` instead. cc @conradludgate
diff --git a/yescrypt/src/lib.rs b/yescrypt/src/lib.rs index 04a7407..c2fa1a1 100644 --- a/yescrypt/src/lib.rs +++ b/yescrypt/src/lib.rs @@ -116,8 +116,8 @@ pub fn yescrypt_kdf( p: u32, t: u32, g: u32, - dstlen: usize, -) -> Result<Vec<u8>, Error> { + dst: &mut [u8], +) -> Result<(), Error> { ...
2
53
30
d884eecad87df84923b361a6bff745e803a5184c
Tony Arcieri
2025-09-04T20:51:00
yescrypt: use `bitflags` crate for flags (#643) It was previously hard to tell what was happening with flags because they were all hardcoded constants after the C-to-Rust translation. This uses the `bitflags` crate as a first pass towards trying to clean them up and make them more semantic so we can tell what's actua...
diff --git a/Cargo.lock b/Cargo.lock index eccc154..eb8ec9c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -592,6 +592,7 @@ dependencies = [ name = "yescrypt" version = "0.0.1-alpha" dependencies = [ + "bitflags", "hex-literal", "hmac", "libc", diff --git a/yescrypt/Cargo.toml b/yescrypt/Cargo.toml index 7bb2d77....
4
100
55
b103978696feab3149a898fd4bc02265a42709d8
Conrad Ludgate
2025-09-04T18:52:06
yescrypt simple lint fixes (#642) Mostly automatic changes from clippy, plus a few rewrites of the common functions to be more rusty. This also now passes default miri tests and also fixes the miscompilation on the latest compiler
diff --git a/yescrypt/src/common.rs b/yescrypt/src/common.rs index cd99930..e0e64ee 100644 --- a/yescrypt/src/common.rs +++ b/yescrypt/src/common.rs @@ -9,42 +9,23 @@ )] pub(crate) unsafe fn blkcpy(mut dst: *mut u32, mut src: *const u32, mut count: usize) { - loop { - let fresh0 = src; - src = src....
3
74
133
2e45bc89872e29d4832f77b7c2975123bec1dc1e
Tony Arcieri
2025-09-04T18:36:25
yescrypt: factor `yescrypt_kdf_inner` into `yescrypt_kdf` (#641) Also adds a note about this somewhat strange branch/comment from the reference C implementation: https://github.com/openwall/yescrypt/blob/087682c/yescrypt-ref.c#L771-L777
diff --git a/yescrypt/src/lib.rs b/yescrypt/src/lib.rs index 1bf8503..c174b78 100644 --- a/yescrypt/src/lib.rs +++ b/yescrypt/src/lib.rs @@ -125,81 +125,66 @@ pub fn yescrypt_kdf( let mut dst = vec![0u8; dstlen]; - let retval = unsafe { - yescrypt_kdf_inner( - &mut local, - pass...
1
52
67
41fdc118ba34895cfdfbe1c576d074fc29565263
Tony Arcieri
2025-09-04T18:23:46
yescrypt: handle `retval` (#640) Previously errors were being ignored. This adds an `Error` type and changes `yescrypt_kdf` to return a `Result`
diff --git a/yescrypt/src/lib.rs b/yescrypt/src/lib.rs index 9aec75e..1bf8503 100644 --- a/yescrypt/src/lib.rs +++ b/yescrypt/src/lib.rs @@ -52,9 +52,23 @@ use crate::{ sha256::{HMAC_SHA256_Buf, PBKDF2_SHA256, SHA256_Buf}, }; use alloc::{boxed::Box, vec, vec::Vec}; -use core::ptr; +use core::{fmt, ptr}; use lib...
2
48
29
7fad0669e8475aa4668784f607e1a65bd92031ee
Conrad Ludgate
2025-09-04T18:20:46
yescrypt: use RAII for `kdf_body` to remove complex control flow (#639) Replaces some of the uses of `malloc` with `Box<[u32]>` which allows us to rely on `Drop`. Still more to do on this front.
diff --git a/yescrypt/src/lib.rs b/yescrypt/src/lib.rs index 710bf33..9aec75e 100644 --- a/yescrypt/src/lib.rs +++ b/yescrypt/src/lib.rs @@ -51,17 +51,12 @@ use crate::{ common::{blkcpy, blkxor, integerify, le32dec, le32enc, prev_power_of_two, wrap}, sha256::{HMAC_SHA256_Buf, PBKDF2_SHA256, SHA256_Buf}, }; -...
1
128
160
763d6f6b1b3a403cd847bf24b0fac0d0b9597c59
Tony Arcieri
2025-09-04T17:44:19
yescrypt: remove `wrapping_*` from `yescrypt_kdf_body` (#638) These operations don't rely on wrapping arithmetic and would actually benefit from checked arithmetic in debug mode for catching bugs
diff --git a/yescrypt/src/lib.rs b/yescrypt/src/lib.rs index bb68356..710bf33 100644 --- a/yescrypt/src/lib.rs +++ b/yescrypt/src/lib.rs @@ -150,12 +150,8 @@ unsafe fn yescrypt_kdf_inner( } if params.flags & 0x2 != 0 && params.p >= 1 - && params.N.wrapping_div(params.p as u64) >= 0x100 - ...
1
38
57
befcfcc0c436e73be80dc8f90403b2bd29fc5c70
Tony Arcieri
2025-09-04T16:28:37
yescrypt: use `u64::MAX` constant (#637)
diff --git a/yescrypt/src/lib.rs b/yescrypt/src/lib.rs index 2d16cf0..bb68356 100644 --- a/yescrypt/src/lib.rs +++ b/yescrypt/src/lib.rs @@ -242,14 +242,9 @@ unsafe fn yescrypt_kdf_body( if !(!(buflen > (1usize << 32).wrapping_sub(1).wrapping_mul(32)) && !((r as u64).wrapping_mul(p as u64) >= (1 << 30) as...
1
5
10
0918f9ab7df2933dd0d2bcc54b20b5c2d102fcf3
Tony Arcieri
2025-09-04T16:22:27
yescrypt: replace `u*_t` and `size_t` aliases with Rust types (#636) - `uint8_t` => `u8` - `uint32_t` => `u32` - `uint64_t` => `u64` - `size_t` => `usize` - `libc::c_char` => `i8` - `libc::c_int` => `i32` - `libc::c_uint` => `u32` - `libc::c_ulong` => `u64`
diff --git a/yescrypt/src/common.rs b/yescrypt/src/common.rs index 83fc2ca..cd99930 100644 --- a/yescrypt/src/common.rs +++ b/yescrypt/src/common.rs @@ -8,9 +8,7 @@ unused_mut )] -use crate::{size_t, uint32_t, uint64_t}; - -pub(crate) unsafe fn blkcpy(mut dst: *mut uint32_t, mut src: *const uint32_t, mut count:...
4
181
221
5613286b764ef335550281cfb808455d817b71b0
Tony Arcieri
2025-09-04T16:09:41
yescrypt: remove unnecessary casting (#635) Removes several instances of casting which are superfluous, e.g. - casts on literals where the type can be inferred - casts to a type's original type - casts which are immediately cast into another type - repeat casts to the same type cc @conradludgate
diff --git a/yescrypt/src/lib.rs b/yescrypt/src/lib.rs index dd53f6f..ed97381 100644 --- a/yescrypt/src/lib.rs +++ b/yescrypt/src/lib.rs @@ -162,17 +162,17 @@ unsafe fn yescrypt_kdf_inner( .wrapping_mul(params.r as u64) >= 0x20000 { - let retval: libc::c_int = yescrypt_kdf_body( + ...
1
85
152
8630ac14f9a61153b25ce65adecc7b3ffbe34dc7
Conrad Ludgate
2025-09-04T15:22:17
yescrypt: significant changes to control flow for kdf_body (#634) This takes several steps to try and disentangle all the states inside of the kdf_body. As we move to RAII, we should be able to get rid of most of this structure and just rely on drop guards to kick in.
diff --git a/yescrypt/src/lib.rs b/yescrypt/src/lib.rs index 43e208f..dd53f6f 100644 --- a/yescrypt/src/lib.rs +++ b/yescrypt/src/lib.rs @@ -23,11 +23,9 @@ // Temporary lint overrides while C code is being translated #![allow( clippy::cast_possible_wrap, - clippy::collapsible_if, clippy::needless_return,...
1
272
423
d6eb71a0ade5ac468f77aa85e05f98086574d145
Ben Kimock
2025-09-03T18:02:24
yescrypt: use `ptr::null` instead of int2ptr (#631) Stacked Borrows rejects this code, but Tree Borrows is fine with the aliasing patterns (and all code accepted by Tree Borrows should be free from aliasing UB from LLVM's perspective). The hitch is that Tree Borrows doesn't support int-to-ptr casts, so initialization ...
diff --git a/yescrypt/src/lib.rs b/yescrypt/src/lib.rs index 4e92272..daa23bc 100644 --- a/yescrypt/src/lib.rs +++ b/yescrypt/src/lib.rs @@ -220,7 +220,7 @@ unsafe fn yescrypt_kdf_inner( } unsafe fn yescrypt_init_local(mut local: *mut Local) -> libc::c_int { - (*local).aligned = 0 as *mut libc::c_void; + (*lo...
1
18
18
b1485ffc2ebb1ea4c304e39c1857bfa7ab23783f
Tony Arcieri
2025-09-03T15:32:41
Cut prereleases with `hybrid-array` v0.4 support (#630) Releases the following: - `argon2` v0.6.0-rc.1 - `bcrypt-pbkdf` v0.11.0-rc.1 - `pbkdf2` v0.13.0-rc.1 - `scrypt` v0.12.0-rc.2
diff --git a/Cargo.lock b/Cargo.lock index 4cf1b84..eccc154 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,7 +4,7 @@ version = 4 [[package]] name = "argon2" -version = "0.6.0-rc.0" +version = "0.6.0-rc.1" dependencies = [ "base64ct", "blake2", @@ -43,7 +43,7 @@ checksum = "55248b47b0caf0546f7988906588779981c43...
6
11
11
8cc7516e85eea4ec8cefa625a3d892dc7a500b37
Tony Arcieri
2025-09-03T14:32:35
Bump `hybrid-array` to v0.4 (#629)
diff --git a/Cargo.lock b/Cargo.lock index 13601c8..4cf1b84 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -60,9 +60,9 @@ checksum = "d9aa1eef3994e2ccd304a78fe3fea4a73e5792007f85f09b79bb82143ca5f82b" [[package]] name = "belt-hash" -version = "0.2.0-rc.0" +version = "0.2.0-rc.1" source = "registry+https://github.com/r...
8
52
51
e75b27dbd8c83d1e6689f80d9677a247122c0d73
Jonas Malaco
2025-07-21T16:37:02
argon2: add parallelism (#547) Adds a `parallel` feature, with an optional dependency on `rayon`, and parallelizes the filling of blocks. Coordinated shared access in the memory blocks is implemented with a `SegmentViewIter` iterator, which implements either `rayon::iter::ParallelIterator` or `core::iter::Iterator` a...
diff --git a/Cargo.lock b/Cargo.lock index 998cb0e..1157462 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -11,6 +11,7 @@ dependencies = [ "cpufeatures", "hex-literal", "password-hash", + "rayon", "zeroize", ] diff --git a/argon2/Cargo.toml b/argon2/Cargo.toml index f7c14f7..7339b4b 100644 --- a/argon2/Cargo.to...
6
292
141
61b66c7de9e893adc0ce0663d87e24cca14b7c15
Artyom Pavlov
2025-06-18T14:02:13
pbkdf2: use helper macro to simplify tests (#617) Additionally, adds a test vector for `belt-hash`.
diff --git a/Cargo.lock b/Cargo.lock index e7da4e3..8e38ee9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -16,9 +16,9 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ace50bade8e6234aa140d9a2f552bbee1d...
3
89
95
69cfa4b377411f0fffc4785b855a3d242edc1752
Tony Arcieri
2025-05-31T17:44:37
yescrypt: update licensing comment (#610) Notes that we relicensed the derived code with permission
diff --git a/yescrypt/src/lib.rs b/yescrypt/src/lib.rs index c5e110d..4e92272 100644 --- a/yescrypt/src/lib.rs +++ b/yescrypt/src/lib.rs @@ -48,7 +48,8 @@ // Adapted from the yescrypt reference implementation available at: // <https://github.com/openwall/yescrypt> // -// Licensed under the same BSD-2-Clause license ...
1
2
1
4c59460408b14696d0ca854b3990ae5238e43855
Tony Arcieri
2025-05-31T17:42:53
bcrypt-pbkdf v0.11.0-rc.0 (#609)
diff --git a/Cargo.lock b/Cargo.lock index d397ffe..b628256 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -42,7 +42,7 @@ checksum = "89e25b6adfb930f02d1981565a6e5d9c547ac15a96606256d3b59040e5cd4ca3" [[package]] name = "bcrypt-pbkdf" -version = "0.11.0-pre.1" +version = "0.11.0-rc.0" dependencies = [ "blowfish", ...
2
2
2
68b561da3ed90ac2c3a1bd32a32134368c205aca
Tony Arcieri
2025-05-31T17:36:11
argon2 v0.6.0-rc.0 (#608)
diff --git a/Cargo.lock b/Cargo.lock index fd42865..d397ffe 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,7 +4,7 @@ version = 4 [[package]] name = "argon2" -version = "0.6.0-pre.1" +version = "0.6.0-rc.0" dependencies = [ "base64ct", "blake2", diff --git a/argon2/Cargo.toml b/argon2/Cargo.toml index 9f45b30.....
3
3
3
a710fad8236afb4fc10f256762c50e4dc6f9d63c
Tony Arcieri
2025-05-30T21:54:28
scrypt v0.12.0-rc.1 (#607)
diff --git a/Cargo.lock b/Cargo.lock index 541d00d..fd42865 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -416,7 +416,7 @@ dependencies = [ [[package]] name = "scrypt" -version = "0.12.0-rc.0" +version = "0.12.0-rc.1" dependencies = [ "password-hash", "pbkdf2", diff --git a/scrypt/Cargo.toml b/scrypt/Cargo.toml ...
2
2
2
14560bc9f3609dab23067a605527371fea20cb2c
Tony Arcieri
2025-05-30T19:18:46
scrypt v0.12.0-rc.0 (#605)
diff --git a/Cargo.lock b/Cargo.lock index 3f18960..541d00d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -416,7 +416,7 @@ dependencies = [ [[package]] name = "scrypt" -version = "0.12.0-pre.2" +version = "0.12.0-rc.0" dependencies = [ "password-hash", "pbkdf2", diff --git a/password-auth/Cargo.toml b/password-a...
3
3
3
2c641bf8636f9287142857d369f80d51b6795f10
Tony Arcieri
2025-05-30T16:58:23
scrypt: make `Params` output len customization optional (#602) This more or less goes back to the original API prior to when #255 added output length customization, adding a separate constructor function for adding length customization. This keeps the output length out-of-the-way for users of the low-level `scrypt::s...
diff --git a/scrypt/src/lib.rs b/scrypt/src/lib.rs index 076265a..7c5fff8 100644 --- a/scrypt/src/lib.rs +++ b/scrypt/src/lib.rs @@ -84,6 +84,12 @@ pub use crate::simple::{ALG_ID, Scrypt}; /// `Ok(())` if calculation is successful and `Err(InvalidOutputLen)` if /// `output` does not satisfy the following condition: ...
4
48
12
1a1178b6675d2ec46267f6444f36acf8823f27c3
Arthur Gautier
2025-05-30T14:57:45
pbkdf2: 0.13.0-rc.0 (#604)
diff --git a/Cargo.lock b/Cargo.lock index f21cc95..3f18960 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -77,9 +77,9 @@ dependencies = [ [[package]] name = "blowfish" -version = "0.10.0-pre.2" +version = "0.10.0-rc.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a95055ab63fce093f337...
6
15
15
6090504f4f31f39a2783ee149d0c02711a612620
Arthur Gautier
2025-05-30T02:50:20
chore(deps): bump password-hash to 0.6.0-rc.1 (#603)
diff --git a/Cargo.lock b/Cargo.lock index 101750a..f21cc95 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -59,8 +59,9 @@ checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967" [[package]] name = "blake2" -version = "0.11.0-pre.5" -source = "git+https://github.com/RustCrypto/hashes.git#d9ad085ed...
9
44
48
737cf2a78633b23acf8fca05001da39322cbfded
Artyom Pavlov
2025-05-28T12:17:14
Migrate to `doc_auto_cfg` (#600) Additionally removes explicit passing of `--cfg docsrs` since it's done automatically by docs.rs.
diff --git a/argon2/Cargo.toml b/argon2/Cargo.toml index 6c961ee..c985835 100644 --- a/argon2/Cargo.toml +++ b/argon2/Cargo.toml @@ -46,4 +46,3 @@ check-cfg = ['cfg(test_large_ram)'] [package.metadata.docs.rs] all-features = true -rustdoc-args = ["--cfg", "docsrs"] diff --git a/argon2/src/algorithm.rs b/argon2/src/...
24
9
58