Skip to content

Remove use of deprecated "raw" poly1305 package - #150

Open
joshuaoco wants to merge 1 commit into
WireGuard:masterfrom
joshuaoco:joshua/remove-poly1305-dependency
Open

Remove use of deprecated "raw" poly1305 package#150
joshuaoco wants to merge 1 commit into
WireGuard:masterfrom
joshuaoco:joshua/remove-poly1305-dependency

Conversation

@joshuaoco

Copy link
Copy Markdown

The poly1305 package is marked explicitly as deprecated for general use, and while our usage here is trivial (a single constant), we might as well use the blessed chacha20poly1305 alternative.

The only change is poly1305.TagSize -> chacha20poly1305.Overhead.
This exact swap is recommended in the poly1305 package.

// TagSize is the size, in bytes, of a poly1305 authenticator.
//
// For use with golang.org/x/crypto/chacha20poly1305, chacha20poly1305.Overhead
// can be used instead.
const TagSize = 16

I also think it reads more clearly now :)

@joshuaoco
joshuaoco force-pushed the joshua/remove-poly1305-dependency branch from a9294de to 5d3841c Compare July 19, 2026 07:51
The poly1305 package is marked explicitly as deprecated for general
use, and while our usage here is trivial (a single constant), we might
as well use the blessed chacha20poly1305 alternative.

The only change is poly1305.TagSize -> chacha20poly1305.Overhead.
This exact swap is recommended in the poly1305 package.

```
// TagSize is the size, in bytes, of a poly1305 authenticator.
//
// For use with golang.org/x/crypto/chacha20poly1305, chacha20poly1305.Overhead
// can be used instead.
const TagSize = 16
```

I also think it reads more clearly now :)

Signed-off-by: Joshua O'Connor <joshua@joshuao.com>
@joshuaoco
joshuaoco force-pushed the joshua/remove-poly1305-dependency branch from 5d3841c to bfa2df6 Compare July 19, 2026 07:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant