diff options
author | Spencer Jackson <spencer.jackson@mongodb.com> | 2016-12-07 16:11:57 -0500 |
---|---|---|
committer | Spencer Jackson <spencer.jackson@mongodb.com> | 2017-02-02 17:48:07 -0500 |
commit | 47da0b53f9cd27aeec1d2822780784866269a47d (patch) | |
tree | 39bcdaf2374bab9d0186f07030d1b32c936cdd31 /src/mongo/crypto/crypto.h | |
parent | c742c4ebe789fafa3fccd4b25332a7df0782b252 (diff) | |
download | mongo-47da0b53f9cd27aeec1d2822780784866269a47d.tar.gz |
SERVER-26952: Cache SCRAM-SHA-1 ClientKey
Diffstat (limited to 'src/mongo/crypto/crypto.h')
-rw-r--r-- | src/mongo/crypto/crypto.h | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/mongo/crypto/crypto.h b/src/mongo/crypto/crypto.h index 7b08e371a84..1f010980078 100644 --- a/src/mongo/crypto/crypto.h +++ b/src/mongo/crypto/crypto.h @@ -28,24 +28,26 @@ #pragma once +#include <array> #include <cstddef> namespace mongo { +// Storage container for a SHA1 hash +using SHA1Hash = std::array<std::uint8_t, 20>; + namespace crypto { /* * Computes a SHA-1 hash of 'input'. */ -bool sha1(const unsigned char* input, const size_t inputLen, unsigned char* output); +SHA1Hash sha1(const unsigned char* input, const size_t inputLen); /* * Computes a HMAC SHA-1 keyed hash of 'input' using the key 'key' */ -bool hmacSha1(const unsigned char* key, - const size_t keyLen, - const unsigned char* input, - const size_t inputLen, - unsigned char* output, - unsigned int* outputLen); +SHA1Hash hmacSha1(const unsigned char* key, + const size_t keyLen, + const unsigned char* input, + const size_t inputLen); } // namespace crypto } // namespace mongo |