HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_SHA256.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: UT_SHA256.h (UT Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __UT_SHA256_H__
12 #define __UT_SHA256_H__
13 
14 #include "UT_API.h"
15 
16 #include "UT_String.h"
17 #include "UT_WorkBuffer.h"
18 
20 {
21 public:
22  UT_SHA256() { init(); }
23  // Produce a SHA256 hash
24  static void hash(const UT_WorkBuffer& input, UT_String& output);
25  static void hash(
26  const std::initializer_list<UT_StringView>& inputs,
27  UT_StringHolder& output);
28 
29 protected:
30  void init();
31  void update(const unsigned char* message, unsigned int len);
32  void finalize(unsigned char* digest);
33  void transform(const unsigned char* message, unsigned int block_nb);
34 
35  static const unsigned int SHA256_BLOCK_SIZE = 64;
36  static const unsigned int DIGEST_SIZE = 32;
37 
38  unsigned int myTotalLength;
39  unsigned int myLength;
40  unsigned char myBlock[SHA256_BLOCK_SIZE * 2];
41  uint32 myH[8];
42 };
43 
44 #endif // __UT_SHA256_H__
GLuint GLsizei const GLchar * message
Definition: glcorearb.h:2543
#define UT_API
Definition: UT_API.h:14
unsigned int myTotalLength
Definition: UT_SHA256.h:38
UT_SHA256()
Definition: UT_SHA256.h:22
unsigned int myLength
Definition: UT_SHA256.h:39
GA_API const UT_StringHolder transform
unsigned int uint32
Definition: SYS_Types.h:40