Commit ca05106
refactor: reorganize capsula-crypto module with enhanced hash API
- Restructure crypto module into functional categories:
* asymmetric/ - Ed25519 signatures and X25519 key exchange
* symmetric/ - AES-256-GCM and ChaCha20-Poly1305 encryption
* hash/ - SHA-256 and SHA-512 hash functions with flexible API
* kdf/ - HKDF key derivation with cleaner API
- Enhance hash module with algorithm selection:
* Add HashAlgorithm enum for SHA-256/SHA-512 selection
* Implement generic hash() function with algorithm parameter
* Add quick_hash() convenience functions using default algorithm
* Maintain backward compatibility with existing sha256/sha512 functions
- Improve KDF module:
* Rename functions to derive_key32() and derive_many()
* Keep legacy names as deprecated aliases for compatibility
- Update all imports and examples to use new module structure
- All 25 tests passing with enhanced test coverage
BREAKING CHANGE: Module paths have changed, but all exports are maintained at crate root for backward compatibility
🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>1 parent 8f3bc69 commit ca05106
File tree
17 files changed
+599
-102
lines changed- crates
- capsula-crypto
- src
- asymmetric
- hash
- kdf
- symmetric
- capsula-key/src/key
- examples
17 files changed
+599
-102
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
| 106 | + | |
106 | 107 | | |
107 | 108 | | |
108 | 109 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
File renamed without changes.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
File renamed without changes.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
0 commit comments