diff --git a/src_crypt/picrypt.cpp b/src_crypt/picrypt.cpp index 8317c6ce..f725de79 100644 --- a/src_crypt/picrypt.cpp +++ b/src_crypt/picrypt.cpp @@ -394,6 +394,15 @@ PIByteArray PICrypt::passwordHash(const PIString & password, const PIByteArray & } +PIString PICrypt::version() { +#ifdef PIP_CRYPT + return SODIUM_VERSION_STRING; +#else + return PIString(); +#endif +} + + bool PICrypt::init() { #ifdef PIP_CRYPT static bool inited = false; diff --git a/src_main/crypt/picrypt.h b/src_main/crypt/picrypt.h index 6b632d6a..4ab08459 100644 --- a/src_main/crypt/picrypt.h +++ b/src_main/crypt/picrypt.h @@ -102,6 +102,9 @@ public: //! Generate password hash from "password" static PIByteArray passwordHash(const PIString & password, const PIByteArray & seed); + //! Returns libsodium version + static PIString version(); + private: static bool init();