diff options
author | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2014-10-14 21:19:53 +0200 |
---|---|---|
committer | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2014-11-08 23:24:03 +0100 |
commit | f05f6a00a6b0f150b0a0b51cd7b44b9c9193e3de (patch) | |
tree | 68ff46ae6fa1575eb6052465a8708fb96311894e /src/Volume/Hash.h | |
parent | 905a3ff4a5d70a00d9ba7819b9f43ad9ce0654e6 (diff) | |
download | VeraCrypt-f05f6a00a6b0f150b0a0b51cd7b44b9c9193e3de.tar.gz VeraCrypt-f05f6a00a6b0f150b0a0b51cd7b44b9c9193e3de.zip |
Integrate SHA-256 support into Linux/MacOSX code. Set PRF priority to SHA-512 -> Whirlpool -> SHA-256 -> RIPEMD-160 .
Diffstat (limited to 'src/Volume/Hash.h')
-rw-r--r-- | src/Volume/Hash.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/Volume/Hash.h b/src/Volume/Hash.h index 70872d54..3df9f5b7 100644 --- a/src/Volume/Hash.h +++ b/src/Volume/Hash.h @@ -64,6 +64,28 @@ namespace VeraCrypt Ripemd160 (const Ripemd160 &); Ripemd160 &operator= (const Ripemd160 &); }; + + // SHA-256 + class Sha256 : public Hash + { + public: + Sha256 (); + virtual ~Sha256 () { } + + virtual void GetDigest (const BufferPtr &buffer); + virtual size_t GetBlockSize () const { return 64; } + virtual size_t GetDigestSize () const { return 256 / 8; } + virtual wstring GetName () const { return L"SHA-256"; } + virtual shared_ptr <Hash> GetNew () const { return shared_ptr <Hash> (new Sha256); } + virtual void Init (); + virtual void ProcessData (const ConstBufferPtr &data); + + protected: + + private: + Sha256 (const Sha256 &); + Sha256 &operator= (const Sha256 &); + }; // SHA-512 class Sha512 : public Hash |