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 摘要。