Replace `subtle` with `ctutils`?

未关闭
#29 1 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

@newpavlov 已经在做这个了。

开始于 2025年12月27日。

评估

这个 Issue 还没有评估数据。

描述

I've written a modern replacement for subtle which uses the cmov crate to support constant-time predication instructions (cmov/csel families) via asm!, along with a portable "best effort" fallback similar to what subtle was doing before:

https://github.com/RustCrypto/utils/tree/master/ctutils

It's also an extraction of what we had built in crypto-bigint as a sort of half-baked subtle replacement to work around many issues we were having with subtle, including lack of const fn support, and the inability to support heap-allocated types due to copy bounds. I am in the process of completely switching crypto-bigint over to ctutils (while maintaining optional backwards compatibility with subtle, in part through the subtle interop built into ctutils). Preliminary benchmarking in crypto-bigint has not shown notable performance changes, either.

I've tried making some of these changes upstream to subtle, but it seems somewhat unmaintained at this point, and with an entrenched userbase making breaking changes seems difficult:

ctutils is otherwise mostly an easy drop-in replacement for subtle, and I think we could potentially adopt it in the places we are currently using subtle so as to have a maintained, in-org crate which should theoretically provide better guarantees on most modern platforms. I've just released v0.2.0 and I think it's ready to begin adopting.

主要语言
没有语言数据
星标
13
派生
4
平均合并
41 分钟
30 天内合并 PR
1

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

RustCrypto/meta 的其他 Issue

查看 RustCrypto/meta 的全部 Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。