Files
libsmx/sm2/Cargo.toml
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

36 lines
1.3 KiB
TOML

[package]
name = "sm2"
version = "0.1.0"
edition = "2021"
rust-version = "1.83.0"
license = "Apache-2.0"
description = "SM2 (ShangMi 2) elliptic curve cryptography — signature, encryption, key exchange (GB/T 32918-2016). Pure-Rust, no_std."
repository = "https://github.com/kintaiW/libsmx"
documentation = "https://docs.rs/sm2"
readme = "README.md"
categories = ["cryptography", "no-std"]
keywords = ["crypto", "ecc", "sm2", "shangmi", "signature"]
[dependencies]
# SM3 is used by SM2 for Z-value and message digest computation
sm3 = { path = "../sm3" }
# digest::Digest + Update traits (re-exported by sm3, but listed explicitly for clarity)
digest = { workspace = true }
crypto-bigint = { version = "0.6", default-features = false }
subtle = { workspace = true }
zeroize = { workspace = true }
rand_core = { version = "0.6", default-features = false, features = ["getrandom"] }
# signature trait integration
signature = { workspace = true }
[dev-dependencies]
hex-literal = { workspace = true }
rand = { version = "0.8", default-features = false, features = ["std_rng"] }
[features]
default = ["alloc"]
# alloc: required for encrypt/decrypt (Vec-based ciphertext) and DER encoding
alloc = []
# hazmat: exposes sign_with_k (dangerous raw-k API, for testing only)
hazmat = []