Open tel opened 11 years ago
In general I don't necessarily think typeclassing is the answer here. I type-classified parts of the API before (and although I certainly could have done it wrong) I don't think this small of an API deserves such overkill.
I think we should try and resolve some of the naming ambiguities and have Crypto.NaCl
import everything. This is minimal work but maximally useful to users, and I think it's reasonable to believe we can find some good names that are obvious.
It comes to mind purely because "encryptWithSecretKey" "encryptStream" "encryptPrivateKey" "decryptStream" "decryptWithSecretKey" &c. are sort of a bear. It's probably not really worth worrying over, though.
Right now in order to, say, create a key and use secret key encryption you currently have to import
which is a bit much, I feel. I'd much prefer to simply want to "do encryption" and therefore import
or do public key encryption and do
and get access to
Key
and maybe evenrandomBytes
(or a generalizedrandomKey
) immediately.This feels somewhat like a cry for a typeclass containing
(encrypt, decrypt, randomKey)
but that might be a bad solution.