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

Naming conventions #25

Open
silkeh opened this issue Mar 20, 2017 · 3 comments
Open

Naming conventions #25

silkeh opened this issue Mar 20, 2017 · 3 comments
Labels

Comments

@silkeh
Copy link
Contributor

silkeh commented Mar 20, 2017

As golint helpfully points out:

func name will be used as randombytes.RandomBytesSeedBytes by other packages, and that stutters; consider calling this SeedBytes

It gets especially cumbersome with functions like: cryptoaead.CryptoAEADAES256GCMEncrypt.

Additionally, overlap in naming with with crypto/nacl could result in making this library a drop-in replacement.

I think the most convenient way to structure the packages would be crypto/box, crypto/aead/aes256gcm and crypto/stream/xsalsa20.

Renaming, however, does break backward compatibility in a major way.

@redragonx
Copy link
Contributor

redragonx commented Mar 20, 2017

There are two sides to this, ideally this should follow Go idioms. However, there are a few projects that rely on this library. Most notably, SpiderOak's Semaphor.

At some point we should rename the folders though, perhaps a new branch for a 2.0 version? But Go does not support different versions of the same library very easy.

#23

@silkeh
Copy link
Contributor Author

silkeh commented Mar 22, 2017

It is not necessary to rename existing files immediately because the package names do not clash. They can exist side by side and they could be deprecated at some later date.

I noticed it eases development greatly to change the naming scheme. Especially because the tests are more portable. I have wrapped all crypto_aead functions in separate packages in a branch as an example. (This branch also makes other backward-breaking changes like returning bool instead of int.)

@silkeh silkeh mentioned this issue Jul 16, 2017
@redragonx
Copy link
Contributor

I merged #31 but we should write something about the new structure, otherwise people may try to use both sets of the AEAD functions.

I may create a version with just the new AEAD structure.

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

No branches or pull requests

2 participants