]> Cypherpunks repositories - gostls13.git/commit
crypto/internal/fips140/aes: fix CTR generator
authorBoris Nagaev <bnagaev@gmail.com>
Wed, 22 Oct 2025 14:26:30 +0000 (14:26 +0000)
committerDaniel McCarney <daniel@binaryparadox.net>
Thu, 30 Oct 2025 14:20:10 +0000 (07:20 -0700)
commit38317c44e71478220f842c7efd8078215825af92
tree79e45788bfc3ac0fd1b5f2aabb93845ba923189e
parent3be9a0e014ee56f25ce4aac6091c617799fd26f2
crypto/internal/fips140/aes: fix CTR generator

Fixed two issues in AVO based generator of amd64 asm code.

1. Updated golang.org/x/tools dependency to prevent build issue in Go 1.25.

> golang.org/x/tools@v0.24.0/internal/tokeninternal/tokeninternal.go:64:9:
> invalid array length -delta * delta (constant -256 of type int64)

This error was caused by changes in layout of data structures in Go. Package
golang.org/x/tools has a mirror of that struct and a static assert that it
matches the Go's struct.

2. Changed the package name from crypto/aes to crypto/internal/fips140/aes.

This fixed run time error:

> ctr_amd64_asm.go:31: could not find function "ctrBlocks1Asm"
and other errors

Now the following works as expected:

$ cd src/crypto/internal/fips140/aes/_asm/ctr/
$ go generate

The command re-generates file "src/crypto/internal/fips140/aes/ctr_amd64.s".

Fixes #75972

Change-Id: I28e4c9ebb5bf72506a524e36a0c81a1b50367a84
GitHub-Last-Rev: afc9f506e50df6dc25fd285d5a597b0e5c93b5d9
GitHub-Pull-Request: golang/go#75973
Reviewed-on: https://go-review.googlesource.com/c/go/+/712920
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
Reviewed-by: Daniel McCarney <daniel@binaryparadox.net>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
src/crypto/internal/fips140/aes/_asm/ctr/ctr_amd64_asm.go
src/crypto/internal/fips140/aes/_asm/ctr/go.mod
src/crypto/internal/fips140/aes/_asm/ctr/go.sum