SHA-384 message-digest.
More...
#include <base/security/SHA384.h>
Inherits Object, and PushInterface.
SHA-384 message-digest.
Implementation of the SHA-384 message-digest algorithm (see FIPS PUB 180-2). This class takes a message of arbitrary length and produces a 128-bit "fingerprint"/"message digest" of the message. According to the RFC it is computationally infeasible to produce two messages having the same message digest, or to produce any message having a given prespecified target message digest.
The SHA-384 is designed to have the following properties: it is computationally infeasible to find a message which corresponds to a given message digest, or to find two different messages which produce the same message digest.
String message =
"abcdefghijklmnopqrstuvwxyz";
fout <<
"message digest: " << checksum.
getValue() << ENDL;
- See also
- MD5Sum SHA1 SHA256 SHA512
- Version
- 1.0
- Examples
- testsuite/digest.cpp.
◆ SHA384()
◆ getBase64()
String SHA384::getBase64 |
( |
| ) |
const |
|
noexcept |
Returns the message digest encoded in Base64. This is only valid after pushEnd() has been invoked.
◆ getDigest() [1/2]
static String SHA384::getDigest |
( |
const uint8 * |
buffer, |
|
|
MemorySize |
size |
|
) |
| |
|
inlinestatic |
Returns the digest of the given message.
◆ getDigest() [2/2]
uint8 SHA384::getDigest |
( |
MemorySize |
index | ) |
const |
Returns n'th byte of the digest.
◆ getDigestSize()
MemorySize SHA384::getDigestSize |
( |
| ) |
const |
|
noexcept |
Returns the size of the digest in bytes.
◆ getTotalSize()
uint64 SHA384::getTotalSize |
( |
| ) |
const |
|
inlinenoexcept |
Returns the total size of the original message.
◆ getValue()
String SHA384::getValue |
( |
| ) |
const |
|
noexcept |
◆ push()
MemorySize SHA384::push |
( |
const uint8 * |
buffer, |
|
|
MemorySize |
size |
|
) |
| |
|
virtual |
Updates the checksum corresponding to the specified data. May be called multiple times. Raises OutOfRange if the total number of octets exceed the limit specified by MAXIMUM_SIZE.
- Parameters
-
buffer | The buffer holding the data. |
size | The number of octets in the buffer. |
Implements PushInterface.
- Examples
- testsuite/digest.cpp.
◆ pushEnd()
◆ BLOCK_SIZE
const unsigned int SHA384::BLOCK_SIZE = 128 |
|
static |
Internal block size in bytes.
◆ MAXIMUM_SIZE
const uint64 SHA384::MAXIMUM_SIZE = (1ULL << (64 - 3)) - 1 |
|
static |
Specifies the maximum length (in bytes) of the original message.
◆ MESSAGE_SCHEDULE
const unsigned int SHA384::MESSAGE_SCHEDULE = 80 |
|
static |
The message schedule size.