libsm icon indicating copy to clipboard operation
libsm copied to clipboard

A Rust Library of China's Standards of Encryption Algorithms (SM2/3/4)

Results 7 libsm issues
Sort by recently updated
recently updated
newest added

我发现ecc.rs的创建点乘表table1和table2时,采用了lazy_static方法,这种方法在被第一次调用时会展开,这步大概需要3~5秒的时间,这里可以直接把两个表512个点(大概2M)写入到文件中,可以显著提高第一次调用该方法的效率

pr #45 and issues #37 both mention that loading gmul_table from disk is an elegant way. In this pr, I modify the g_table function, introduced Serde crate to serialize the...

You can use this crates in WebAssembly. Currently, you only need to add dependencies: ```toml # Cargo.toml getrandom = { version = "^0.2", features = ["js"] } ``` See [getrandom#WebAssembly...

`pub fn decrypt(&self, cipher: &[u8]) -> Sm2Result` 方法 转 c_1_point 时,如果遇到异常能否“透传”出来? 最好 `let c_1_point = self.curve.bytes_to_point(c_1_bytes).unwrap();` 这里可以不要直接 unwrap(), 能把这里的异常也 return 出来。 现在,这里面的 `Sm2Error::InvalidPublic` `Sm2Error::NotOnCurve` 等,外层好像没法处理。

为了将Sm3Hash用于[hmac](https://docs.rs/hmac)库,需要实现[digest](https://docs.rs/digest)中的相关trait: ![image](https://github.com/citahub/libsm/assets/3446306/a39ef55f-15f4-404e-9372-1d92613bcccf)

SM4-CTR can be optimized by utilizing AES-NI. 代码参考 [Tongsuo](https://github.com/Tongsuo-Project/Tongsuo) 项目实现,迁移到 rust 语言 [参考代码](https://github.com/Tongsuo-Project/Tongsuo/pull/356/files) 此功能基于 Markku-Juhani O. Saarinen 的理论:[sm4ni](https://github.com/mjosaarinen/sm4ni)