Skip to main content

Module guomi

Module guomi 

Source
Expand description

国密实现(对应 PHP 版 Guomi/):SM3 哈希、SM4-CBC 与 SM4-GCM、ZUC-128 / ZUC-256 流密码、SM2 非对称加解密与签名 / 验签,以及不提供实现的 SM1 / SM7 / SM9 占位。

Re-exports§

pub use sm2::DEFAULT_DIST_ID;
pub use sm2::KeyPairHex;
pub use sm2::Sm2AsymmetricCipher;
pub use sm2::Sm2Service;
pub use sm2::Sm2Signer;
pub use sm4::Sm4CbcEncryptor;

Modules§

unavailable
SM1 / SM7 / SM9 在公开生态中无标准实现:调用下列函数将返回明确的 Error::UnsupportedNationalAlgorithm,便于在业务层统一捕获或接入 厂商 SDK / 加密机。

Structs§

Sm2AsymmetricCipher
SM2 非对称加密器(实现 AsymmetricCipher;行为与 Sm2Service 一致)。
Sm2Service
SM2 静态门面(对应 PHP 版 Sm2EncryptionService)。
Sm2Signer
SM2 签名器(实现 Signer;行为与 Sm2Service::sign / Sm2Service::verify 一致)。
Sm3Hasher
SM3 哈希器(无状态,可复用)。
Sm4GcmEncryptor
SM4-GCM 加密器。
Zuc128Encryptor
ZUC-128 加密器。
Zuc256Encryptor
ZUC-256 加密器。

Constants§

DEFAULT_DIST_ID
签名 / 验签的用户标识(ZA 计算中的 ID),签名方与验签方必须一致。