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

Rename Sel.SecretKey.Cipher.Hash to Ciphertext #182

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

intricate
Copy link

Resolves #181

In sel, why do we refer to the ciphertext + authentication tag secretbox output as a "hash"? At a glance, this seems like it could be misleading.

@@ -255,16 +255,16 @@ nonceToHexByteString (Nonce nonceForeignPtr) =
-- | A ciphertext consisting of an encrypted message and an authentication tag.
--
-- @since 0.0.1.0
data Hash = Hash
data Ciphertext = Ciphertext
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we prefer Ciphertext or CipherText?

I noticed a little bit of inconsistency:

In Sel.PublicKey.Cipher and Sel.SecretKey.Stream, we have two types named CipherText. However, in Sel.SecretKey.Stream, there are functions where this capitalization is not consistent: ciphertextFromHexByteString, ciphertextToBinary, etc.

Just let me know which way you guys prefer and I can make the changes throughout the project, if you like.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've personally always used "ciphertext" as a single word but, of course, I'd like to comply with the API that you prefer.

Comment on lines -305 to +308
-- | Create a 'Hash' from a binary 'StrictByteString' that you have obtained on your own,
-- usually from the network or disk. It must be a valid hash built from the concatenation
-- of the encrypted message and the authentication tag.
-- | Create a 'Ciphertext' from a hexadecimal-encoded 'StrictByteString' that
-- you have obtained on your own, usually from the network or disk. It must be
-- a valid ciphertext built from the concatenation of the encrypted message and
-- the authentication tag.
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any idea what line width we're generally targeting? I changed this to 80 chars when updating the docs, but I'm happy to comply with whatever you prefer.

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

Successfully merging this pull request may close these issues.

Naming of Sel.SecretKey.Cipher.Hash
1 participant