feat(crypt):完成3DES加密算法的工具函数。

This commit is contained in:
徐涛
2023-07-02 17:56:12 +08:00
parent 56fef4c3de
commit 551209d4f1
4 changed files with 134 additions and 5 deletions

View File

@@ -4,7 +4,7 @@ use des::Des;
type DesEncryptor = cbc::Encryptor<Des>;
type DesDecryptor = cbc::Decryptor<Des>;
/// 利用Sha512生成24字节的密钥
/// 利用Sha512生成8字节的密钥
///
/// - `key` 原始密钥
fn generate_key<T: AsRef<[u8]>>(key: T) -> [u8; 8] {