-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
Comments
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. |
/cc @FiloSottile |
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. |
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 . |
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. |
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
The text was updated successfully, but these errors were encountered: