Skip to content

v0.1.3

Choose a tag to compare

@shaogme shaogme released this 21 Jul 07:44
· 37 commits to master since this release
971c65c

What's Changed

  • 密码学参数 Trait 统一与重构 (Trait Unification and Refactoring for Cryptographic Parameters) by @ShaoG-R in #36
  • 将 seal-crypto 的版本号从 0.1.2 更新至 0.1.3。 by @ShaoG-R in #38

新特性与重构 | New Features & Refactoring

1. 密码学参数 Trait 统一与重构 (Trait Unification and Refactoring for Cryptographic Parameters)

为了提高代码库的一致性和抽象性,我们对密码学方案的参数定义方式进行了一系列重构。

To improve the consistency and abstraction of the codebase, a series of refactorings were carried out on how cryptographic scheme parameters are defined.

  • 引入 SchemeParams Trait (Introduced SchemeParams Trait)

    • 中文: 新增了 SchemeParams trait (src/traits/params.rs),为所有遵循标记分发模式(marker dispatch pattern)的加密方案提供了一个统一的基础。该 trait 包含了 NAME 和 ID 两个核心常量。
    • English: A new SchemeParams trait has been introduced in src/traits/params.rs to provide a unified base for all cryptographic schemes that follow the marker dispatch pattern. This trait includes the core NAME and ID constants.
    • 影响范围 (Affected Schemes):
      • AesGcmParams (symmetric/aes_gcm.rs)
      • Chacha20Poly1305Params (symmetric/chacha20_poly1305.rs)
      • DilithiumParams (asymmetric/post_quantum/dilithium.rs)
      • KyberParams (asymmetric/post_quantum/kyber.rs)
      • EccParams (asymmetric/traditional/ecc.rs)
      • EcdhParams (asymmetric/traditional/ecdh.rs)
  • 引入 Parameterized Trait (Introduced Parameterized Trait)

    • 中文: 针对 KDF, XOF, RSA 等具有不同参数化模式(运行时字段或编译时泛型)的方案,新增了 Parameterized trait。它提供了 get_type_params() 和 get_instance_params(&self) 方法,允许在运行时对方案的完整参数集进行内省。
    • English: For schemes with different parameterization patterns (e.g., runtime fields or compile-time generics) such as KDF, XOF, and RSA, a new Parameterized trait was introduced. It provides get_type_params() and get_instance_params(&self) methods, allowing for runtime introspection of a scheme's full parameter set.
    • 影响范围 (Affected Schemes):
      • Argon2Scheme (kdf/argon2.rs)
      • HkdfScheme (kdf/hkdf.rs)
      • Pbkdf2Scheme (kdf/pbkdf2.rs)
      • ShakeScheme (xof/shake.rs)
      • RsaScheme (asymmetric/traditional/rsa.rs)
  • 引入 PrimitiveParams Trait (Introduced PrimitiveParams Trait)

    • 中文: 新增了 PrimitiveParams trait,用于统一 Hasher 和 XOF 等底层密码学原语的参数定义。该 trait 包含了 NAME 和 ID_OFFSET 两个常量。Hasher 和 Xof trait 现已继承自 PrimitiveParams,减少了代码重复。
    • English: A new PrimitiveParams trait was introduced to unify the parameter definitions for underlying cryptographic primitives like Hasher and Xof. This trait includes the NAME and ID_OFFSET constants. The Hasher and Xof traits now inherit from PrimitiveParams, reducing code duplication.
    • 影响范围 (Affected Traits):
      • Hasher trait
      • Xof trait
  • 模块结构调整 (Module Structure Adjustment)

    • 中文: 为了进一步提高模块的内聚性和清晰度,原有的 src/traits/hash.rs 文件被拆分。Hasher 相关的 trait 和实现被移动到 src/traits/params/hash.rs,而 Xof 相关的部分则被移动到 src/traits/params/xof.rs。
    • English: To further improve module cohesion and clarity, the original src/traits/hash.rs file was split. The Hasher-related traits and implementations were moved to src/traits/params/hash.rs, while the Xof-related parts were moved to src/traits/params/xof.rs.
    • 影响范围 (Affected Modules):
      • traits::hash (deleted)
      • traits::params::hash (new)
      • traits::params::xof (new)

Full Changelog: v0.1.2...v0.1.3