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

proposal: crypto/cipher: export xor.go functions #28113

Closed
aaomidi opened this issue Oct 10, 2018 · 5 comments
Closed

proposal: crypto/cipher: export xor.go functions #28113

aaomidi opened this issue Oct 10, 2018 · 5 comments
Labels
FrozenDueToAge Proposal Proposal-Crypto Proposal related to crypto packages or other security issues
Milestone

Comments

@aaomidi
Copy link

aaomidi commented Oct 10, 2018

These functions are useful for everyone, please export them so everyone can use them:

https://github.com/golang/go/blob/master/src/crypto/cipher/xor.go

@agnivade
Copy link
Contributor

These functions are useful for everyone,

Some data points to back your claim would be helpful.

Keep in mind that any additional public API to the standard library has a maintenance cost and we would be locked in to not change the API. Having internal functions allow us to change the function signatures anytime.

@agnivade agnivade changed the title Export xor.go functions proposal: crypto/cipher: export xor.go functions Oct 10, 2018
@gopherbot gopherbot added this to the Proposal milestone Oct 10, 2018
@agnivade
Copy link
Contributor

/cc @FiloSottile

@agnivade agnivade added the Proposal-Crypto Proposal related to crypto packages or other security issues label Oct 10, 2018
@aaomidi
Copy link
Author

aaomidi commented Oct 10, 2018

XORing an slice of bytes is a commonly used function in crypto. GoLang being perfect language to implement and try new crypto ideas should provide these commonly used functions.

For example, to implement CTR you need to be able to XOR byte slices.

About the API cost, that is a great point and not really something I can comment on.

@ianlancetaylor
Copy link
Contributor

It seems to me that an external package could provide these functions. If we wanted to provide them in the standard library, I don't think crypto/cipher is the right place. I don't see a clear need for these to be exported from the standard library at all. https://golang.org/doc/faq#x_in_std .

@FiloSottile
Copy link
Contributor

This is too internal and optimization dependent to lock into a public API. Also, it’s a tool to build cryptographic primitives but not something any end user should be tempted to use on its own.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge Proposal Proposal-Crypto Proposal related to crypto packages or other security issues
Projects
None yet
Development

No branches or pull requests

5 participants