encryption-rust 1.3.0

可插拔密码学组件库的 Rust 实现:在统一契约下提供对称加密、非对称加密、哈希、密钥派生(HKDF / PBKDF2 / Argon2 / scrypt)、签名(SM2 / ECDSA / Ed25519)、密钥协商(ECDH / X25519)与后量子密钥封装(ML-KEM),包含 AES/Sodium 与国密 SM2/SM3/SM4/ZUC 等实现
Documentation
# encryption-rust CI:stable 全量测试、MSRV 守护、依赖安全审计
name: CI

on:
  push:
    branches: [main]
  pull_request:
    branches: [main]
  schedule:
    # 每周一 05:17 UTC 触发(只影响 audit job)
    - cron: "17 5 * * 1"

jobs:
  # stable 工具链:格式 → clippy(全 feature,警告即错误)→ 测试(全 feature)
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
        with:
          # 该 action 默认只装 minimal profile,fmt/clippy 需显式声明
          components: rustfmt, clippy
      - uses: Swatinem/rust-cache@v2
      - run: cargo fmt --check
      - run: cargo clippy --all-features --all-targets -- -D warnings
      - run: cargo test --all-features

  # 守 Cargo.toml 声明的 rust-version = 1.88;
  # 不带 --all-features:8 个框架依赖自身的 MSRV 可能高于 1.88
  msrv:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@1.88.0
      - run: cargo check

  # RustSec 安全审计:仅 push 与每周 cron 运行,PR 上跳过
  audit:
    runs-on: ubuntu-latest
    if: github.event_name != 'pull_request'
    # audit-check 需要 checks: write 落检查结果、issues: write 在发现漏洞时建 issue
    permissions:
      contents: read
      checks: write
      issues: write
    steps:
      - uses: actions/checkout@v4
      - uses: rustsec/audit-check@v2
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          # RUSTSEC-2026-0258(h2 0.3.27 无界空 DATA 帧,低危):由 actix-http 3.18
          # 与 rocket_http 0.5 传递引入(均为可选框架依赖);h2 0.3 线已停止维护、
          # 该公告只修 >=0.4.16,锁内另一份 h2 0.4.19 已是修补版。
          # 待 actix-web / rocket 迁到 hyper 1.x 后删除本条。
          #
          # RUSTSEC-2023-0071(rsa 0.9.10「Marvin」时序侧信道,CVSS AV:N/AC:H):
          # 上游至今无补丁(patched = [],0.9.10 与 0.10.0-rc 均受影响;RSA#626/#680/#702
          # 跟踪中)。本库的 rsa-oaep-sha256 解密固定走 decrypt_blinded(公告承认的缓解
          # 方向),且已在模块文档、SECURITY.md 与 README 标注「网络暴露场景优先
          # ECDH / X25519 / Ed25519 / ML-KEM」。待 rsa crate 落地常量时间填充、
          # 或本库移除该算法后删除本条。
          ignore: RUSTSEC-2026-0258,RUSTSEC-2023-0071