Move crypto fallback logic to cryptobackend
@qmuntal is already working on this.
Since Sep 3, 2026.
- Dominant language
- Go
- Stars
- 431
- Forks
- 44
- Avg merge
- 21h 18m
- Merged PRs (30d)
- 30
Description
Ideally patching the crypto packages to support our crypto backends would be a matter of replacing the crypto/internal/fips140/... imports for github.com/microsoft/go/cryptobackend/....
We have already changed the cryptobackend packages layout to match fips140 1:1. The next piece is moving the fallback logic (all these cryptobackend.SupportsX calls) into the cryptobackend itself. Note that this should be possible in most of the cases because we have patched the linker to allow cryptobackend to call crypto/internal packages even when it being outside of the standard library.
The end goal is to replace this:
import (
"crypto/internal/fips140/sha256"
"github.com/microsoft/go/cryptobackend"
bsha256 "github.com/microsoft/go/cryptobackend/sha256"
)
func New224() hash.Hash {
if cryptobackend.Enabled && sha256.SupportsSHA224() {
return sha256.NewSHA224()
}
return sha256.New224()
}
into this:
import (
sha256 "github.com/microsoft/go/cryptobackend/sha256"
)
func New224() hash.Hash {
return sha256.New224()
}
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.