AlexaClientSDK
3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
|
Digest computation interface. More...
#include <DigestInterface.h>
Public Types | |
typedef std::vector< unsigned char > | DataBlock |
Data block type. This type represents a byte array. More... | |
Public Member Functions | |
virtual | ~DigestInterface () noexcept=default |
Default destructor. More... | |
virtual bool | process (const DataBlock &dataIn) noexcept=0 |
Updates digest with a data block. More... | |
virtual bool | process (DataBlock::const_iterator begin, DataBlock::const_iterator end) noexcept=0 |
Updates digest with a data block range. More... | |
virtual bool | processByte (unsigned char value) noexcept=0 |
Updates digest with a byte value. More... | |
virtual bool | processUInt8 (uint8_t value) noexcept=0 |
Updates digest with uint8_t value. More... | |
virtual bool | processUInt16 (uint16_t value) noexcept=0 |
Updates digest with uint16_t integer value. More... | |
virtual bool | processUInt32 (uint32_t value) noexcept=0 |
Updates digest with uint32_t integer value. More... | |
virtual bool | processUInt64 (uint64_t value) noexcept=0 |
Updates digest with uint64_t integer value. More... | |
virtual bool | processString (const std::string &value) noexcept=0 |
Updates digest with string value. More... | |
virtual bool | finalize (DataBlock &dataOut) noexcept=0 |
Finishes digest computation and produces the result. More... | |
virtual bool | reset () noexcept=0 |
Resets the digest. More... | |
Digest computation interface.
This interface wraps up logic for computing various digest types (SHA-2, RC5, etc.).
To compute the digest, the user shall call any of process methods to consume all input data, and when all data is consume, call finalize to get the result.
The instance of the class is reusable, and it also can be used if any of the methods returned an error code after call to reset().
This interface is not thread safe and caller must ensure only one thread can make calls at any time.
typedef std::vector<unsigned char> alexaClientSDK::cryptoInterfaces::DigestInterface::DataBlock |
Data block type. This type represents a byte array.
|
virtualdefaultnoexcept |
Default destructor.
|
pure virtualnoexcept |
Finishes digest computation and produces the result.
This method finishes digest computation and produces the result. The object is reset if this call succeeds and can be reused for computing new digest.
[out] | dataOut | Computed digest. The size of output depends on the selected digest algorithm. The method appends data to dataOut container. |
|
pure virtualnoexcept |
Updates digest with a data block.
Updates digest value with a data from a data block.
This call is logical equivalent to a following code:
[in] | dataIn | Data for digest. |
|
pure virtualnoexcept |
Updates digest with a data block range.
Updates digest value with a data from a data block range.
This call is logical equivalent to a following code:
[in] | begin | Begin of data block. This parameter must be equal or less than end. If the parameter is greater than dataInEnd the implementation does nothing and returns false. |
[in] | end | Range end. This parameter must be equal or greater than begin. If the parameter is smaller than begin the implementation does nothing and returns false. |
|
pure virtualnoexcept |
Updates digest with a byte value.
Updates digest value with a single byte value.
[in] | value | byte value. |
|
pure virtualnoexcept |
Updates digest with string value.
Updates digest with bytes from a string object. The input is treated as a byte array without terminating null character.
This method is equivalent to the following:
[in] | value | String value. |
|
pure virtualnoexcept |
Updates digest with uint16_t integer value.
Updates digest value with uint16_t data. This method uses big endian (network byte order) encoding for presenting input value as a byte array.
This method is equivalent to the following:
[in] | value | Integer value. |
|
pure virtualnoexcept |
Updates digest with uint32_t integer value.
Updates digest value with uint32_t data. This method uses big endian (network byte order) encoding for presenting input value as a byte array.
This method is equivalent to the following:
[in] | value | Integer value. |
|
pure virtualnoexcept |
Updates digest with uint64_t integer value.
Updates digest value with uint64_t data. This method uses big endian (network byte order) encoding for presenting input value as a byte array.
This method is equivalent to the following:
[in] | value | Integer value. |
|
pure virtualnoexcept |
Updates digest with uint8_t value.
Updates digest value with a 8-bit value.
[in] | value | Integer value. |
|
pure virtualnoexcept |
Resets the digest.
This method resets object state and prepares it for reuse.
AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0