Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/crypto/curve25519: Element.carryPropagate is in a confusingly named file #46122

Closed
rski opened this issue May 12, 2021 · 3 comments
Closed
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@rski
Copy link

rski commented May 12, 2021

func (v *Element) carryPropagate() is in a file called fe_arm64_noasm.go, but the build tags in it are go:build !arm64 || !gc || purego, so it doesn't build for arm64. In the same vein, fe_amd64_noasm.go also is not meant for amd64, it has //go:build !amd64 || !gc || purego

@heschi heschi added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label May 12, 2021
@heschi heschi added this to the Backlog milestone May 12, 2021
@heschi
Copy link
Contributor

heschi commented May 12, 2021

@FiloSottile
Copy link
Contributor

The classic structure is to have

  • foo_noasm.go with go:build !arm64 || !gc || purego
  • foo_amd64.go with go:build arm64 && gc && !purego
  • foo_amd64.s with go:build arm64 && gc && !purego

but this package has different functions implemented in assembly for amd64 and arm64, so it needs two different corresponding go:build !$GOARCH || !gc || purego, one for no-arm64-asm, one for no-amd64-asm.

Anyone has better ideas for how to name them?

@rski
Copy link
Author

rski commented Jan 4, 2023

eh, I'm ok with this so I'll just close the issue. If anyone else feels strongly they can fix this but I'm not likely to run into it again (monkey's paw curls)

@rski rski closed this as completed Jan 4, 2023
@golang golang locked and limited conversation to collaborators Jan 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

4 participants