-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Open
Labels
FeatureRequestIssues asking for a new feature that does not need a proposal.Issues asking for a new feature that does not need a proposal.NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.Performancecompiler/runtimeIssues related to the Go compiler and/or runtime.Issues related to the Go compiler and/or runtime.
Milestone
Description
go version go1.26-devel_e7c0b74a97 Tue Jan 6 20:29:01 2026 +0100 linux/amd64
I don't know what the name is for this pattern so I've made one up, but basically the assembly for this function looks awful:
func ConstantTimeCompare(x, y []byte) int {
if len(x) != len(y) { panic("...") }
var v byte
for ; len(x) > 0; x, y = x[1:], y[1:] {
a := y[0]
b := x[0]
v |= a ^ b
}
return constanttime.Eq(v, 0)
}- after early loop rotation cmd/compile: early loop rotation #77089 we could move
s[1:]operations intoif len(x) > 0 { /* here */; goto loop }second loop check, this would allow us to remove the slice mask - we keep track of the length of both slices, even tho it is identical
Metadata
Metadata
Assignees
Labels
FeatureRequestIssues asking for a new feature that does not need a proposal.Issues asking for a new feature that does not need a proposal.NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.Performancecompiler/runtimeIssues related to the Go compiler and/or runtime.Issues related to the Go compiler and/or runtime.
Type
Projects
Status
Todo