Moved SHA256 code to libshared.a.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37235 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
* Copyright 2008, Ingo Weinhold, [email protected].
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
#ifndef SHA_256_H
|
||||
#define SHA_256_H
|
||||
|
||||
|
||||
#include <SupportDefs.h>
|
||||
|
||||
|
||||
#define SHA_DIGEST_LENGTH 32
|
||||
|
||||
|
||||
class SHA256 {
|
||||
public:
|
||||
SHA256();
|
||||
~SHA256();
|
||||
|
||||
void Init();
|
||||
void Update(const void* buffer, size_t size);
|
||||
const uint8* Digest();
|
||||
size_t DigestLength() const
|
||||
{ return SHA_DIGEST_LENGTH; }
|
||||
|
||||
private:
|
||||
void _ProcessChunk();
|
||||
|
||||
private:
|
||||
uint32 fHash[8];
|
||||
uint32 fDigest[8];
|
||||
uint32 fBuffer[64];
|
||||
size_t fBytesInBuffer;
|
||||
size_t fMessageSize;
|
||||
bool fDigested;
|
||||
};
|
||||
|
||||
|
||||
#endif // SHA_256_H
|
||||
Reference in New Issue
Block a user