diff --git a/src/sha_hash.h b/src/sha_hash.h index 0c6f565..5ebb764 100644 --- a/src/sha_hash.h +++ b/src/sha_hash.h @@ -41,6 +41,24 @@ public: } }; +class sha384hash : public hash_func +{ +public: + uint size() { + return SHA384_DIGEST_LENGTH; + } + + std::vector operator() (const std::vector&a) { + SHA384_CTX ctx; + SHA384_Init (&ctx); + SHA384_Update (&ctx, (const uint8_t*) & (a[0]), a.size() ); + std::vector r; + r.resize (size() ); + SHA384_Final ( (uint8_t*) & (r[0]), &ctx); + return r; + } +}; + class sha512hash : public hash_func { public: