Conversation
35458b1 to
b4decd7
Compare
vadmeste
reviewed
Apr 28, 2026
This commit adds support for AES-128-GCM.
Therefore, this commit changes the public API constant
`AES_256_GCM` to `AES_GCM`.
When a 128 bit key is provided, AES-GCM is instantiated as AES-128-GCM
and for ChaCha20Poly1305, the 128 bit key is simply repeated to make
it 256 bit long.
For AES-GCM, this gives a 10% performance improvment.
```
goos: darwin
goarch: arm64
pkg: github.com/minio/sio
cpu: Apple M4
│ /tmp/old.txt │ /tmp/new.txt │
│ sec/op │ sec/op vs base │
DecryptReader_1MB-10 3.064m ± ∞ 2.778m ± ∞ -9.32% (p=0.029 n=4)
│ /tmp/old.txt │ /tmp/new.txt │
│ B/s │ B/s vs base │
DecryptReader_1MB-10 15.94Gi ± ∞ 17.58Gi ± ∞ +10.28% (p=0.029 n=4)
│ /tmp/old.txt │ /tmp/new.txt │
│ B/op │ B/op vs base │
DecryptReader_1MB-10 15.92Ki ± ∞ 15.76Ki ± ∞ ~ (p=0.200 n=4)
│ /tmp/old.txt │ /tmp/new.txt │
│ allocs/op │ allocs/op vs base │
DecryptReader_1MB-10 813.0 ± ∞ 813.0 ± ∞ ~ (p=1.000 n=4)
```
Signed-off-by: Andreas Auernhammer <git@aead.dev>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit adds support for AES-128-GCM.
Therefore, this commit changes the public API constant
AES_256_GCMtoAES_GCM.When a 128 bit key is provided, AES-GCM is instantiated as AES-128-GCM and for ChaCha20Poly1305, the 128 bit key is simply repeated to make it 256 bit long.
For AES-GCM, this gives a 10% performance improvment.