Skip to content

Commit d500b60

Browse files
authored
Merge pull request #7 from AriajSarkar/dev
chore(deps): Release v0.3.3 - Update core dependencies and document WASM limitation
2 parents 66d5498 + 1179ae7 commit d500b60

4 files changed

Lines changed: 58 additions & 10 deletions

File tree

CHANGELOG.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,41 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [0.3.3] - 2025-11-19
11+
12+
### Changed
13+
- **Dependency Updates** - Updated to latest stable versions for improved security and performance
14+
- `getrandom` 0.2.16 → **0.3.4** (⚠️ **BREAKING**: Internal API migration, see below)
15+
- `serde` 1.0.215 → **1.0.228** (patch updates)
16+
- `blake3` 1.5.5 → **1.8.2** (performance improvements)
17+
- `bytes` 1.9.0 → **1.11.0** (optional dependency, zero-copy optimizations)
18+
- `serde_json` 1.0.141 → **1.0.145** (dev-dependency)
19+
20+
### Fixed
21+
- **getrandom 0.3.x Migration** - Updated internal random number generation
22+
- Migrated from deprecated `getrandom::getrandom()` to new `getrandom::fill()` API
23+
- Updated WASM feature flag: `js``wasm_js` (for getrandom 0.3.x compatibility)
24+
- **Note**: This is an internal change only - public API (`secure_bytes()`, `fill_secure_bytes()`) unchanged
25+
- All 313 tests passing with new getrandom version
26+
27+
### Known Issues
28+
- **WASM Support Temporarily Limited** ⚠️
29+
- Building for `wasm32-unknown-unknown` target is currently **not supported**
30+
- **Root Cause**: Dependency version conflict between:
31+
- getrandom 0.3.4 (our direct dependency) - requires `wasm_js` feature
32+
- getrandom 0.2.x (transitive via ed25519-dalek 2.2 / x25519-dalek 2.0) - requires `js` feature
33+
- Cargo cannot enable different features for different versions of the same crate
34+
- **Workaround**: Use CrabGraph v0.3.2 for WASM projects
35+
- **Permanent Fix**: Will be resolved when upgrading to ed25519-dalek 3.0 / x25519-dalek 3.0 (stable release expected Q1 2026)
36+
- **Impact**: Only affects WASM builds - all other platforms (Windows, Linux, macOS, iOS, Android) work normally
37+
- **Tracking Issue**: #6
38+
- **Resolution Plan**: See tracking issue for detailed upgrade timeline and dependency versions
39+
40+
### Internal
41+
- Removed explicit `rand_core` version constraint (now provided transitively by dalek crates)
42+
- All cryptographic operations continue to use audited primitives (RustCrypto, dalek-cryptography)
43+
- Zero user-facing API changes - migration is fully backward compatible
44+
1045
## [0.3.2] - 2025-11-08
1146

1247
### Added

Cargo.toml

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ hkdf = "0.12.4"
4040
sha2 = { version = "0.10.9", features = ["oid"] }
4141
sha3 = { version = "0.10.8", optional = true }
4242
blake2 = { version = "0.10.6", optional = true }
43-
blake3 = { version = "1.5.5", optional = true }
43+
blake3 = { version = "1.8.2", optional = true }
4444

4545
# Message Authentication Codes
4646
hmac = "0.12.1"
@@ -52,8 +52,8 @@ rsa = { version = "0.9.8", optional = true, features = ["sha2"] }
5252
pkcs8 = { version = "0.10.2", features = ["pem", "alloc"] }
5353

5454
# Random number generation
55-
getrandom = "0.2.16"
56-
rand_core = "0.6.4"
55+
getrandom = "0.3.4"
56+
rand_core = "0.6.4" # Used for OsRng in asymmetric crypto modules
5757

5858
# Secure memory handling
5959
zeroize = { version = "1.8.2", features = ["derive"] }
@@ -69,21 +69,33 @@ hex = "0.4.3"
6969
thiserror = "1.0.69"
7070

