the class computing SHA1 hash
More...
#include <Sha1.h>
|
| static unsigned long | f (const long t, const unsigned long b, const unsigned long c, const unsigned long d) |
| | logical function used in SHA1 More...
|
| |
| static unsigned long | K (const long t) |
| | constant word used in SHA1 More...
|
| |
the class computing SHA1 hash
Definition at line 22 of file Sha1.h.
| static unsigned long kome::core::Sha1::f |
( |
const long |
t, |
|
|
const unsigned long |
b, |
|
|
const unsigned long |
c, |
|
|
const unsigned long |
d |
|
) |
| |
|
staticprotected |
logical function used in SHA1
- Parameters
-
| [in] | t | t count |
| [in] | b | variable B |
| [in] | c | variable C |
| [in] | d | variable D |
- Returns
- computed value
Definition at line 28 of file Sha1.cpp.
30 return ( ( b & c ) | ( ~b & d ) );
36 return ( ( b & c ) | ( b & d ) | ( c & d ) );
| static unsigned long kome::core::Sha1::K |
( |
const long |
t | ) |
|
|
staticprotected |
constant word used in SHA1
- Parameters
-
- Returns
- constant word
Definition at line 45 of file Sha1.cpp.
| static std::string kome::core::Sha1::transformData |
( |
void * |
src, |
|
|
const unsigned int |
length |
|
) |
| |
|
static |
transform data
- Parameters
-
| [in] | src | source data |
| [in] | length | data length |
- Returns
- SHA-1 string
Definition at line 62 of file Sha1.cpp.
64 unsigned char* uc = (
unsigned char*)src;
68 context.appendMessage( uc, length );
73 for(
unsigned int i = 0; i < 5; i++ ) {
74 s.append( FMT(
"%08x", context.m_h[ i ] ) );
| static std::string kome::core::Sha1::transformFile |
( |
const char * |
path | ) |
|
|
static |
transform
- Parameters
-
- Returns
- SHA-1 string
Definition at line 81 of file Sha1.cpp.
88 LOG_ERROR( FMT(
"Failed to open the file. [%s]", path ) );
96 unsigned char buff[ 0x1000 ];
98 while( ( readSize = fread( buff, 1, 0x1000, fp ) ) > 0 ) {
99 context.appendMessage( buff, readSize );
107 for(
unsigned int i = 0; i < 5; i++ ) {
108 s.append( FMT(
"%08x", context.m_h[ i ] ) );
FILE * fileopen(const char *path, const char *mode)
opens file
The documentation for this class was generated from the following files: