Fixes for cert signining

Hi Yencheng Fu,

Passing a pointer to `size_t` where the function is going to write a `unsigned long long` is dangerous. On some platforms, `size_t` and `unsigned long long` can have different sizes.

Also, overlapping pointers were not supported in libsodium > 0.4.5. This has been fixed, but distros are likely to ship < 1.0 versions for quite some time. So here is a simple workaround to avoid overlapping pointers.