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

Open
rski opened this issue May 12, 2021 · 2 comments
Open

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

rski opened this issue May 12, 2021 · 2 comments

Comments

@rski
Copy link

@rski 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 this to the Backlog milestone May 12, 2021
@heschi
Copy link
Contributor

@heschi heschi commented May 12, 2021

Loading

@FiloSottile
Copy link
Contributor

@FiloSottile FiloSottile commented May 13, 2021

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?

Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants