Files
libsmx/Cargo.toml
T
huangxt a4ca734d0d 重构:RustCrypto 兼容接口
主要变更:
- 新增 sm2/、sm3/、sm4/ 独立 crate,实现 RustCrypto traits
  - sm2:实现 signature、elliptic-curve traits
  - sm3:实现 digest、crypto-common traits
  - sm4:实现 cipher、aead traits
- 新增 fuzz/ 模糊测试目标
- 新增 tests/sm2_proptest.rs 属性测试
- 重构 src/sm4/ 使用 RustCrypto AEAD traits
- 更新 CI 工作流支持多 crate 测试
- 更新 .gitignore 忽略 fuzz/target/
2026-03-11 18:32:21 +08:00

94 lines
3.2 KiB
TOML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# ── Workspace 配置 ──────────────────────────────────────────────────────────
[workspace]
resolver = "2"
members = [
".", # libsmx (现有单体 crate,保持向后兼容)
"sm2", # SM2 独立 crate(实现 signature::Signer/Verifier
"sm3", # SM3 独立 crate(实现 digest::Digest
"sm4", # SM4 独立 crate(实现 cipher::BlockCipher
]
[workspace.dependencies]
digest = { version = "0.11.1", default-features = false }
cipher = { version = "0.5.1", default-features = false }
subtle = { version = "2.6", default-features = false }
zeroize = { version = "1.8", default-features = false, features = ["derive"] }
signature = { version = "2.2", default-features = false }
hex-literal = "0.4"
# ── libsmx Package 配置(保留现有不变)────────────────────────────────────
[package]
name = "libsmx"
version = "0.3.0"
edition = "2021"
rust-version = "1.83.0"
authors = ["kintai <kintai@foxmail.com>"]
license = "Apache-2.0"
description = "Pure-Rust, no_std, constant-time SM2/SM3/SM4/SM9 Chinese cryptography (GB/T 32918/32905/32907/38635)"
repository = "https://github.com/kintaiW/libsmx"
documentation = "https://docs.rs/libsmx"
homepage = "https://kintaiw.github.io/libsmx/"
categories = ["cryptography", "no-std"]
keywords = ["sm2", "sm3", "sm4", "sm9", "cryptography"]
readme = "README.md"
exclude = [
"benches/",
"tests/",
"docs/",
".github/",
"scripts/",
"reference/",
"*.sh",
"*.md",
"!README.md",
"!CHANGELOG.md",
"!SECURITY.md",
".claude*",
]
[lib]
name = "libsmx"
path = "src/lib.rs"
[dependencies]
crypto-bigint = { version = "0.6", default-features = false }
subtle = { version = "2.6", default-features = false }
zeroize = { version = "1.8", default-features = false, features = ["derive"] }
rand_core = { version = "0.6", default-features = false }
rustls = { git = "https://github.com/rustls/rustls.git", branch = "main", optional = true, default-features = false }
pki-types = { package = "rustls-pki-types", version = "1", optional = true, features = ["alloc"] }
getrandom = { version = "0.2", optional = true }
[features]
default = ["alloc"]
alloc = []
std = ["alloc", "rand_core/std"]
# rustls CryptoProvider 集成(RFC 8998 国密 TLS 套件)
rustls-provider = ["alloc", "dep:rustls", "dep:pki-types", "dep:getrandom"]
[dev-dependencies]
hex = "0.4"
criterion = { version = "0.5", features = ["html_reports"] }
rand = "0.8"
sm9_core = "0.5.0"
proptest = { version = "1", default-features = false, features = ["alloc"] }
# rustls-provider 集成测试依赖(通过 feature 条件编译保护)
rustls = { git = "https://github.com/rustls/rustls.git", branch = "main", default-features = false, features = ["log", "webpki"] }
pki-types = { package = "rustls-pki-types", version = "1", features = ["alloc"] }
[[bench]]
name = "sm2_bench"
harness = false
[[bench]]
name = "sm3_bench"
harness = false
[[bench]]
name = "sm4_bench"
harness = false
[[bench]]
name = "sm9_bench"
harness = false