Skip to content

v0.1.4

Choose a tag to compare

@shaogme shaogme released this 21 Jul 14:23
· 25 commits to master since this release
4e9a7cb

What's Changed

  • V0.1.4 by @ShaoG-R in #39
  • v0.1.4 by @ShaoG-R in #40

新特性与重构 | New Features & Refactoring

1. 签名类型简化 (Signature Type Simplification)

为了提升 Signature 类型在不同库之间的互操作性并简化其使用,我们将其从一个包装 Vec<u8> 的结构体 (struct) 重构为一个类型别名 (type alias)。

To enhance the interoperability of the Signature type across different libraries and simplify its usage, we have refactored it from a struct wrapping Vec<u8> to a simple type alias.

  • 将 Signature 重构为类型别名 (Refactored Signature to a Type Alias)
    • 中文: Signature 结构体已变更为 Vec<u8> 的类型别名。此项变更移除了原有的包装结构体,简化了 API,使得与其他处理原始字节签名的库集成变得更加容易。同时,通过移除之前的 Deref、DerefMut、AsRef 等 trait 实现,减少了模板代码,使签名数据可以直接作为 Vec<u8> 使用。
    • English: The Signature struct has been converted into a type alias for Vec<u8>. This change removes the wrapper struct, simplifying the API and making it easier to integrate with other libraries that work with raw byte signatures. It also reduces boilerplate code by removing previous Deref, DerefMut, AsRef, and other trait implementations, allowing signature data to be used directly as a Vec<u8>.
    • 影响范围 (Affected Modules):
      • src/traits/asymmetric.rs
      • src/systems/asymmetric/traditional/ecc.rs
      • src/systems/asymmetric/traditional/rsa.rs
      • src/systems/asymmetric/post_quantum/dilithium.rs

2. DerivedKey 结构体功能增强 (Enhanced DerivedKey Struct Functionality)

为了提高密钥派生函数 (KDF) 生成的派生密钥的灵活性和安全性,我们对 DerivedKey 结构体进行了功能增强。

To improve the flexibility and security of keys generated by Key Derivation Functions (KDF), we have enhanced the functionality of the DerivedKey struct.

  • 实现 Key Trait 并增加序列化支持 (Implemented Key Trait and Added Serialization Support)
    • 中文: DerivedKey 现已实现 Key trait,使其能够与框架内的其他密钥类型一样,通过 from_bytes 和 to_bytes 方法进行统一处理。此外,我们还为其增加了可选的 serde 支持(通过 Serialize 和 Deserialize derive 宏),提升了其在序列化和安全存储场景下的应用能力。
    • English: DerivedKey now implements the Key trait, allowing it to be handled uniformly with other key types in the framework through from_bytes and to_bytes methods. Additionally, optional serde support (via Serialize and Deserialize derive macros) has been added, enhancing its applicability in serialization and secure storage scenarios.
    • 影响范围 (Affected Modules):
      • src/traits/kdf.rs

文档更新 | Documentation Updates

3. 新增重要使用说明 (Added Important Usage Note)

为了引导用户更安全、更有效地使用 seal-crypto,我们在项目的 README 文件中增加了一段重要的使用说明。

To guide users in using seal-crypto more safely and effectively, we have added an important usage note to the project's README files.

  • 推荐使用高级封装库 seal-crypto-wrapper (Recommendation to Use High-Level Wrapper seal-crypto-wrapper)
    • 中文: 在 README.md 和 README_CN.md 文件中明确指出,seal-crypto 是一个底层加密引擎。对于大多数应用,我们强烈建议使用其高级封装库 seal-crypto-wrapper。该封装库提供了更安全、更易用的 API,能有效避免常见的加密误用。
    • English: It is now clearly stated in README.md and README_CN.md that seal-crypto is a low-level cryptographic engine. For most applications, we strongly recommend using its high-level wrapper library, seal-crypto-wrapper. The wrapper provides a safer, more user-friendly API that helps prevent common cryptographic misuses.
    • 影响范围 (Affected Files):
      • README.md
      • README_CN.md

4. 全面的代码注释覆盖 (Comprehensive Code Comment Coverage)

为了提高代码的可读性和可维护性,我们对核心逻辑代码进行了全面的文档注释完善。

To improve code readability and maintainability, we have comprehensively updated the documentation comments for the core logic.

  • 完善 src 目录下核心代码的文档注释 (Improved Doc Comments for Core Code in src)
    • 中文: 我们对 src/ 目录下的代码进行了全面的文档注释(doc comments)完善。超过 90% 的文件都增加了详细的中文和英文注释,解释了模块、trait、函数和数据结构的核心功能与设计理念。
    • English: We have comprehensively updated the documentation comments for the code under the src/ directory. Over 90% of the files now have detailed English and Chinese comments explaining the core functionality and design principles of modules, traits, functions, and data structures.
    • 影响范围 (Affected Scope):
      • src/**/*.rs

Full Changelog: v0.1.3...v0.1.4