安全加固:常量时间改进与侧信道缓解

- SM2: 常量时间标量乘法、点验证和域运算
- SM3: 常量时间填充和长度处理
- SM4: bitslice S-box 实现,避免缓存时序攻击
- SM4 模式: 常量时间 CBC 填充和标签比较
- SM9: 常量时间 Fp12 求逆和哈希到标量
- 添加 zeroize 用于私钥清理
- 改进错误处理,使用常量时间比较
This commit is contained in:
huangxt
2026-03-07 15:28:02 +08:00
parent e929e6a103
commit 7ec2580514
8 changed files with 412 additions and 158 deletions
+3
View File
@@ -48,6 +48,9 @@
#[cfg(feature = "alloc")]
extern crate alloc;
#[cfg(feature = "std")]
extern crate std;
pub mod error;
pub mod sm2;
pub mod sm3;