Closed ehmry closed 7 years ago
Looking at the compiled C makes me think arrays are a bad idea now, would it be better to use distinct string
types or ref array[...]
?
Thanks for the PR @ehmry As libsodium is loaded as a dynamic library, the input/output string sizes might be different from hardcoded values used at compile time. I briefly looked at some other wrappers (in Python) and they call the exposed functions as well. Those sizes might change very rarely, but it could happen. Any thoughts?
I think the sizes can be safely assumed to be constant because changing a key size anywhere should cause total protocol or application breakage. I think I should close this and wait a bit until I have more experience with Nim memory.
I will come back to this later.
This is a dubious PR because it makes a lot of changes, but I've found that using typed arrays catches mistakes in passing arguments in the correct order.
I'm new at Nim so really let the criticism flow.