Releases: kintaiW/libsmx
Releases · kintaiW/libsmx
Release list
vv0.2.1
Added
- SM2 key exchange (
sm2::key_exchangemodule)exchange_a/exchange_b: GB/T 32918.3 full key exchange protocol with confirmation hashecdh: Simple SM2-ECDH shared secret computation (TLS/rustls compatible)ecdh_from_slice: Slice-based ECDH for TLS integrationEphemeralKey: Ephemeral key pair withZeroizeOnDrop
- SM2 DER codec (
sm2::dermodule)sig_to_der/sig_from_der: Signature DER encoding/decodingprivate_key_from_sec1_der: RFC 5915 SEC1 private key parsingprivate_key_from_pkcs8_der: RFC 5958 PKCS#8 private key parsing
- SM2 convenience API (
sm2module)sign_message/verify_message: One-step sign/verify with automatic Z-value computation
- HKDF-SM3 (
sm3::hkdfmodule)hkdf_extract/hkdf_expand/hkdf: RFC 5869 compatible
- SM3 Hasher enhancements
reset()/finalize_reset(): Streaming hasher reuse
- SM4 AEAD combined format
sm4_encrypt_gcm_combined/sm4_decrypt_gcm_combined: TLS format (ciphertext||tag)sm4_encrypt_ccm_combined/sm4_decrypt_ccm_combined: Same format for CCM
- BLS signatures (
blsmodule, requiresallocfeature)bls_keygen/bls_sign/bls_verify: minimal-signature-size variant (sig ∈ G1, pk ∈ G2)bls_aggregate/bls_aggregate_verify: multi-message aggregate signaturesbls_fast_aggregate_verify: fast aggregate verification for same-message multi-signerBlsSignature::to_bytes/from_bytes: 65-byte serialization (uncompressed G1 point)BlsPubKey::to_bytes/from_bytes: 128-byte serialization (uncompressed G2 point)
- BLS threshold signatures (
bls::thresholdmodule)bls_threshold_keygen: Trusted Dealer mode, Shamir polynomial secret sharingbls_partial_sign/bls_combine_signatures: Lagrange interpolation based aggregation- Supports (t+1, n) threshold configurations
- Hash-to-Curve (
bls::hash_to_curvemodule)hash_to_g1: RFC 9380 compliant, maps arbitrary message to BN256 G1 pointexpand_message_xmd: RFC 9380 §5.3.1, message expansion using SM3 as hashmap_to_curve_svdw: Shallue-van de Woestijne mapping for BN256 (a=0 curve)
fp_sqrtinsm9::fields::fp- Tonelli-Shanks modular square root for SM9 BN256 Fp (p ≡ 1 mod 4)
fp_is_square: Euler criterion based quadratic residue test
- FPE format-preserving encryption (
fpemodule)FpeKey: 7-round Luby-Rackoff Feistel cipher based on SM4- Supports 1~128 bit plaintext/ciphertext domains
expand_tweak: arbitrary-length tweak via SM4 hash- Automatic key zeroization on drop (
ZeroizeOnDrop)
Security
- BLS signature DST separation: signing uses
BLS_SIG_SM9G1_XMD:SM3_SVDW_RO_NUL_, PoP uses a different tag - BN256 security note: ~100-bit actual security level documented in API docs
vv0.2.0
vv0.1.1
Fixed
- Fixed
cargo test --no-default-features --libcompilation error- SM3 tests: removed alloc dependency, use manual hex parsing
- SM4 modes tests: added
#[cfg(feature = "alloc")]
Changed
- MSRV raised to 1.83.0 (required by crypto-bigint 0.6.x for ConstMontyForm constant-time Montgomery arithmetic)
- Use Rust 1.83+ built-in
div_ceilmethod instead of manual implementation
CI
- Optimized sanity_check.sh to skip test code, avoiding false positives