//! 消息鉴别码(Message Authentication Code) //! //! 利用对称密码技术,以密钥为参数,由消息导出的数据项。任何持有这一密钥的实体,都可利用消息鉴别码检查消息的完整性和始发者。\ //! In cryptography, a message authentication code (MAC), sometimes known as an authentication tag, //! is a short piece of information used for authenticating and integrity-checking a message. //! In other words, to confirm that the message came from the stated sender (its authenticity) and has not been changed (its integrity). //! The MAC value allows verifiers (who also possess a secret key) to detect any changes to the message content. //! //! # HMAC //! //! 密钥杂凑消息鉴别码是一种通过特别计算方式之后产生的消息鉴别码,使用密码杂凑函数,同时结合一个加密密钥。 //! 它可以用来保证资料的完整性,同时可以用来作某个消息的身份验证。\ //! In cryptography, an HMAC is a specific type of message authentication code (MAC) //! involving a cryptographic hash function and a secret cryptographic key. //! As with any MAC, it may be used to simultaneously verify both the data integrity and authenticity of a message. #[cfg(feature="hmac")] mod hmac; #[cfg(feature="hmac")] mod hmac_block; pub use self::hmac::HMAC; #[cfg(all(feature="hmac", feature="sm3"))] #[cfg_attr(docsrs, doc(cfg(all(feature="hmac", feature="sm3"))))] pub use self::hmac_block::hmac_sm3; #[cfg(all(feature="hmac", feature="insecure_md5"))] #[cfg_attr(docsrs, doc(cfg(all(feature="hmac", feature="insecure_md5"))))] pub use self::hmac_block::hmac_md5; #[cfg(all(feature="hmac", feature="insecure_sha1"))] #[cfg_attr(docsrs, doc(cfg(all(feature="hmac", feature="insecure_sha1"))))] pub use self::hmac_block::hmac_sha1; #[cfg(all(feature="hmac", feature="sha2"))] #[cfg_attr(docsrs, doc(cfg(all(feature="hmac", feature="sha2"))))] pub use self::hmac_block::{hmac_sha224, hmac_sha256, hmac_sha384, hmac_sha512, hmac_sha512_224, hmac_sha512_256};