7171
# Serialization (optional)
72-
serde = { version = "1.0.215", features = ["derive"], optional = true }
72+
serde = { version = "1.0.228", features = ["derive"], optional = true }
7373

7474
# Zero-copy optimizations (optional)
75-
bytes = { version = "1.9.0", optional = true }
75+
bytes = { version = "1.11.0", optional = true }
7676

7777
[dev-dependencies]
7878
criterion = { version = "0.7.0", features = ["html_reports"] }
7979
proptest = "1.9.0"
8080
quickcheck = "1.0.3"
8181
hex-literal = "1.1.0"
82-
serde_json = "1.0.141"
82+
serde_json = "1.0.145"
8383
bincode = "1.3.3"
8484
toml = "0.8.23"
8585
serde_bytes = "0.11.19"
8686

87+
# WASM-specific: Enable WASM support for both getrandom versions
88+
# - getrandom 0.2.x (transitive via rand_core 0.6 from ed25519-dalek/x25519-dalek) needs `js`
89+
# - getrandom 0.3.x (our direct dependency) needs `wasm_js`
90+
# Both versions will be used simultaneously, each with their respective features
91+
#
92+
# ⚠️ KNOWN ISSUE (v0.3.3): WASM builds currently fail due to Cargo's unified feature resolution
93+
# Cannot enable different features for different versions of the same crate.
94+
# Will be fixed when upgrading to ed25519-dalek 3.0 / x25519-dalek 3.0 (requires Rust 1.81+)
95+
# For WASM support, use CrabGraph v0.3.2 or earlier.
96+
[target.'cfg(target_arch = "wasm32")'.dependencies]
97+
getrandom = { version = "0.3.4", features = ["wasm_js"] }
98+
8799
[features]
88100
default = ["std"]
89101
std = ["aes-gcm/std", "chacha20poly1305/std", "argon2/std"]
@@ -93,7 +105,8 @@ extended-hashes = ["sha3", "blake2", "blake3"]
93105
rsa-support = ["rsa"]
94106
serde-support = ["serde"]
95107
zero-copy = ["bytes"]
96-
wasm = ["getrandom/js"]
108+
# WASM support is automatic via target-specific getrandom dependency
109+
wasm = []
97110

98111
[[example]]
99112
name = "rsa_example"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ cargo audit
266266
- `rsa-support`: RSA encryption/signatures (⚠️ **NOT enabled by default** - opt-in only, has known vulnerability RUSTSEC-2023-0071)
267267
- `serde-support`: Serialization for keys and ciphertexts
268268
- `zero-copy`: `bytes` crate integration for high-performance scenarios
269-
- `wasm`: WebAssembly support
269+
- `wasm`: WebAssembly support (⚠️ **Temporarily unavailable in v0.3.3** - see CHANGELOG for details)
270270

271271
### Enabling RSA Support
272272

src/rand/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ use crate::errors::{CrabError, CrabResult};
2828
/// ```
2929
pub fn secure_bytes(len: usize) -> CrabResult<Vec<u8>> {
3030
let mut buf = vec![0u8; len];
31-
getrandom::getrandom(&mut buf)
31+
getrandom::fill(&mut buf)
3232
.map_err(|e| CrabError::random_error(format!("Failed to generate random bytes: {}", e)))?;
3333
Ok(buf)
3434
}
@@ -53,7 +53,7 @@ pub fn secure_bytes(len: usize) -> CrabResult<Vec<u8>> {
5353
/// assert_ne!(key, [0u8; 32]); // Should be random
5454
/// ```
5555
pub fn fill_secure_bytes(buf: &mut [u8]) -> CrabResult<()> {
56-
getrandom::getrandom(buf).map_err(|e| {
56+
getrandom::fill(buf).map_err(|e| {
5757
CrabError::random_error(format!("Failed to fill buffer with random bytes: {}", e))
5858
})?;
5959
Ok(())

0 commit comments

Comments
 (0)