Replace `subtle` with `ctutils`?

Aberta
#29 1 comentário 0 reações 1 responsável Ver no GitHub

@newpavlov já está trabalhando nisso.

Desde 27/12/2025.

Avaliação

Esta issue ainda não foi avaliada.

Descrição

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.

Linguagem predominante
Sem dados de linguagem
Estrelas
13
Forks
4
Merge médio
41min
PRs com merge (30d)
1

Preparar o ambiente

Este projeto não oferece contêiner de desenvolvimento, Dockerfile nem guia de contribuição, então a configuração fica por sua conta: comece pelo README e veja nosso guia da primeira contribuição para os passos gerais.

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de RustCrypto/meta

Todas as issues de RustCrypto/meta

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.