Make UEFI boot-platform build again
[haiku.git] / headers / private / libroot / SHA256.h
blobb9c7307c325b7e9ce4aec84010d237f051cc68b9
1 /*
2 * Copyright 2008, Ingo Weinhold, ingo_weinhold@gmx.de.
3 * Distributed under the terms of the MIT License.
4 */
5 #ifndef _SHA_256_H
6 #define _SHA_256_H
9 #include <SupportDefs.h>
12 #define SHA_DIGEST_LENGTH 32
14 namespace BPrivate {
17 class SHA256 {
18 public:
19 SHA256();
20 ~SHA256();
22 void Init();
23 void Update(const void* buffer, size_t size);
24 const uint8* Digest();
25 size_t DigestLength() const
26 { return SHA_DIGEST_LENGTH; }
28 private:
29 void _ProcessChunk();
31 private:
32 uint32 fHash[8];
33 uint32 fDigest[8];
34 uint32 fBuffer[64];
35 size_t fBytesInBuffer;
36 size_t fMessageSize;
37 bool fDigested;
41 } // namespace BPrivate
43 using BPrivate::SHA256;
46 #endif // _SHA_256_H