Skip to content

Commit e4a2d64

Browse files
committed
pq-key-encoder/rust: Update Readme
1 parent b328321 commit e4a2d64

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

packages/pq-key-encoder/rust/Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,13 @@
22
name = "pq-key-encoder"
33
version = "0.0.1"
44
edition = "2021"
5+
rust-version = "1.78"
56
description = "Post-quantum key encoding (DER, PEM, JWK) for ML-KEM, ML-DSA, SLH-DSA"
67
license = "MIT"
78
readme = "README.md"
9+
repository = "https://github.com/multivmlabs/post-quantum-packages/tree/main/packages/pq-key-encoder/rust"
10+
homepage = "https://github.com/multivmlabs/post-quantum-packages"
11+
documentation = "https://docs.rs/pq-key-encoder"
812
keywords = ["post-quantum", "cryptography", "key-encoding", "pqc", "der"]
913
categories = ["cryptography", "encoding"]
1014

packages/pq-key-encoder/rust/README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# pq-key-encoder
22

3+
[![Crates.io](https://img.shields.io/crates/v/pq-key-encoder)](https://crates.io/crates/pq-key-encoder)
4+
[![docs.rs](https://img.shields.io/docsrs/pq-key-encoder)](https://docs.rs/pq-key-encoder)
5+
[![CI](https://github.com/multivmlabs/post-quantum-packages/actions/workflows/ci.yml/badge.svg)](https://github.com/multivmlabs/post-quantum-packages/actions/workflows/ci.yml)
6+
[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
7+
[![MSRV](https://img.shields.io/badge/MSRV-1.78-blue.svg)](https://blog.rust-lang.org/2024/05/02/Rust-1.78.0.html)
8+
39
Zero-dependency\* post-quantum key encoding library for Rust. Encodes and decodes **ML-KEM**, **ML-DSA**, and **SLH-DSA** keys across DER (SPKI/PKCS#8), PEM, and JWK formats.
410

511
\*Only depends on [`pq-oid`](https://crates.io/crates/pq-oid) and [`zeroize`](https://crates.io/crates/zeroize).
@@ -148,6 +154,11 @@ let key = Key::from_pem(&pem_string)?;
148154
- `PrivateKey::into_bytes()` returns `Zeroizing<Vec<u8>>` for safe ownership transfer
149155
- `PrivateJwk` fields are zeroized on drop
150156
- Base64 decoding enforces **strict padding** validation
157+
- JWK parser **rejects duplicate fields** to prevent key confusion attacks
158+
- JWK parsing enforces **resource limits** to prevent denial-of-service:
159+
- Input size capped at **64 KiB**
160+
- Field count capped at **32**
161+
- Nesting depth capped at **8**
151162

152163
## Design
153164

@@ -157,6 +168,14 @@ let key = Key::from_pem(&pem_string)?;
157168
- **No format-specific dependencies** — DER, PEM, base64, and JSON are all hand-rolled with minimal code
158169
- OID matching uses **raw DER byte comparison** against compile-time constants (no string allocation)
159170

171+
## Minimum Supported Rust Version
172+
173+
This crate requires **Rust 1.78** or later. The MSRV is tested in CI and will only be bumped in minor or major version releases.
174+
175+
## Contributing
176+
177+
Contributions are welcome! Please open an issue or submit a pull request on [GitHub](https://github.com/multivmlabs/post-quantum-packages).
178+
160179
## License
161180

162181
MIT

0 commit comments

Comments
 (0)