|
| | Hash (void) |
| |
| | Hash (int algo) |
| |
| virtual | ~Hash (void) |
| |
| void | init (int algo) |
| |
| void | update (const char *data, int len) |
| |
| void | update (const ByteArray &data) |
| |
| void | final (void) |
| |
| | ByteArray (void) |
| |
| | ByteArray (int len) |
| |
| | ByteArray (const char *data, int len) |
| |
| | ByteArray (const char *str) |
| |
| | ByteArray (int val, int len) |
| |
| | ByteArray (const ByteArray &ba) |
| |
| virtual | ~ByteArray (void) |
| |
| void | clear (void) |
| |
| int | length (void) const |
| |
| char * | get (void) |
| |
| const char * | get (void) const |
| |
| void | set (const char *data, int len) |
| |
| void | append (const char *data, int len) |
| |
| void | append (const ByteArray &ba) |
| |
| void | insert (const char *data, int len, int offset) |
| |
| void | fill (char value, int len, int offset) |
| |
| int | getInt (int def_val=0) const |
| |
| void | setInt (int val, int len) |
| |
| void | appendInt (int val, int len) |
| |
| void | getString (char *str, int max_size) const |
| |
| void | setString (const char *str) |
| |
| void | appendString (const char *str) |
| |
| std::string | toString (void) const |
| |
| std::string | toHexString (void) const |
| |
| int | compare (const ByteArray &ba) const |
| |
| ByteArray | sub (int offset, int len=-1) const |
| |
| ByteArray | lstrip (void) const |
| |
| ByteArray | rstrip (const std::set< char > &charsToBeStripped) const |
| |
| void | read (const char *filename) |
| |
| void | write (const char *filename) const |
| |
| void | xtrace (const char *text=0) const |
| |
| ByteArray & | operator= (const ByteArray &ba) |
| |
| const ByteArray & | operator+= (const ByteArray &ba) |
| |
| const ByteArray & | operator|= (const ByteArray &ba) |
| |
| const ByteArray & | operator^= (const ByteArray &ba) |
| |
| char & | operator[] (int idx) |
| |
Computes hash values.
- Note
- The hash is calculated locally. In order to compute the hash on the CryptoServer use the cxi::Cxi::hash_compute method.
The following algorithms are support by this class (see Mechanism Parameter):
- SHA-1
- RipeMD-160
- SHA-224
- SHA-256
- MD5
- SHA-384
- SHA-512
- SHA3-224
- SHA3-256
- SHA3-384
- SHA3-512
The following example illustrates the usage of the Hash class:
hash.
update(
"We are what we ", 15);
hash.
update(
"were waiting for", 16);
void xtrace(const char *text=0) const
Definition: bytearray.cpp:611
Computes hash values.
Definition: sw/cxi_api_c/def/hash.h:19
void update(const char *data, int len)
Definition: hash.cpp:189
void init(int algo)
Definition: hash.cpp:99
void final(void)
Definition: hash.cpp:237
#define CXI_MECH_HASH_ALGO_SHA512
SHA512.
Definition: fw/cxi/def/cxi_defs.h:457