feat: init commit, fork from libsm

This commit is contained in:
2023-10-22 13:56:53 +08:00
parent 8a0abd0048
commit bcd06779ca
28 changed files with 4167 additions and 0 deletions

20
docs/sm3.md Normal file
View File

@@ -0,0 +1,20 @@
# SM3
SM3 is a hash function. To use SM3 in libsm:
1. Make sure that your data is `&[u8]`.
2. Create a `SM3Hash`.
3. Get the digest.
Sample:
```rust
use libsm::sm3::Sm3Hash;
let string = String::from("sample");
let mut hash = Sm3Hash::new(string.as_bytes());
let digest: [u8;32] = hash.get_hash();
```