Commit a18730c
authored
chore: add wasm32-unknown-unknown compatibility (#20)
* chore: add wasm32 conditional timing for Instant compatibility
* chore: add wasm32 fallback for AtomicU64 and SystemRandom
* chore: add RustCrypto aes-gcm backend for wasm32 encryption
ring doesn't compile on wasm32-unknown-unknown (requires clang for C asm).
Move ring to a target-conditional dep (native only), add aes-gcm from
RustCrypto for wasm32. Both produce identical AES-256-GCM wire format:
[nonce(12)][ciphertext][auth_tag(16)]
Native targets continue using ring for hardware-accelerated performance.
wasm32 targets use aes-gcm (pure Rust) when wasm+encryption features active.
key_derivation.rs unchanged — already uses RustCrypto hkdf/sha2, compiles
on both targets without modification.
* fix: resolve expert panel findings for wasm32 compat
- Fold aes-gcm/getrandom into encryption feature (no separate wasm flag needed)
- Enable zeroize on aes/aes-gcm deps (scrub round keys on drop)
- Add cross-backend wire format test (ring <-> aes-gcm roundtrip)
- Remove dead cfg guards inside native-only functions
- Consistency: error messages, min length expression, doc comments
* chore: apply cargo fmt
* chore: bump MSRV from 1.82 to 1.85
cbindgen 0.29.2 pulls clap 4.6.0 which requires edition2024
(stabilized in Rust 1.85, Feb 2025). Pinning transitive deps
is fragile; bumping MSRV is the correct fix.
* ci: update MSRV job from 1.82 to 1.85
* chore: update cargo-deny skips for getrandom version changes
aes-gcm brings in getrandom 0.2.x (via crypto-common), proptest
uses 0.3.x, and tempfile/cbindgen uses 0.4.x. Updated skip entries
to use semver ranges instead of exact versions.1 parent 9f8abda commit a18730c
6 files changed
Lines changed: 375 additions & 36 deletions
File tree
- .github/workflows
- src
- encryption
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
| 54 | + | |
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
40 | 39 | | |
41 | 40 | | |
42 | | - | |
| 41 | + | |
43 | 42 | | |
44 | 43 | | |
45 | 44 | | |
46 | 45 | | |
47 | 46 | | |
48 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
49 | 55 | | |
50 | 56 | | |
51 | 57 | | |
52 | 58 | | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
53 | 65 | | |
54 | 66 | | |
55 | 67 | | |
| |||
59 | 71 | | |
60 | 72 | | |
61 | 73 | | |
| 74 | + | |
62 | 75 | | |
63 | 76 | | |
64 | 77 | | |
| |||
69 | 82 | | |
70 | 83 | | |
71 | 84 | | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
72 | 89 | | |
73 | 90 | | |
74 | 91 | | |
75 | 92 | | |
76 | 93 | | |
77 | 94 | | |
78 | 95 | | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
79 | 99 | | |
80 | 100 | | |
81 | 101 | | |
82 | 102 | | |
83 | 103 | | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
84 | 107 | | |
85 | 108 | | |
86 | 109 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
74 | | - | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
75 | 83 | | |
76 | 84 | | |
77 | 85 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
175 | 176 | | |
176 | 177 | | |
177 | 178 | | |
178 | | - | |
| 179 | + | |
| 180 | + | |
179 | 181 | | |
180 | 182 | | |
181 | 183 | | |
182 | 184 | | |
183 | 185 | | |
184 | | - | |
185 | | - | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
186 | 190 | | |
187 | 191 | | |
188 | 192 | | |
| |||
220 | 224 | | |
221 | 225 | | |
222 | 226 | | |
223 | | - | |
| 227 | + | |
| 228 | + | |
224 | 229 | | |
225 | 230 | | |
226 | 231 | | |
227 | 232 | | |
228 | 233 | | |
229 | | - | |
230 | | - | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
231 | 238 | | |
232 | 239 | | |
233 | 240 | | |
| |||
0 commit comments