Skip to content

Draft: Remove the sha512 libsodium include from base.h

This merge requests moves some implementation details to the cpp, such that we no longer need to include sodium/crypto_hash_sha512.h in the header file.

It now allocates the sha512 context on the heap, instead of the stack. Not calling _SHA512Final, will result in the context not being cleaned up, and thus a memory leak. But I think that's OK, since the _SHA512Init, and _SHA512Final functions are not part of the public API, and we only use them in one place, were both of them are called. It also wouldn't make sense to call _SHA512Init without calling _SHA512Final, so I don't expect errors with this in the future.

Edited by Hans Harmannij

Merge request reports

Loading