10 releases

0.5.0-pre.3 Feb 1, 2024
0.5.0-pre.2 Jan 17, 2024
0.4.2 May 16, 2023
0.4.1 Feb 17, 2022
0.1.0 Jan 14, 2020

#2282 in Cryptography

Download history 3408/week @ 2023-11-20 2999/week @ 2023-11-27 2480/week @ 2023-12-04 2774/week @ 2023-12-11 2571/week @ 2023-12-18 3060/week @ 2023-12-25 2096/week @ 2024-01-01 5579/week @ 2024-01-08 4424/week @ 2024-01-15 5128/week @ 2024-01-22 5250/week @ 2024-01-29 4540/week @ 2024-02-05 3098/week @ 2024-02-12 5076/week @ 2024-02-19 4299/week @ 2024-02-26 4628/week @ 2024-03-04

17,638 downloads per month
Used in 18 crates (14 directly)

MIT/Apache

17KB
333 lines

RustCrypto: SM3

crate Docs Apache2/MIT licensed Rust Version Project Chat Build Status

Pure Rust implementation of the SM3 cryptographic hash function defined in OSCCA GM/T 0004-2012.

Examples

use sm3::{Digest, Sm3};
use hex_literal::hex;

let mut hasher = Sm3::new();
hasher.update(b"hello world");
let hash = hasher.finalize();

assert_eq!(hash, hex!("44f0061e69fa6fdfc290c494654a05dc0c053da7e5c52b84ef93a9d67d3fff88"));

Also, see the examples section in the RustCrypto/hashes readme.

Minimum Supported Rust Version

Rust 1.71 or higher.

Minimum supported Rust version can be changed in the future, but it will be done with a minor version bump.

SemVer Policy

  • All on-by-default features of this library are covered by SemVer
  • MSRV is considered exempt from SemVer as noted above

License

The crate is licensed under either of:

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~280–440KB
~10K SLoC